Leadtek WinFast 2000

From LinuxTVWiki
Jump to navigation Jump to search

An analog PCI tuner card from Leadtek.

Overview/Features

Identification

This card shows up on the PCI bus as two devices, one for video capture and one for audio:

lspci:

0000:01:06.0 Multimedia video controller: Brooktree Corporation Bt878 Video Capture (rev 11)
0000:01:06.1 Multimedia controller: Brooktree Corporation Bt878 Audio Capture (rev 11)

lspci -vn:

0000:01:06.0 Multimedia video controller: Brooktree Corporation Bt878 Video Capture (rev 11)
       Subsystem: LeadTek Research Inc.: Unknown device 6609
       Flags: bus master, medium devsel, latency 32, IRQ 12
       Memory at de000000 (32-bit, prefetchable)
       Capabilities: [44] Vital Product Data
       Capabilities: [4c] Power Management version 2
0000:01:06.1 Multimedia controller: Brooktree Corporation Bt878 Audio Capture (rev 11)
       Subsystem: LeadTek Research Inc.: Unknown device 6609
       Flags: bus master, medium devsel, latency 32, IRQ 12
       Memory at de001000 (32-bit, prefetchable)
       Capabilities: [44] Vital Product Data
       Capabilities: [4c] Power Management version 2

Making it Work

Card 34 in the bttv cardlist works for a variety of Leadtek cards, including the Winfast 2000, Winfast TV2000 XP, Winfast 2000, Winfast TV2000 XP Deluxe edition, Winfast TV2000 XP RM and Winfast TV2000 XP FM. Most of them also have an IR remote built in.


Kernel output

The card is recognized when the bttv module is loaded on boot; here's a typical dmesg log:

bttv: driver version 0.9.15 loaded
bttv: using 8 buffers with 2080k (520 pages) each for capture
bttv: Bt8xx card found (0).
ACPI: PCI Interrupt Link [LNK3] enabled at IRQ 5
ACPI: PCI interrupt 0000:01:06.0[A] -> GSI 5 (level, low) -> IRQ 5
bttv0: Bt878 (rev 17) at 0000:01:06.0, irq: 5, latency: 32, mmio: 0xde000000
bttv0: detected: Leadtek TV 2000 XP [card=34], PCI subsystem ID is 107d:6609
bttv0: using: Leadtek WinFast 2000/ WinFast 2000 XP [card=34,autodetected]
bttv0: using tuner=24
bttv0: i2c: checking for MSP34xx @ 0x80... not found
bttv0: i2c: checking for TDA9875 @ 0xb0... not found
bttv0: i2c: checking for TDA7432 @ 0x8a... not found
bttv0: i2c: checking for TDA9887 @ 0x86... not found
tuner: chip found at addr 0xc2 i2c-bus bt878 #0 [sw]
tuner: type set to 24 (Philips PAL/SECAM multi (FQ1216ME)) by bt878 #0 [sw]
bttv0: registered device video0
bttv0: registered device vbi0
bttv0: registered device radio0
bttv0: PLL: 28636363 => 35468950 .. ok
bttv0: add subdevice "remote0"
ir-kbd-gpio: bttv IR (card=34) detected at pci-0000:01:06.0/ir0

The second tuner line can also appear as one of:

tuner: type set to 2 (Philips NTSC (FI1236,FM1236 and compatibles)) by bt878 #0 [sw]
tuner: type set to 5 (Philips PAL_BG (FI1216 and compatibles))
tuner: type set to 38 (Philips PAL/SECAM multi (FM1216ME MK3)) by bt878 #0 [sw]
tuner: type set to 41 (Philips PAL_MK (FI1216 MK))


You may need to specify options to the bttv module in your /etc/modules.conf file. An example is:

options bttv tuner=24 card=34 lumafilter=1 combfilter=1 chroma_agc=1

Tuner Types

Number Type Countries
2 NTSC United States
3 SECAM+PAL_BG France
5 PAL default
24 PAL/SECAM multi South Africa
38 PAL Austria, Belgium (used for a Deluxe edition)
43 NTSC United States (newer cards)
56 PAL/SECAM multi Romania


