# Twinhan DVB card:  bt878 module and card id unknown [SOLVED]

## jcat

##############################################################################

# EDIT:  I originally thought this was a kernel issue, so apologies if the title seems strange to start with (I've changed it!). #

##############################################################################

I have recently attempted to upgrade to the new 2.6.23 kernel using my usual Gentoo Sources version, and it seems to have been one of the most annoying kernel upgrades yet.  I've been messing around with the various options for the last half a day!

I had to change yet more networking options to get iptables working.

My dvb stuff seems to be a little screwed up now.

VMWare services are now producing a kernel panic!

I use the genkernel scripts, and generally perform the following commands to recompile.

```
zcat /proc/config.gz > /usr/share/genkernel/x86/kernel-config-2.6

genkernel --gensplash=Gentoo-Grey-fbsplash --menuconfig all
```

..and then wait  :Smile: 

According to Gentoo guides, that's a fairly safe way to upgrade from one kernel revision to another, even if their are differences, you just have to have a look around the config and make sure you add anything that's been changed recently that's relevant to you config.

I'll deal with the VMWare issue later, the more pressing issue for me at the moment is the TV!  I have a USB Avermedia dvb-t device that worked fine after I made sure all the kernel config was correct, but I also have a  TwinHan card that uses the "Brooktree Corporation Bt878 Video Capture" chipset, and that's not working still.

I see all the modules loaded that I think are relevent in particular: dvb_bt8xx, bt878, dst.  Here's the relevant sections of lsmod..

```
dvb_bt8xx              14340  0 

nxt6000                 9476  1 dvb_bt8xx

mt352                   8324  1 dvb_bt8xx

sp887x                  9092  1 dvb_bt8xx

dst_ca                 14080  1 dvb_bt8xx

dst                    24456  2 dvb_bt8xx,dst_ca

or51211                10116  1 dvb_bt8xx

zl10353                 8072  1 dvb_bt8xx

lgdt330x                9860  1 dvb_bt8xx

cx24110                 9476  1 dvb_bt8xx

bt878                  12008  2 dvb_bt8xx,dst

bttv                  148788  2 dvb_bt8xx,bt878

video_buf              18308  1 bttv

ir_common              27396  1 bttv

compat_ioctl32          4864  1 bttv

i2c_algo_bit            8324  1 bttv

btcx_risc               6792  1 bttv

tveeprom               16144  1 bttv

videodev               26880  1 bttv

v4l2_common            15104  2 bttv,videodev

v4l1_compat            15364  2 bttv,videodev

dvb_usb_a800            7940  28 

dvb_usb_dibusb_common     8836  1 dvb_usb_a800

dvb_pll                11524  2 dvb_bt8xx,dvb_usb_dibusb_common

mt2060                  7684  1 dvb_usb_dibusb_common

dib3000mc              12548  1 dvb_usb_dibusb_common

dibx000_common          6276  1 dib3000mc

dvb_usb                16652  2 dvb_usb_a800,dvb_usb_dibusb_common

button                  9744  0 

dvb_core               56616  6 dvb_bt8xx,dst_ca,dst,or51211,lgdt330x,dvb_usb

firmware_class         10240  5 dvb_bt8xx,sp887x,or51211,bttv,dvb_usb

i2c_core               17408  19 dvb_bt8xx,nxt6000,mt352,sp887x,dst,or51211,zl10353,lgdt330x,cx24110,nvidia,bttv,i2c_algo_bit,tveeprom,dvb_pll,mt2060,dib3000mc,dibx000_common,dvb_usb,i2c_nforce2

usbcore                92296  9 dvb_usb_a800,dvb_usb,sl811_hcd,usbhid,ohci_hcd,uhci_hcd,usb_storage,ehci_hcd
```

And here are the relevant parts of my dmesg..

