Bug 5895

Summary: With DVB drivers enabled snd_87x (ALSA) don't detect Broooktree audio
Product: Drivers Reporter: Juan Pedro Paredes Caballero (juampe)
Component: Video(Other)Assignee: Manu Abraham (manu)
Status: CLOSED CODE_FIX    
Severity: blocking CC: mchehab, perex
Priority: P2    
Hardware: i386   
OS: Linux   
Kernel Version: 2.6.15 Subsystem:
Regression: --- Bisected commit-id:
Attachments: KWorld and Av711 with bttv driver only
Kworld and av711 bttv and dvb drivers
Kworld and av711 with dvb probe hacked (Working)
Pixelview and av711 with dvb probe hacked (Working)

Description Juan Pedro Paredes Caballero 2006-01-15 03:52:24 UTC
Most recent kernel where this bug did not occur:
Don't Know.

Distribution:
Debian unstable

Hardware Environment:
Ia have two video capture devices, a bttv (KW-TV878RF) and a bttv-DVB (AV711DVB)

lspci

0000:00:00.0 Host bridge: Intel Corporation 82845 845 (Brookdale) Chipset Host
Bridge (rev 03)
0000:00:01.0 PCI bridge: Intel Corporation 82845 845 (Brookdale) Chipset AGP
Bridge (rev 03)
0000:00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev 12)
0000:00:1f.0 ISA bridge: Intel Corporation 82801BA ISA Bridge (LPC) (rev 12)
0000:00:1f.1 IDE interface: Intel Corporation 82801BA IDE U100 (rev 12)
0000:00:1f.2 USB Controller: Intel Corporation 82801BA/BAM USB (Hub #1) (rev 12)
0000:00:1f.3 SMBus: Intel Corporation 82801BA/BAM SMBus (rev 12)
0000:00:1f.4 USB Controller: Intel Corporation 82801BA/BAM USB (Hub #2) (rev 12)
0000:00:1f.5 Multimedia audio controller: Intel Corporation 82801BA/BAM AC'97
Audio (rev 12)
0000:01:00.0 VGA compatible controller: nVidia Corporation NV34 [GeForce FX
5200] (rev a1)
0000:02:0b.0 Ethernet controller: Realtek Semiconductor Co., Ltd.
RTL-8139/8139C/8139C+ (rev 10)
0000:02:0c.0 Multimedia video controller: Brooktree Corporation Bt878 Video
Capture (rev 11)
0000:02:0c.1 Multimedia controller: Brooktree Corporation Bt878 Audio Capture
(rev 11)
0000:02:0d.0 Multimedia video controller: Brooktree Corporation Bt878 Video
Capture (rev 11)
0000:02:0d.1 Multimedia controller: Brooktree Corporation Bt878 Audio Capture
(rev 11)
0000:02:0e.0 Network controller: RaLink Ralink RT2500 802.11 Cardbus Reference
Card (rev 01)

lspci -n
0000:00:00.0 0600: 8086:1a30 (rev 03)
0000:00:01.0 0604: 8086:1a31 (rev 03)
0000:00:1e.0 0604: 8086:244e (rev 12)
0000:00:1f.0 0601: 8086:2440 (rev 12)
0000:00:1f.1 0101: 8086:244b (rev 12)
0000:00:1f.2 0c03: 8086:2442 (rev 12)
0000:00:1f.3 0c05: 8086:2443 (rev 12)
0000:00:1f.4 0c03: 8086:2444 (rev 12)
0000:00:1f.5 0401: 8086:2445 (rev 12)
0000:01:00.0 0300: 10de:0322 (rev a1)
0000:02:0b.0 0200: 10ec:8139 (rev 10)
0000:02:0c.0 0400: 109e:036e (rev 11)
0000:02:0c.1 0480: 109e:0878 (rev 11)
0000:02:0d.0 0400: 109e:036e (rev 11)
0000:02:0d.1 0480: 109e:0878 (rev 11)
0000:02:0e.0 0280: 1814:0201 (rev 01)

Software Environment:

Problem Description:
In kernel 2.6.15
Without dvb drivers and patch provided in bug
http://bugzilla.kernel.org/show_bug.cgi?id=5851
snd_btx are detected (full log in attach)

---------
Linux video capture interface: v1.00
bttv: driver version 0.9.16 loaded
bttv: using 8 buffers with 2080k (520 pages) each for capture
bttv: Bt8xx card found (0).
PCI: Enabling device 0000:02:0c.0 (0004 -> 0006)
ACPI: PCI Interrupt Link [LNKE] enabled at IRQ 11
PCI: setting IRQ 11 as level-triggered
ACPI: PCI Interrupt 0000:02:0c.0[A] -> Link [LNKE] -> GSI 11 (level, low) -> IRQ 11
bttv0: Bt878 (rev 17) at 0000:02:0c.0, irq: 11, latency: 32, mmio: 0xef000000
bttv0: using: Jetway TV/Capture JW-TV878-FBK, Kworld KW-TV878RF [card=78,insmod
option]
bttv0: gpio: en=00000000, out=00000000 in=003fffff [init]
bttv0: using tuner=5
bttv0: registered device video0
bttv0: registered device vbi0
bttv0: registered device radio0
bttv0: PLL: 28636363 => 35468950 .. ok
bttv: Bt8xx card found (1).
PCI: Enabling device 0000:02:0d.0 (0004 -> 0006)
ACPI: PCI Interrupt Link [LNKF] enabled at IRQ 11
ACPI: PCI Interrupt 0000:02:0d.0[A] -> Link [LNKF] -> GSI 11 (level, low) -> IRQ 11
bttv1: Bt878 (rev 17) at 0000:02:0d.0, irq: 11, latency: 32, mmio: 0xee000000
bttv1: detected: AVermedia AverTV DVB-T 771 [card=123], PCI subsystem ID is
1461:0771
bttv1: using: AVerMedia AVerTV DVB-T 771 [card=123,autodetected]
bttv1: gpio: en=00000000, out=00000000 in=00feff0f [init]
bttv1: using tuner=4
bttv1: registered device video1
bttv1: registered device vbi1
bttv1: PLL: 28636363 => 35468950 .. ok
bttv1: add subdevice "remote1"
bttv1: add subdevice "dvb1"
input: i2c IR (Hauppauge) as /class/input/input0
input: bttv IR (card=123) as /class/input/input1
tuner 0-0060: All bytes are equal. It is not a TEA5767
tuner 0-0060: chip found @ 0xc0 (bt878 #0 [sw])
tuner 0-0060: type set to 5 (Philips PAL_BG (FI1216 and compatibles))
...
...

Advanced Linux Sound Architecture Driver Version 1.0.10rc3 (Mon Nov 07 13:30:21
2005 UTC).
juampe debug card 0x109e:0x878-0x00:0x00
unknown card 0x00:0x00, using default rate 32000
please mail id, board name, and, if it works, the correct digital_rate option to
 <alsa-devel@lists.sf.net>
juampe  rate 32000
PCI: Enabling device 0000:02:0c.1 (0004 -> 0006)
ACPI: PCI Interrupt 0000:02:0c.1[A] -> Link [LNKE] -> GSI 11 (level, low) -> IRQ
 11
juampe Probe is OK<5>juampe debug card 0x109e:0x878-0x1461:0x771
ACPI: PCI Interrupt Link [LNKB] enabled at IRQ 10
PCI: setting IRQ 10 as level-triggered
ACPI: PCI Interrupt 0000:00:1f.5[B] -> Link [LNKB] -> GSI 10 (level, low) -> IRQ
 10
PCI: Setting latency timer of device 0000:00:1f.5 to 64
input: AT Translated Set 2 keyboard as /class/input/input2
intel8x0_measure_ac97_clock: measured 54560 usecs
intel8x0: clocking to 48000
ALSA device list:
  #0: Intel 82801BA-ICH2 with ALC200,200P at 0xb800, irq 10
  #1: Brooktree Bt878 at 0xee800000, irq 11
  #2: Virtual MIDI Card 1

---------
The 'juampe' prink are debuging info to probe methods in snd_bt87x

Now, when i enable DVB support to AV711


CONFIG_DVB=y
CONFIG_DVB_CORE=y
CONFIG_DVB_BT8XX=y
CONFIG_DVB_CX24110=y
CONFIG_DVB_VES1X93=y
CONFIG_DVB_SP887X=y
CONFIG_DVB_NXT6000=y
CONFIG_DVB_MT352=y
CONFIG_DVB_OR51211=y
CONFIG_DVB_OR51132=y
CONFIG_DVB_LGDT330X=y


-----
Linux video capture interface: v1.00
bttv: driver version 0.9.16 loaded
bttv: using 8 buffers with 2080k (520 pages) each for capture
bttv: Bt8xx card found (0).
PCI: Enabling device 0000:02:0c.0 (0004 -> 0006)
ACPI: PCI Interrupt Link [LNKE] enabled at IRQ 11
PCI: setting IRQ 11 as level-triggered
ACPI: PCI Interrupt 0000:02:0c.0[A] -> Link [LNKE] -> GSI 11 (level, low) -> IRQ 11
bttv0: Bt878 (rev 17) at 0000:02:0c.0, irq: 11, latency: 32, mmio: 0xef000000
bttv0: using: Jetway TV/Capture JW-TV878-FBK, Kworld KW-TV878RF [card=78,insmod
option]
bttv0: gpio: en=00000000, out=00000000 in=003fffff [init]
bttv0: using tuner=5
bttv0: registered device video0
bttv0: registered device vbi0
bttv0: registered device radio0
bttv0: PLL: 28636363 => 35468950 .. ok
bttv: Bt8xx card found (1).
PCI: Enabling device 0000:02:0d.0 (0004 -> 0006)
ACPI: PCI Interrupt Link [LNKF] enabled at IRQ 11
ACPI: PCI Interrupt 0000:02:0d.0[A] -> Link [LNKF] -> GSI 11 (level, low) -> IRQ 11
bttv1: Bt878 (rev 17) at 0000:02:0d.0, irq: 11, latency: 32, mmio: 0xee000000
bttv1: detected: AVermedia AverTV DVB-T 771 [card=123], PCI subsystem ID is
1461:0771
bttv1: using: AVerMedia AVerTV DVB-T 771 [card=123,insmod option]
bttv1: gpio: en=00000000, out=00000000 in=00feff0f [init]
bttv1: using tuner=4
bttv1: registered device video1
bttv1: registered device vbi1
bttv1: PLL: 28636363 => 35468950 .. ok
bttv1: add subdevice "remote1"
bttv1: add subdevice "dvb1"
input: i2c IR (Hauppauge) as /class/input/input0
input: bttv IR (card=123) as /class/input/input1
tuner 0-0060: All bytes are equal. It is not a TEA5767
tuner 0-0060: chip found @ 0xc0 (bt878 #0 [sw])
tuner 0-0060: type set to 5 (Philips PAL_BG (FI1216 and compatibles))
bt878: AUDIO driver version 0.0.0 loaded
bt878: Bt878 AUDIO function found (0).
PCI: Enabling device 0000:02:0c.1 (0004 -> 0006)
ACPI: PCI Interrupt 0000:02:0c.1[A] -> Link [LNKE] -> GSI 11 (level, low) -> IRQ 11
bt878(0): Bt878 (rev 17) at 02:0c.1, irq: 11, latency: 32, memory: 0xee800000
bt878: Bt878 AUDIO function found (1).
PCI: Enabling device 0000:02:0d.1 (0004 -> 0006)
ACPI: PCI Interrupt 0000:02:0d.1[A] -> Link [LNKF] -> GSI 11 (level, low) -> IRQ 11
bt878(1): Bt878 (rev 17) at 02:0d.1, irq: 11, latency: 32, memory: 0xed800000
DVB: registering new adapter (bttv1).
DVB: registering frontend 0 (Zarlink MT352 DVB-T)...
...
...
Advanced Linux Sound Architecture Driver Version 1.0.10rc3 (Mon Nov 07 13:30:21
2005 UTC).
ACPI: PCI Interrupt Link [LNKB] enabled at IRQ 10
PCI: setting IRQ 10 as level-triggered
ACPI: PCI Interrupt 0000:00:1f.5[B] -> Link [LNKB] -> GSI 10 (level, low) -> IRQ 10
PCI: Setting latency timer of device 0000:00:1f.5 to 64
input: AT Translated Set 2 keyboard as /class/input/input2
intel8x0_measure_ac97_clock: measured 54279 usecs
intel8x0: clocking to 48000
ALSA device list:
  #0: Intel 82801BA-ICH2 with ALC200,200P at 0xb800, irq 10
  #2: Virtual MIDI Card 1

-----

Notice that 'juampe' debug printk in snd_bt87x probe not appears
and DVB diver get the resource ...
bt878(0): Bt878 (rev 17) at 02:0c.1, irq: 11, latency: 32, memory: 0xee800000
bt878: Bt878 AUDIO function found (1).
Comment 1 Juan Pedro Paredes Caballero 2006-01-16 08:33:25 UTC
in drivers/media/dvb/bt8xx/bt878.c  
the probe method  
bt878_probe(struct pci_dev *dev,const struct pci_device_id *pci_id)  
  
This method does not take care about subvendor and subdevice to enable pci.  
  
Why not have a enabled or disabled param?  
 
I will try to force dvb-bt878 probe error to KWorld device 
  
  
  
  
Comment 2 Juan Pedro Paredes Caballero 2006-01-16 08:41:10 UTC
Created attachment 7038 [details]
KWorld and Av711 with bttv driver only
Comment 3 Juan Pedro Paredes Caballero 2006-01-16 08:42:39 UTC
Created attachment 7039 [details]
Kworld and av711 bttv and dvb drivers
Comment 4 Juan Pedro Paredes Caballero 2006-01-16 08:47:26 UTC
Created attachment 7040 [details]
Kworld and av711 with dvb probe hacked (Working)
Comment 5 Juan Pedro Paredes Caballero 2006-01-16 08:55:38 UTC
A dirty fix to my problem 
 
------------------------- 
--- drivers/media/dvb/bt8xx/bt878.c.ori 2006-01-16 17:32:25.000000000 +0100 
+++ drivers/media/dvb/bt8xx/bt878.c     2006-01-16 17:46:02.000000000 +0100 
@@ -399,6 +399,12 @@ 
               bt878_num); 
        if (pci_enable_device(dev)) 
                return -EIO; 
+        printk(KERN_NOTICE "juampe debug dbv card, yes found , but may be 
used? %#04x:%#04x-%#04x:%#04x\n",dev->vendor, 
dev->device,dev->subsystem_vendor, dev->subsystem_device); 
+        if(dev->vendor==0x109e  && dev->device==0x0878 && 
dev->subsystem_vendor==0x00 &&  dev->subsystem_device==0x00){ 
+               result = -EINVAL; 
+                goto fail0; 
+       } 
+ 
 
        bt = &bt878[bt878_num]; 
        bt->dev = dev; 
@@ -483,6 +489,7 @@ 
        release_mem_region(pci_resource_start(bt->dev, 0), 
                           pci_resource_len(bt->dev, 0)); 
       fail0: 
+       printk(KERN_NOTICE "juampe not i will not used :)"); 
        pci_disable_device(dev); 
        return result; 
 } 
-------------------- 
 
input: i2c IR (Hauppauge) as /class/input/input0 
input: bttv IR (card=123) as /class/input/input1 
tuner 0-0060: All bytes are equal. It is not a TEA5767 
tuner 0-0060: chip found @ 0xc0 (bt878 #0 [sw]) 
tuner 0-0060: type set to 5 (Philips PAL_BG (FI1216 and compatibles)) 
bt878: AUDIO driver version 0.0.0 loaded 
bt878: Bt878 AUDIO function found (0). 
PCI: Enabling device 0000:02:0c.1 (0004 -> 0006) 
ACPI: PCI Interrupt 0000:02:0c.1[A] -> Link [LNKE] -> GSI 11 (level, low) -> 
IRQ 
 11 
juampe debug dbv card, yes found , but may be used? 0x109e:0x878-0x00:0x00 
juampe not i will not used :)<6>ACPI: PCI interrupt for device 0000:02:0c.1 
disabled 
bt878: probe of 0000:02:0c.1 failed with error -22 
bt878: Bt878 AUDIO function found (0). 
PCI: Enabling device 0000:02:0d.1 (0004 -> 0006) 
ACPI: PCI Interrupt 0000:02:0d.1[A] -> Link [LNKF] -> GSI 11 (level, low) -> 
IRQ 
 11 
juampe debug dbv card, yes found , but may be used? 0x109e:0x878-0x1461:0x771 
bt878(0): Bt878 (rev 17) at 02:0d.1, irq: 11, latency: 32, memory: 0xed800000 
DVB: registering new adapter (bttv1). 
DVB: registering frontend 0 (Zarlink MT352 DVB-T)... 
... 
... 
Advanced Linux Sound Architecture Driver Version 1.0.10rc3 (Mon Nov 07 13:30:21 
2005 UTC). 
juampe debug card 0x109e:0x878-0x00:0x00 
unknown card 0x00:0x00, using default rate 32000 
please mail id, board name, and, if it works, the correct digital_rate option 
to 
 <alsa-devel@lists.sf.net> 
juampe  rate 32000 
ACPI: PCI Interrupt 0000:02:0c.1[A] -> Link [LNKE] -> GSI 11 (level, low) -> 
IRQ 
 11 
juampe Probe is OKACPI: PCI Interrupt Link [LNKB] enabled at IRQ 10 
PCI: setting IRQ 10 as level-triggered 
ACPI: PCI Interrupt 0000:00:1f.5[B] -> Link [LNKB] -> GSI 10 (level, low) -> 
IRQ 
 10 
PCI: Setting latency timer of device 0000:00:1f.5 to 64 
input: AT Translated Set 2 keyboard as /class/input/input2 
intel8x0_measure_ac97_clock: measured 54333 usecs 
intel8x0: clocking to 48000 
ALSA device list: 
  #0: Intel 82801BA-ICH2 with ALC200,200P at 0xa800, irq 10 
  #1: Brooktree Bt878 at 0xee800000, irq 11 
  #2: Virtual MIDI Card 1 
 
 
----------- 
 
Any better ideas? 
Comment 6 Juan Pedro Paredes Caballero 2006-01-17 00:08:44 UTC
Due to a audiomux misconfig of Kworld TV card (next bttv-cards.c  in my todo  
bug list :P), I can't get sound fom this card (but snd_bt87x now is detected  
and I can use it, no sound, but is detected and works)  
  
I change this card by a Pixelview TV card bttv.card=78 to bttv.card=70. 
 
Now I get sound from snd_bt87x 
  
See attach.  
  
With 'Really, really dirty fix'  the DVB card works well and the TV card works  
well, now my mythtv is complete :)  
----------  
--- drivers/media/dvb/bt8xx/bt878.c.ori 2006-01-16 17:32:25.000000000 +0100  
+++ drivers/media/dvb/bt8xx/bt878.c     2006-01-17 08:28:05.000000000 +0100  
@@ -399,6 +399,18 @@  
               bt878_num);  
        if (pci_enable_device(dev))  
                return -EIO;  