Getting sound from the sound card

It is unknown if the btaudio module works with this card. A patch cable from the tv card to the sound card does work. A patch cable from the tv card to the motherboard CD-in also works for those with onboard sound cards.

Setting up the remote

An example of the remote that comes with this card is here.

Loading the module

For kernels <= 2.6.14. This can be done in your /etc/modules.conf as follows:

options bttv tuner=24 card=34 lumafilter=1 combfilter=1 chroma_agc=1
above bttv ir_kbd_gpio

On recent kernels up to at least 2.6.17 the module ir_kbd_gpio is not needed any more. However, for some kernel versions, you may need to apply this patch.

On at least the Winfast TV2000 XP RM with kernel 2.6.28-13, the remote is detected as a standard input device without additional modules or patches.

Testing that the IR device is loaded

Check for an entry in /proc/bus/input/devices and note the event number (in this example, it is "event0"):

I: Bus=0001 Vendor=107d Product=6609 Version=0001
N: Name="bttv IR (card=34)"
P: Phys=pci-0000:01:06.0/ir0
H: Handlers=kbd event0
B: EV=100003
B: KEY=8fc736 2350000 0 0 0 10000 10000 190 40004801 1e0001 fff80 0 4002

In Ubuntu (or Mythbuntu) 9.10, the event number seems to change often. To fix this, use a UDEV rule to make a symlink for the event note as described here. From here on, I will refer to my symlink "/dev/input/bttv_remote" instead of "/dev/input/event0".

The UDEV rule that I use (by adding to /etc/udev/rules.d/60-symlinks.rules) is the following:

KERNEL=="event*", ATTRS{vendor}=="0x109e", ATTRS{device}=="0x036e", ATTRS{modalias}=="pci:v0000109Ed0000036Esv0000107Dsd00006606bc04sc00i00", SYMLINK+="input/bttv_remote"

Loading the correct configuration file

Leadtek WinFast cards come with different remotes. LIRC is bundled with configuration files for most remotes. As this guide uses the devinput driver, you do not need to use a remote-specific configuration file. Try adding the following to your /etc/lircd.conf

include "/etc/lirc/linux-input-layer-lircd.conf"

Setting up LIRC

You should be able to test the remote is working by:

sudo evtest /dev/input/bttv_remote

And pressing keys. This will work even when LIRC is not configured correctly, as the devinput method essentially treats your remote like a keyboard. You can now point lircd to the new device by passing the following arguments to lircd:

sudo /usr/sbin/lircd -d /dev/input/bttv_remote -H devinput

To make lircd use these settings persistently, you need to edit /etc/lirc/hardware.conf to read:

# /etc/lirc/hardware.conf
#
#Chosen Remote Control
REMOTE="Winfast TV2000/XP (card"
REMOTE_MODULES="bttv"
REMOTE_DRIVER="devinput"
REMOTE_DEVICE="/dev/input/bttv_remote"
REMOTE_SOCKET=""
REMOTE_LIRCD_CONF="devinput/lircd.conf.devinput"
REMOTE_LIRCD_ARGS=""

Note that there is nothing specific to the WinFast remote, as the devinput driver is being used.

GPIO pin table

The General Purpose I/O pins have the following functions on the Winfast 2000 XP Global card:


GPIO Pin Description
  1-0    Driver used
  2      Mute
  7-3    remote control code from PIC
  8      remote control pulse sent
  9      FM id
         0: No FM tuner
         1: FM tuner present
  11-10  remote control code from PIC
  12     Xceive tuner reset: active low
  14     remote id
         0: disabled remote control
         1: enabled remote control
  15     Tuner id
         0: reserved
         1: xceive xc2028
  18     select SIF to 88x
         0: FM audio
         1: TV audio
  19     select audio output line
         0: TV/FM audio
         1: Line in audio
  22     0: remote bootup
         1: no remote bootup
  23     driver used. default -1

The table was posted by Alex Deucher to the v4l mailing list in April 2007.