Hi,
I have a Techwell pci card based on the 6816 chipset. I have managed to make it work partially (The card has 8 video inputs, I can get 4 to work).
I had to change the source code of the tw68 driver a bit for this. (I know C, but I don't really know anything about Linux kernel drivers. The change is pretty trivial, which is the reason I was able to do this...)
I thought I'd share my experience as it might be helpful for others with the same card, or a similar one. Obviously, I would be interested if anyone has any idea on how to get the remaining 4 inputs to work.
I am running debian squeeze with kernel
Linux cam 2.6.32-5-686 #1 SMP Fri Dec 10 16:12:40 UTC 2010 i686 GNU/Linux
Doing a
lspci -n | grep 1797
shows this (the grep is just to filter out non-related hardware)
Code: Select all
02:08.0 0400: 1797:6810 (rev 10)
02:08.1 0400: 1797:6811 (rev 10)
02:08.2 0400: 1797:6812 (rev 10)
02:08.3 0400: 1797:6813 (rev 10)
02:08.4 0480: 1797:6814 (rev 10)
02:08.5 0480: 1797:6815 (rev 10)
02:08.6 0480: 1797:6816 (rev 10)
02:08.7 0480: 1797:6817 (rev 10)
The tw68 driver does not recognize these pci devices, but it turns out it will work fine with the first 4 devices if it would recognize them. We can make the driver recognize the devices by modifying the source code a bit. In the file tw68-cards.c, look for the line
Code: Select all
struct pci_device_id tw68_pci_tbl[] = {
Below that you'll see definitions for the 6800, 6801 and 6804 cards. Copy and paste 4 times one such definition, and change the number to 6810, 6811, 6812 and 6813.
Then, in the tw68.h file, look up the line
cope and paste 4 times, and change the number again to 6810, 6811, 6812 and 6813.
Now do a make and make install, and reboot. With some luck, you should have the /dev/video0 to /dev/video3 devices.
About my attempts to make the other 4 inputs work:
Adding any of the remaining pci ids 6814, 6815, 6816 and 6817 in the same way does not create a new /dev/video device, and produces some error messages in dmesg. Even removing the 6810 to 6813 ones, and only include 6814 does not work (so it is a problem with the device, not the fact that it is the 5th one). The 4 remaining devices are a bit different in that they don't come with audio inputs on the card. I also noted that the lspci lists them with the number 0480 instead of 0400, although I don't know what that number means. Below is part of my dmesg, created with 5 devices defined in the source. It shows 6810 to 6813 loading fine, and the problems with loading 6814.
Anyone any ideas?
Code: Select all
[ 8.844884] Linux video capture interface: v2.00
[ 8.891688] tw68: v4l2 driver version 0.0.4 loaded
[ 8.891739] tw68 0000:02:08.0: PCI INT A -> GSI 17 (level, low) -> IRQ 17
[ 8.891747] tw6810[0]: found at 0000:02:08.0, rev: 16, irq: 17, latency: 64, mmio: 0xfcfdf000
[ 8.891755] tw6810[0]: subsystem: 1797:6810, board: GENERIC [card=0,autodetected]
[ 8.891783] tw6810[0]: Unable to determine board type, using generic values
[ 8.992029] IRQ 17/tw6810[0]: IRQF_DISABLED is not guaranteed on shared IRQs
[ 8.992616] tw6810[0]: registered device video0 [v4l2]
[ 8.993100] tw6810[0]: registered device vbi0
[ 8.993134] tw68 0000:02:08.1: PCI INT A -> GSI 17 (level, low) -> IRQ 17
[ 8.993142] tw6811[1]: found at 0000:02:08.1, rev: 16, irq: 17, latency: 64, mmio: 0xfcfdf400
[ 8.993149] tw6811[1]: subsystem: 1797:6811, board: GENERIC [card=0,autodetected]
[ 8.993187] tw6811[1]: Unable to determine board type, using generic values
[ 9.096027] IRQ 17/tw6811[1]: IRQF_DISABLED is not guaranteed on shared IRQs
[ 9.096581] tw6811[1]: registered device video1 [v4l2]
[ 9.097059] tw6811[1]: registered device vbi1
[ 9.097095] tw68 0000:02:08.2: PCI INT A -> GSI 17 (level, low) -> IRQ 17
[ 9.097102] tw6812[2]: found at 0000:02:08.2, rev: 16, irq: 17, latency: 64, mmio: 0xfcfdf800
[ 9.097110] tw6812[2]: subsystem: 1797:6812, board: GENERIC [card=0,autodetected]
[ 9.097147] tw6812[2]: Unable to determine board type, using generic values
[ 9.192618] i801_smbus 0000:00:1f.3: PCI INT B -> GSI 17 (level, low) -> IRQ 17
[ 9.200038] IRQ 17/tw6812[2]: IRQF_DISABLED is not guaranteed on shared IRQs
[ 9.200129] tw6812[2]: registered device video2 [v4l2]
[ 9.200165] tw6812[2]: registered device vbi2
[ 9.200193] tw68 0000:02:08.3: PCI INT A -> GSI 17 (level, low) -> IRQ 17
[ 9.200201] tw6813[3]: found at 0000:02:08.3, rev: 16, irq: 17, latency: 64, mmio: 0xfcfdfc00
[ 9.200208] tw6813[3]: subsystem: 1797:6813, board: GENERIC [card=0,autodetected]
[ 9.200243] tw6813[3]: Unable to determine board type, using generic values
[ 9.260148] [drm] Initialized drm 1.1.0 20060810
[ 9.304032] IRQ 17/tw6813[3]: IRQF_DISABLED is not guaranteed on shared IRQs
[ 9.304134] tw6813[3]: registered device video3 [v4l2]
[ 9.304165] tw6813[3]: registered device vbi3
[ 9.304196] tw68 0000:02:08.4: PCI INT A -> GSI 17 (level, low) -> IRQ 17
[ 9.304204] tw6814[4]: found at 0000:02:08.4, rev: 16, irq: 17, latency: 64, mmio: 0xfcfdee00
[ 9.304211] tw6814[4]: subsystem: 1797:6814, board: GENERIC [card=0,autodetected]
[ 9.304249] tw6814[4]: Unable to determine board type, using generic values
[ 9.304266] BUG: unable to handle kernel paging request at f8385018
[ 9.304392] IP: [<f82b263a>] tw68_initdev+0x53b/0xba6 [tw68]
[ 9.304486] *pde = 36f93067 *pte = 00000000
[ 9.304607] Oops: 0002 [#1] SMP
[ 9.304726] last sysfs file: /sys/devices/pci0000:00/0000:00:1e.0/0000:02:08.2/video4linux/vbi2/index
[ 9.304778] Modules linked in: drm i2c_i801 i2c_algo_bit tw68(+) v4l2_common videodev v4l1_compat i2c_core videobuf_dma_sg videobuf_core btcx_risc parport_pc parport rng_core pcspkr dcdbas evdev psmouse processor button shpchp pci_hotplug serio_raw ext3 jbd mbcache sg sr_mod cdrom sd_mod crc_t10dif usbhid hid ata_generic uhci_hcd ata_piix thermal ehci_hcd floppy e1000 libata thermal_sys scsi_mod usbcore nls_base [last unloaded: scsi_wait_scan]
[ 9.306664]
[ 9.306707] Pid: 442, comm: modprobe Not tainted (2.6.32-5-686 #1) OptiPlex GX270
[ 9.306758] EIP: 0060:[<f82b263a>] EFLAGS: 00010286 CPU: 0
[ 9.306809] EIP is at tw68_initdev+0x53b/0xba6 [tw68]
[ 9.306855] EAX: f8385018 EBX: 00000080 ECX: f65e5eb8 EDX: f8384e00
[ 9.306903] ESI: 00000800 EDI: 00000000 EBP: f6640000 ESP: f65e5ec4
[ 9.306959] DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
[ 9.307016] Process modprobe (pid: 442, ti=f65e4000 task=f661aec0 task.ti=f65e4000)
[ 9.307083] Stack:
[ 9.307134] f6cb2000 f6640030 00000000 f6640120 f82b47e4 f6cb2000 f82b47b4 f82b47e4
[ 9.307460] <0> c1145dbd c1146707 f82b47b4 f6cb2000 f82b5244 f6cb205c ffffffed f82b47e4
[ 9.307872] <0> c11b2bf2 f6cb205c f82b47e4 f6cb2090 c11b2cc6 f82b47b4 00000000 c13a1584
[ 9.308003] Call Trace:
[ 9.308003] [<c1145dbd>] ? local_pci_probe+0xb/0xc
[ 9.308003] [<c1146707>] ? pci_device_probe+0x41/0x63
[ 9.308003] [<c11b2bf2>] ? driver_probe_device+0x8a/0x11e
[ 9.308003] [<c11b2cc6>] ? __driver_attach+0x40/0x5b
[ 9.308003] [<c11b2635>] ? bus_for_each_dev+0x37/0x5f
[ 9.308003] [<c11b2ac5>] ? driver_attach+0x11/0x13
[ 9.308003] [<c11b2c86>] ? __driver_attach+0x0/0x5b
[ 9.308003] [<c11b20fd>] ? bus_add_driver+0x99/0x1c5
[ 9.308003] [<c11b2ef7>] ? driver_register+0x87/0xe0
[ 9.308003] [<f82af549>] ? tw68_init+0x0/0x56 [tw68]
[ 9.308003] [<c11468d8>] ? __pci_register_driver+0x33/0x89
[ 9.308003] [<f82af549>] ? tw68_init+0x0/0x56 [tw68]
[ 9.308003] [<c100113e>] ? do_one_initcall+0x55/0x155
[ 9.308003] [<c1057375>] ? sys_init_module+0xa7/0x1d7
[ 9.308003] [<c10030fb>] ? sysenter_do_call+0x12/0x28
[ 9.308003] Code: 20 89 38 8b 85 4c 01 00 00 83 ca ff 83 c0 1c 89 10 b8 00 16 00 00 8b 95 4c 01 00 00 89 02 8b 85 50 01 00 00 b3 80 05 18 02 00 00 <88> 18 b8 64 00 00 00 e8 f7 88 d8 c8 8b 85 50 01 00 00 b2 40 05
[ 9.308003] EIP: [<f82b263a>] tw68_initdev+0x53b/0xba6 [tw68] SS:ESP 0068:f65e5ec4
[ 9.308003] CR2: 00000000f8385018
[ 9.308003] ---[ end trace 5998a93b50cbdc13 ]---