KWorld ATSC 120

From LinuxTVWiki
Jump to navigation Jump to search
Top view of ATSC120

An ATSC PCI card from KWorld.

It is supported under Linux since kernel 2.6.26 [1]. For older kernels, detailed setup instructions can be found below.

Overview/Feature

The Kworld ATSC 120, also known as the KWorld PlusTV HD PCI 120, can receive standard analog television signals (NTSC, PAL, possibly others), as well as standard and high definition digital ATSC broadcasts up to 1920x1080 interlaced.

The ATSC 120 features composite and s-video inputs, an analog FM radio, and an infrared remote control. Television and FM radio audio may be received via an internal PCI/DMA device that is handled by ALSA (e.g. as /dev/dsp1), and via a line-out connector on the back of the card.

This device is identical to the Geniatech HDTV Thriller X8000A.

Note: This article is a work in progress.

Status

As of 27 Mar 2008 and revision 7448 of the main v4l-dvb repository, this card can be used in both analog and digital ATSC modes via a set of experimental drivers. The FM radio, composite video, and S-Video inputs all work when the card is initialized into analog mode. Due to a resource conflict in the driver caused by this card's architecture, a reboot is necessary to switch between analog and ATSC modes. The cause of this issue has been located, and work is ongoing to fix it.

The remote control is not currently supported in any mode, yet.

The Line-out jack is somewhat functional, but is not considered ready to use, yet.

PCI Information

The ATSC 120 has a PCI subsytem ID of 17de:08c1. The complete details of this card, as reported by lspci -vvnn are:

00:05.0 Multimedia video controller [0400]: Conexant CX23880/1/2/3 PCI Video and Audio Decoder [14f1:8800] (rev 05)
        Subsystem: KWorld Computer Co. Ltd. Unknown device [17de:08c1]
        Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop- ParErr- Stepping- SERR+ FastB2B-
        Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
        Latency: 64 (5000ns min, 13750ns max), Cache Line Size: 64 bytes
        Interrupt: pin A routed to IRQ 21
        Region 0: Memory at fa000000 (32-bit, non-prefetchable) [size=16M]
        Capabilities: [44] Vital Product Data
        Capabilities: [4c] Power Management version 2
                Flags: PMEClk- DSI+ D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
                Status: D0 PME-Enable- DSel=0 DScale=0 PME-

00:05.1 Multimedia controller [0480]: Conexant CX23880/1/2/3 PCI Video and Audio Decoder [Audio Port] [14f1:8801] (rev 05)
        Subsystem: KWorld Computer Co. Ltd. Unknown device [17de:08c1]
        Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop- ParErr- Stepping- SERR+ FastB2B-
        Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
        Latency: 64 (1000ns min, 63750ns max), Cache Line Size: 64 bytes
        Interrupt: pin A routed to IRQ 21
        Region 0: Memory at fb000000 (32-bit, non-prefetchable) [size=16M]
        Capabilities: [4c] Power Management version 2
                Flags: PMEClk- DSI+ D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
                Status: D0 PME-Enable- DSel=0 DScale=0 PME-

00:05.2 Multimedia controller [0480]: Conexant CX23880/1/2/3 PCI Video and Audio Decoder [MPEG Port] [14f1:8802] (rev 05)
        Subsystem: KWorld Computer Co. Ltd. Unknown device [17de:08c1]
        Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop- ParErr- Stepping- SERR+ FastB2B-
        Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
        Latency: 64 (1500ns min, 22000ns max), Cache Line Size: 64 bytes
        Interrupt: pin A routed to IRQ 21
        Region 0: Memory at fc000000 (32-bit, non-prefetchable) [size=16M]
        Capabilities: [4c] Power Management version 2
                Flags: PMEClk- DSI+ D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
                Status: D0 PME-Enable- DSel=0 DScale=0 PME-

Major components used

  • Xceive XC3028 (tuner & analog IF demodulator)
  • Samsung S5H1409 (digital demodulator, Conexant CX24227 compatible)
  • Conexant cx23880 (A/V Decoder & PCI bridge)

Making it Work

For kernels prior to 2.6.26, the ATSC 120 is still a fairly routine card to set up, and selecting the desired default mode is accomplished by simply loading the proper module after a reboot.

Step by Step

1. Getting Started

  • If you have a set of speakers, headphones, or another audio device connected to the card's audio output jack (the green connector on the harness), you will need to disconnect it. The driver has a few minor bugs, one of which causes the audio output to be somewhat unpredictable. Instead, we will use the internal digital audio feeds that the card provides.