+        if(dev->vendor==0x109e  && dev->device==0x0878 &&  
dev->subsystem_vendor==0x00 &&  dev->subsystem_device==0x00){  
+               printk(KERN_NOTICE "juampe this is bttv card not DVB %#04x: 
%#04x-%#04x:%#04x\n",dev->vendor, dev->device,dev->subsystem_vendor,  
dev->subsystem_device);  
+               result = -EINVAL;  
+                goto fail0;  
+       }  
+       if(dev->vendor==0x109e  && dev->device==0x0878 &&  
dev->subsystem_vendor==0xffff &&  dev->subsystem_device==0xffff){  
+               printk(KERN_NOTICE "juampe this is bttv card not DVB  %#04x: 
%#04x-%#04x:%#04x\n",dev->vendor, dev->device,dev->subsystem_vendor,  
dev->subsystem_device);  
+  
+               result = -EINVAL;  
+                goto fail0;  
+       }  
+  
  
        bt = &bt878[bt878_num];  
        bt->dev = dev;  
@@ -483,6 +495,7 @@  
        release_mem_region(pci_resource_start(bt->dev, 0),  
                           pci_resource_len(bt->dev, 0));  
       fail0:  
+       printk(KERN_NOTICE "juampe not it will not used :)\n");  
        pci_disable_device(dev);  
        return result;  
 }  
-----------  
  
  
Comment 7 Juan Pedro Paredes Caballero 2006-01-17 00:10:24 UTC
Created attachment 7044 [details]
Pixelview and av711 with dvb probe hacked (Working)