```
dvb-usb: found a 'AVerMedia AverTV DVB-T USB 2.0 (A800)' in warm state.

dvb-usb: will pass the complete MPEG2 transport stream to the software demuxer.

DVB: registering new adapter (AVerMedia AverTV DVB-T USB 2.0 (A800))

DVB: registering frontend 0 (DiBcom 3000MC/P)...

input: IR-receiver inside an USB DVB receiver as /class/input/input4

dvb-usb: schedule remote query interval to 150 msecs.

dvb-usb: AVerMedia AverTV DVB-T USB 2.0 (A800) successfully initialized and connected.

usbcore: registered new interface driver dvb_usb_a800

Linux video capture interface: v2.00

bttv: driver version 0.9.17 loaded

bttv: using 8 buffers with 2080k (520 pages) each for capture

bttv: Bt8xx card found (0).

ACPI: PCI Interrupt 0000:02:0a.0[A] -> Link [APC3] -> GSI 18 (level, low) -> IRQ 19

bttv0: Bt878 (rev 17) at 0000:02:0a.0, irq: 19, latency: 32, mmio: 0xd8000000

bttv0: subsystem: ffff:0001 (UNKNOWN)

please mail id, board name and the correct card= insmod option to video4linux-list@redhat.com

bttv0: using:  *** UNKNOWN/GENERIC ***  [card=0,autodetected]

bttv0: gpio: en=00000000, out=00000000 in=00f500ff [init]

bttv0: tuner type unset

bttv0: i2c: checking for MSP34xx @ 0x80... <6>parport_pc 00:0a: reported by Plug and Play ACPI

bttv0: i2c: checking for TDA9875 @ 0xb0... not found

bttv0: i2c: checking for TDA7432 @ 0x8a... not found

bttv0: registered device video0

bttv0: registered device vbi0

bt878: AUDIO driver version 0.0.0 loaded

bt878: Bt878 AUDIO function found (0).

bt878_probe: card id=[0x1ffff], Unknown card.

Exiting..

bt878: probe of 0000:02:0a.1 failed with error -22
```

I guess the "bt878_probe: card id=[0x1ffff], Unknown card." line is the clincher!  Udev only creates the one dvb device set on /dev, that's for the AverMEdia device.

Is there something I've missed?

Do I need a 2.6.23 version of the Linux headers (still marked testing currently)?

Has anyone had a similar problem with 2.6.23?

I'll post my kernel config if requested.

Thanks guys.

Cheers,

jcatLast edited by jcat on Tue Dec 18, 2007 5:02 am; edited 4 times in total

----------

## Birtz

You might want to take a look here https://bugs.gentoo.org/show_bug.cgi?id=201183 for your VMWare problems if you are using VMWare Workstation 6.

Regards

----------

## jcat

 *jcat wrote:*   

> 
> 
> I guess the "bt878_probe: card id=[0x1ffff], Unknown card." line is the clincher!  Udev only creates the one dvb device set on /dev, that's for the AverMEdia device.
> 
> 

 

Well that really was the clincher!

I couldn't work this one out, I recompiled my kernel with different configs several times to make sure it wasn't a module related issue, but it didn't help at all.

Then I tried parsing some module options the to kernel

```
alias char-major-81     bttv

options bttv           card=113 tuner=4
```

Although the bttv module now new what the card was, the bt8xx module was still not identifying the card.

Then , after more than a week or searching, I found this article:

http://www.linuxtv.org/wiki/index.php/Twinhan_VP-1020A

So it was possible I had a corrupted EEPROM.

I have a Twinhan VP3020C - DVB-T pci card, and the article relates to a Twinhan VP-1020A, but I spotted that the card id was the same from an old dmesg I posted on the forum a while ago!

I thought I had nothing to loose, so I gave it a try, reprogrammed the EEPORM and reboot.  All good!   :Very Happy: 

So it was nothing to do with a new kernel at all, just coincidence that the cards EEPROM got corrupted around the same time as the upgrade!

For those that wan to to know, you need the sys-apps/lm_sensors package that's in portage.  You use "i2cdetect" and "i2cdump"to find your card and probe it, and i2cset

 to program it with the correct values, 1822:0001, just like in the article.

Now I get:

```
bt878_probe: card id=[0x11822],[ Twinhan VisionPlus DVB ] has DVB functions.

bt878(0): Bt878 (rev 17) at 02:0a.1, irq: 19, latency: 32, memory: 0xd8001000
```

..and the all important:

```
DVB: registering new adapter (bttv0)

dst(0) dst_get_device_id: Recognise [DTTDIG]

DST type flags : 0x10 firmware version = 2

dst(0) dst_get_mac: MAC Address=[ff:ff:ff:ff:ff:00]

DVB: registering frontend 1 (DST DVB-T)...
```

And I have my other dvb frontend device back!

Given the nature of the fix, I will change the title. Hopefully this helps someone else  :Smile: 

Cheers,

jcat

----------