If your distribution already uses a generic 2.6.26 (or later) kernel and you wish to stick with that kernel, most likely everything has already been configured properly. Please skip all the build/install information below and go to step 3.

  • Create a work directory. When everything is said and done, one can clean up by simply deleting the work directory (and everything in it).
  • Your card uses an Xceive XC3028 tuner chip, which requires a piece of firmware to be loaded into it before use. Acquire the firmware file and place it in /lib/firmware , as directed by the XC3028/2028 info page.
  • Download the "latest stable version" of the Linux kernel from The Linux Kernel Archive (look for the "F" link on the right in the first kernel line). If you prefer, you may instead browse that website and choose almost any kernel version newer than 2.6.22. Extract the archive into your work directory.

2. Configure the Kernel

  • Instructions for configuring, compiling, and installing a Linux kernel can be found in this How-To. If your distribution provides an official method for doing this (as part of a tutorial, perhaps), it is recommended that you consult with their documentation from time to time, just to make sure you don't skip a step that is critical to your particular distribution.
  • Within the kernel configuration program, navigate to Device Drivers ---> Multimedia devices (about three pages down), and find the "Video for Linux" and "DVB for Linux" trees. There are two routes to take from here...

Option A: Using a 2.6.26 or newer kernel with the in-kernel driver code.

Enter into the Multimedia Devices menu and make the following changes:
 Device Drivers  ---> 
   Multimedia devices  --->
     <M> Video For Linux
     <M> DVB for Linux
     [*] Video capture adapters (NEW)  --->
         [*]   Autoselect pertinent encoders/decoders and other helper chips
         <M>   Conexant 2388x (bt878 successor) support
         <M>     Conexant 2388x DMA audio support
         <M>     DVB/ATSC Support for cx2388x based TV cards
     [*] DVB/ATSC adapters (NEW)  --->
     [*]   Customise the frontend modules to build
         Customise DVB Frontends  --->
            <M> Samsung S5H1409 based
  • After these options are set, you may back out of this menu and continue exploring, configuring, etc. at your discretion, according to your hardware, your needs, etc.. When you are finished, exit from the configuration program and let it save the new configuration file.
  • Return to the aforementioned how-to to build and install your new kernel, and to prepare your system to boot with it. Usually, this is done with `make && make install`. You must also edit your LILO or GRUB configuration (depending on which one your system uses) so that your bootloader will recognize the new kernel.
  • Once you're sure the system is ready, proceed to step 3, below.

Option B: Using any recent kernel with the v4l-dvb repository

  • Turn the "Video for Linux" and "DVB for Linux" trees off entirely. That is, cursor to and press "N" on each one.
  • There is a minor bug in the way the cx88-alsa module communicates with the kernel's I2C driver - out-of-kernel drivers have trouble connecting to it (code-wise that is). To work around this, go back up to the Device Drivers menu and find "I2C support". Make these changes:
 Device Drivers --->
   <M> I2C support  --->
     <M>   I2C device interface
     [ ]   Autoselect pertinent helper modules    {That is, press "N" to turn this item off entirely.}
             I2C Algorithms  ---> 
               <M> I2C bit-banging interfaces
