Linux driver for Leadtek PCI TV cards with XC4000 tuner
These patches implement experimental support for the Leadtek PCI TV cards with CX2388x and XC4x00 chipset on Linux, such as the WinFast DTV2000 H Plus. Additional patches are available also for the WinFast PxDVR3200 H (PCI-E), and Pinnacle PCTV 340E (USB, currently DVB-T only).
- Supports the following cards:
- WinFast TV2000 XP Global (PCI ID: 107D:6619)
This is not really a new card, just the already supported WinFast TV2000 XP Global with XC3028 compatible tuner with another PCI ID in addition to 107D:6618 and 107D:6F18.
- WinFast TV2000 XP Global with XC4100 tuner (PCI ID: 107D:6F36 or 107D:6F43)
The card with the first PCI ID is basically the same as the previous ones, only the tuner is replaced with an XC4100 (apparently an analog-only "value" version of the XC4000). The latter one additionally uses different GPIOs, that are more similar to those of the DTV1800 H.
- WinFast DTV1800 H with XC4000 tuner (PCI ID: 107D:6F38)
Other than the different tuner chip, this card is the same as the already supported one with XC3028 compatible tuner and PCI ID 107D:6654.
- WinFast DTV2000 H Plus (PCI ID: 107D:6F42)
Similar to the DTV1800 H with XC4000 tuner, but has an additional GPIO bit to select the use of the antenna or cable RF input.
- WinFast PxDVR3200 H with XC4000 tuner (PCI ID: 107D:6F39)
This is actually a CX23885 based PCI-E card, for which support has been contributed and tested by Mirek Slugen.
Note: I have only tested the DTV2000 H Plus in practice, the others have been added based on information in Windows .INF files. Some users reportedly have the DTV1800 H with XC4000 tuner (107D:6F38), but it is not sure if the above revisions of the TV2000 XP Global have actually been sold.
- Analog TV is implemented, and has been tested with PAL channels. It seems to work well. I have tested one SECAM (D/K) channel too, but I had to use the audio_std=8 module parameter, and the picture quality was not perfect (although the same channel could not be received properly on Windows at all). NTSC and SECAM-L/Lc are also supported, but were not tested.
- FM radio is implemented, and works well, without any major issues. Using module parameters, it is also possible to receive radio on the cable TV input, rather than the separate FM connector.
- Analog video (composite and S-video) and audio inputs are supported.
- IR is supported, tested, and confirmed to work.
- DVB-T is implemented for 6, 7, and 8 MHz bandwidth, but it was not tested extensively (I do not have access to any usable DVB-T signal). However, some users have recently reported that it works. More feedback on any DVB-T issues is welcome.
- The XC4000 driver supports power management, but it is disabled by default (the Windows driver probably does not use it either).
- A new V4L control has been added to the CX88 driver, which makes it possible to increase the sharpness of the analog TV picture. It can be set in the range 0 to 9 (the default is 0). Values 0, 2, 4, 6, and 8 will amplify the luma signal by 0, 2, 3.5, 5, and 6 dB at the chroma subcarrier frequency, respectively, and using odd values will switch to a different (slightly narrower) notch filter as well.
Disclaimer: this is experimental code, so use it at your own risk, and only if you are familiar with installing Linux kernel drivers from source code.
- Before installing, you may want to delete any previous V4L kernel modules from /lib/modules/kernel/drivers/media or /lib/modules/<KERNELVERSION>/kernel/drivers/media first, since old files left over from different versions may cause problems.
- Download and unpack V4L-DVB source code (see here).
- Apply the driver patch(es), for example (in the top level v4l-dvb directory, with the patch file(s) being in the parent directory):
patch -p1 < ../xc4000-winfast-a79dd2ae4d0e.patch
Or, with an older two-file patch:
patch -p1 < ../xc4000-28f5eca12bb0.patch
patch -p1 < ../cx88-dtv2000h+-28f5eca12bb0.patch
- Compile the V4L sources:
make clean
make
- Install the new kernel modules (as root):
make install
- Install the XC4000 firmware file (see detailed instructions here).
- Reboot the machine.
NOTES:
- If you are using a 2.6.34/35/37/38/39.x kernel version, it is now also possible to patch the kernel sources directly, using the patches contributed by Tomasz Kazmierczak and Mirek Slugen. This way, it is not necessary to download and use the V4L-DVB snapshot required by the original patch.
- On some versions of Ubuntu, there may be problems compiling the V4L-DVB source code, making it necessary to disable the 'firedtv' module. See this forum for details.
The XC4000 driver has a number of module parameters which can be used to finetune its operation:
- debug (integer, 0 to 2, defaults to 0)
Controls the level of verbosity of kernel debugging messages, which can be printed with the dmesg command.
- no_poweroff (integer, 0 to 2, defaults to 0)
If this parameter is set to 1, then the power management feature of the XC4000 chip is not used, so it is running all the time, consuming power (about 1W) and generating heat. But the advantage is that it can be initialized faster by TV or radio applications, as it is not necessary to reset the chip and reload the firmware every time on opening the video device.
When it is set to 2, power management is enabled, and the tuner chip is powered down when the video device is not being used by any application.
The default setting of zero will either enable or disable power management, depending on the card type. For the supported Leadtek PCI cards, it is disabled by default, as the Windows driver does not seem to be using it either.
- audio_std (integer, 6 bits (0 to 63), defaults to 0)
This option makes it possible to set details of the audio standards to be used. It is normally not needed, but you may try experimenting with it if there are problems with the analog TV audio. Additionally, it can be used to switch the FM radio from using the separate FM input connector to the cable TV input (useful if you can receive both TV and radio stations on the cable). It is a 6 bit value, which can be the sum of any of the following:
- 1: use NICAM/B and A2/B instead of NICAM/A and A2/A
- 2: use A2 instead of NICAM (for PAL) or BTSC (for NTSC)
- 4: use SECAM/K3 instead of K1 for SECAM-D/K
- 8: use PAL-D/K audio for SECAM-D/K
- 16: use FM radio input 1 (cable TV) instead of input 2 (FM)
- 32: use mono audio (the lower three bits are ignored if it is set); this does not work, so do not use it
- firmware_name (string, defaults to "xc4000.fw")
Set the firmware file name to be used. "xc4000-1.4.fw" is recommended, but the driver also supports the older "xc4000-1.2.fw". Note, however, that other firmware files, such as "dvb-fe-xc4000-1.4.1.fw" from kernellabs.com will not work.
- xc4000-winfast-a79dd2ae4d0e.patch (2010-03-23)
- xc4000-winfast-2.6.34.x.patch (2010-08-27)
- xc4000-winfast-2.6.35.x.patch (2010-08-27)
- xc4000-winfast-2.6.37.2.patch (2011-03-10)
- xc4000-winfast-2.6.38.x.patch (2011-04-15)
The latest driver. It is available as a patch against V4L-DVB HG revision a79dd2ae4d0e, but there are also new patches by Tomasz Kazmierczak and Mirek Slugen that can be applied directly to the 2.6.34.x, 2.6.35.x, 2.6.37.x, or 2.6.38.x kernel sources.
- pctv-340e_linux-2.6.35.diff (PCTV 340E only; 2010-11-11)
- pctv-340e_linux-2.6.39.diff (PCTV 340E only; 2011-06-02)
- pctv_340e-linux-next-338afa8.patch (PCTV 340E + Leadtek XC4000 cards for 2.6.39 RC, but also applies to the 2.6.39 release; 2011-04-30)
- pctv_340e-linux-next-338afa8.tar.gz (2011-04-30)
These patches to kernel 2.6.35/39.x and 2.6.39 RC (linux-next-20110404) by Mohammad Bahathir Hashim and Wojtbar Baranski add DVB-T only support for the Pinnacle PCTV 340E. The latter patch includes support for the Leadtek cards as well, and is also available as a .tar.gz package of the modified source files.
- xc4000-winfast-7a58d924fb04.patch (2010-03-10)
The previous version, without Mirek Slugen's PxDVR3200 H patch.
- xc4000-winfast-14021dfc00f3.patch (2010-02-19)
This older version did not include the DTV2000 H Plus RF input selection fix for DVB-T, and a few CX88 fixes. It is also against an older revision of the V4L-DVB source code, and is not compatible with the current snapshot.
- xc4000-14021dfc00f3.patch (2010-02-17)
cx88-dtv2000h+-14021dfc00f3.patch (2010-02-17)
An older patch, which only supported the DTV2000 H Plus card, did not have the CX88 sharpness control, and had the power management enabled by default for all XC4000 cards. Unlike the newer versions, it is a two-file patch, you need to apply both before compiling.
- xc4000-28f5eca12bb0.patch (2010-02-09)
cx88-dtv2000h+-28f5eca12bb0.patch (2010-02-09)
An even older version, with no DTV7 and power management support. However, I have used it for a longer time than the newer ones, and it generally seemed to be stable.
- a79dd2ae4d0e.tar.bz2 (2010-03-23)
7a58d924fb04.tar.bz2 (2010-03-10)
14021dfc00f3.tar.bz2 (2010-02-11)
28f5eca12bb0.tar.bz2 (2010-02-06)
V4L-DVB revisions with which the driver was built and tested. It is recommended to apply each patch to the corresponding V4L-DVB snapshot, although the 14021dfc00f3 and 28f5eca12bb0 revisions are compatible, and also a79dd2ae4d0e with 7a58d924fb04. Other revisions may work as well, but were not tested.
- xc4000-1.4.fw
Version 1.4 of the XC4000 firmware. You need to copy this to /lib/firmware/, or /lib/firmware/<KERNELVERSION>/ if that directory is present. Also, the file should be renamed to xc4000.fw, or the firmware_name=xc4000-1.4.fw parameter should be passed to the xc4000 module.
- xc4000-1.2.fw
An older version of the XC4000 firmware.
- xc4000fw.c
This simple utility can be used to create the firmware files by extracting data from a Windows driver, and also dump the contents of the firmware to standard output if run with the -v command line option. It has been tested with wfeaglxt.sys from Leadtek (both v1.2 and v1.4 firmware), and hcw85bda.sys from Hauppauge (v1.2 firmware). dvb7700all.sys from Pinnacle will not work, however.
These patches include code from Devin Heitmueller's PCTV 340e driver, and also from this older patch by Mirek Slugen, who has contributed the PxDVR3200 H and kernel 2.6.37.2 support as well. The kernel 2.6.34.x, 2.6.35.x, and 2.6.38.x patches have been created by Tomasz Kazmierczak. The PCTV 340E patches have been contributed by Mohammad Bahathir Hashim and Wojtbar Baranski.
© Istvan Varga
<istvan_v@mailbox.hu>, 2010-2011