Also browse the "I2C Hardware Bus support" and "Miscellaneous I2C Chip support" menus and make sure the I2C drivers for your hardware (if any) are turned on, as modules.
  • After these options are set, you may back out of this menu and continue exploring, configuring, etc. at your discretion, according to your hardware, your needs, etc.. When you are finished, exit from the configuration program and let it save the new configuration file.
  • Return to the aforementioned how-to to build and install your new kernel, and to prepare your system to boot with it. Usually, this is done with `make && make install`. You must also edit your LILO or GRUB configuration (depending on which one your system uses) so that your bootloader will recognize the new kernel.
  • Once you're finished, and you're sure everything looks right, reboot your machine and give your new kernel a quick test drive. We do this to make sure that there is no confusion as to which kernel the v4l-dvb repository should build against. If everything looks good, proceed:
  • Acquire Mercurial and install it. This can probably be found in your distribution's software repository. If not, get it from the official website.
  • Acquire, build, and install the v4l-dvb repository from linuxtv.org, using the following commands as root (the exact figures, marked out with X's below, will change over time as the repository is updated):
  # hg clone http://linuxtv.org/hg/v4l-dvb
  
  destination directory: v4l-dvb
  requesting all changes
  adding changesets
  adding manifests
  adding file changes
  added XXXX changesets with XXXXX changes to XXXX files
  updating working directory
  XXXX files updated, XX files merged, XX files removed, XX files unresolved
  
  # cd v4l-dvb
  # make
...various build messages will appear here. Watch the first screen full of the output carefully and take note of the version of the kernel that the v4l-dvb repository is being built against - it must state that it is using version of the kernel that you are using or plan to use.
  # make install

3. Set up the drivers

  • The aforementioned analog-versus-digital bug has an additional side effect, aside from the need for a reboot - the kernel will try to load all of the modules this card can use, causing the card to fail to work properly. In order to have more precise control of what modules get loaded, and exactly when, create a new file to blacklist the new modules, to keep them from being auto-loaded:
  # nano /etc/modprobe.d/blacklist-misc

  blacklist cx8800
  blacklist cx8802
  blacklist cx88-alsa
  blacklist cx88-dvb
  • Save the file out. If so desired, reboot your system and do an lsmod, to verify that the drivers were successfully blacklisted.
  • Decide which mode you wish to use as the default: NTSC and the various analog sources, or digital/ATSC mode.
  • To make digital/ATSC the default (for Debian, Ubuntu, and similar):
  # nano /etc/rc.local

  mv /etc/modprobe.d/blacklist-misc /root
  modprobe cx88-dvb
  cp /root/blacklist-misc /etc/modprobe.d
Here, we move the blacklist file off to root's home directory to temporarily disable it (and to create a backup copy), load the modules, then put the blacklist back into place so that it works for the next reboot. Skipping the move commands will cause the modprobe command to fail in many systems.
  • To make Analog mode the default, do this instead:
  # nano /etc/rc.local

  mv /etc/modprobe.d/blacklist-misc /root
  modprobe cx8800
  modprobe cx88-alsa
  cp /root/blacklist-misc /etc/modprobe.d
If there is an "exit 0" or similar command in the script, be sure your changes precede it.

4. Reboot and test

  • As the title of this section says, it is time to reboot the computer and make sure the computer loaded the modules appropriate for the mode you chose above. The easiest way for the non-technical user is to fire up a TV program. and see what happens.
  • For analog mode, programs such as Xawtv, TVtime, KDETV and similar will work as a quick test. The internal audio feed provided by the cx88-alsa driver is not recognized by these programs, so if you wish to check the sound as well, you'll need to use "sox" to forward the audio stream to your sound card. Something like this should work:
xawtv -noxv & sox -w -r 48000 -t ossdsp /dev/dsp1 -t ossdsp /dev/dsp
  • MythTV is an exception to this rule - it knows how to handle the separate audio stream properly, when so configured.
  • For digital mode, use MythTV or XINE. If you chose MythTV, be sure you configure your system to start the MythTV backend after the modules above have been loaded, perhaps by editing the above "rc.local" script and adding commands to explicitly terminate and restart it after the "modprobe" and "mv" commands. Not doing so will cause the backend to fail to sense the presence of the driver and the video/audio devices it creates.
  • Your capture card should now be ready to use.

Addendum.

  • Although supported in the Linux kernel since 2.6.26 (as stated above), there are some additional steps required for the DVB (ATSC) tuner to function.

1. As previously mentioned, you must blacklist the analog drivers (cx8800 and cx88-alsa) for the DVB tuner to function properly. In addition, two firmware files must be properly loaded for the channel scan feature to detect/lock onto channels. These firmware files are dvb-fe-xc5000-1.1.fw (which should be placed in /lib/firmware/*yourkernelhere*) and xc3028-v27.fw (which should be placed in /lib/firmware). Both of these firmware files can be obtained from http://www.steventoth.net/linux/xc5000/HVR-12x0-14x0-17x0_1_25_25271_WHQL.zip. To retrieve the firmware files, proper scripts must be run. For dvb-fe-xc5000-1.1.fw, download and run this script (http://www.steventoth.net/linux/xc5000/extract.sh ) from the some base folder as the aforementioned zip file. For xc3028-v27.fw, follow these steps:

  1. In order to use, you need to:
  2. 1) Download the windows driver with something like:
  3. wget http://www.steventoth.net/linux/xc5000/HVR-12x0-14x0-17x0_1_25_25271_WHQL.zip
  4. 2) Extract the file hcw85bda.sys from the zip into the current dir:
  5. unzip -j HVR-12x0-14x0-17x0_1_25_25271_WHQL.zip Driver85/hcw85bda.sys
  6. 3) Download the extract script
  7. wget http://linuxtv.org/hg/v4l-dvb/raw-file/3919b17dc88e/linux/Documentation/video4linux/extract_xc3028.pl
  8. 3) run the script:
  9. perl extract_xc3028.pl
  10. 4) copy the generated file:
  11. sudo cp xc3028-v27.fw /lib/firmware

Restart and you should be able to scan and lock onto digital OTA channels.

External Links