Bug 5851 - bttv ALSA btaudio don't detected
Summary: bttv ALSA btaudio don't detected
Status: CLOSED CODE_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: Sound(ALSA) (show other bugs)
Hardware: i386 Linux
: P2 blocking
Assignee: Jaroslav Kysela
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-07 14:23 UTC by Juan Pedro Paredes Caballero
Modified: 2006-01-12 05:02 UTC (History)
1 user (show)

See Also:
Kernel Version: 2.6.15
Subsystem:
Regression: ---
Bisected commit-id:


Attachments
2.6.11 dmesg and config (device is working) (54.08 KB, text/plain)
2006-01-07 14:24 UTC, Juan Pedro Paredes Caballero
Details
2.6.15 dmesg and config (device not works) (59.97 KB, text/plain)
2006-01-07 14:25 UTC, Juan Pedro Paredes Caballero
Details
2.6.12.5 dmesg and config (device is working) (51.24 KB, text/plain)
2006-01-10 03:45 UTC, Juan Pedro Paredes Caballero
Details
2.6.13 demsg an config (device not works) (58.48 KB, text/plain)
2006-01-10 03:46 UTC, Juan Pedro Paredes Caballero
Details
Patch to test (519 bytes, patch)
2006-01-11 23:43 UTC, Jaroslav Kysela
Details | Diff

Description Juan Pedro Paredes Caballero 2006-01-07 14:23:21 UTC
Most recent kernel where this bug did not occur:          
2.6.11 see attach bttv an ALSA  boot sections       
with bttv: driver version 0.9.15 works well     
ALSA device list:  
  #0: Intel ICH with AD1981B at 0xdfebfe00, irq 23  
  #1: Brooktree Bt878 at 0xd0000000, irq 16  
  #2: Virtual MIDI Card 1  
      
Distribution:          
Debian unstable        
         
Hardware Environment:          
       
lspci       
0000:00:00.0 Host bridge: Intel Corporation 915G/P/GV/GL/PL/910GL Processor to        
I/O Controller (rev 04)        
0000:00:01.0 PCI bridge: Intel Corporation 915G/P/GV/GL/PL/910GL PCI Express        
Root Port (rev 04)        
0000:00:02.0 VGA compatible controller: Intel Corporation 82915G/GV/910GL        
Express Chipset Family Graphics Controller (rev 04)        
0000:00:02.1 Display controller: Intel Corporation 82915G Express Chipset        
Family Graphics Controller (rev 04)        
0000:00:1c.0 PCI bridge: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family)        
PCI Express Port 1 (rev 03)        
0000:00:1c.1 PCI bridge: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family)        
PCI Express Port 2 (rev 03)        
0000:00:1d.0 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6        
Family) USB UHCI #1 (rev 03)        
0000:00:1d.1 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6        
Family) USB UHCI #2 (rev 03)        
0000:00:1d.2 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6        
Family) USB UHCI #3 (rev 03)        
0000:00:1d.3 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6        
Family) USB UHCI #4 (rev 03)        
0000:00:1d.7 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6        
Family) USB2 EHCI Controller (rev 03)        
0000:00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev d3)        
0000:00:1e.2 Multimedia audio controller: Intel Corporation        
82801FB/FBM/FR/FW/FRW (ICH6 Family) AC'97 Audio Controller (rev 03)        
0000:00:1f.0 ISA bridge: Intel Corporation 82801FB/FR (ICH6/ICH6R) LPC        
Interface Bridge (rev 03)        
0000:00:1f.1 IDE interface: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6        
Family) IDE Controller (rev 03)        
0000:00:1f.2 IDE interface: Intel Corporation 82801FB/FW (ICH6/ICH6W) SATA        
Controller (rev 03)        
0000:00:1f.3 SMBus: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) SMBus        
Controller (rev 03)        
0000:02:00.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5751        
Gigabit Ethernet PCI Express (rev 01)        
0000:04:00.0 Multimedia video controller: Brooktree Corporation Bt878 Video        
Capture (rev 02)        
0000:04:00.1 Multimedia controller: Brooktree Corporation Bt878 Audio Capture        
(rev 02)        
       
lspci -n       
0000:00:00.0 0600: 8086:2580 (rev 04)       
0000:00:01.0 0604: 8086:2581 (rev 04)       
0000:00:02.0 0300: 8086:2582 (rev 04)       
0000:00:02.1 0380: 8086:2782 (rev 04)       
0000:00:1c.0 0604: 8086:2660 (rev 03)       
0000:00:1c.1 0604: 8086:2662 (rev 03)       
0000:00:1d.0 0c03: 8086:2658 (rev 03)       
0000:00:1d.1 0c03: 8086:2659 (rev 03)       
0000:00:1d.2 0c03: 8086:265a (rev 03)       
0000:00:1d.3 0c03: 8086:265b (rev 03)       
0000:00:1d.7 0c03: 8086:265c (rev 03)       
0000:00:1e.0 0604: 8086:244e (rev d3)       
0000:00:1e.2 0401: 8086:266e (rev 03)       
0000:00:1f.0 0601: 8086:2640 (rev 03)       
0000:00:1f.1 0101: 8086:266f (rev 03)       
0000:00:1f.2 0101: 8086:2651 (rev 03)       
0000:00:1f.3 0c05: 8086:266a (rev 03)       
0000:02:00.0 0200: 14e4:1677 (rev 01)       
0000:04:00.0 0400: 109e:036e (rev 02)       
0000:04:00.1 0480: 109e:0878 (rev 02)       
         
Software Environment:          
2.6.15 Debian unstable       
Problem Description:       
The btaudio device is not dectected by kernels (AFAIK) higher than 2.6.11          
with bttv: driver version 0.9.16      
ALSA device list:    
  #0: Intel ICH6 with AD1981B at 0xdfebfe00, irq 22    
  #2: Virtual MIDI Card 1    
    
          
Steps to reproduce:          
Just use kernels higher than 2.6.11
Comment 1 Juan Pedro Paredes Caballero 2006-01-07 14:24:45 UTC
Created attachment 6964 [details]
2.6.11 dmesg and config (device is working)
Comment 2 Juan Pedro Paredes Caballero 2006-01-07 14:25:58 UTC
Created attachment 6965 [details]
2.6.15 dmesg and config (device not works)
Comment 3 Juan Pedro Paredes Caballero 2006-01-10 03:45:03 UTC
Created attachment 6980 [details]
2.6.12.5 dmesg and config (device is working)
Comment 4 Juan Pedro Paredes Caballero 2006-01-10 03:46:23 UTC
Created attachment 6981 [details]
2.6.13 demsg an config (device not works)
Comment 5 Juan Pedro Paredes Caballero 2006-01-10 03:51:49 UTC
Te bug seems to be related to the new version of bttv (0.9.15 to 0.9.16) 
The change occur AFAIK from 2.6.12.5 to 2.6.13 
 
First impression: 
Or the new version of bttv dont detect btaudio properly  
Or ALSA don't use well "a posible" API change of btaudio 
Comment 6 Mauro Carvalho Chehab 2006-01-11 03:16:01 UTC
btaudio is OSS. What happens with the alsa module (snd-87x)?
Comment 7 Juan Pedro Paredes Caballero 2006-01-11 05:55:22 UTC
Sorry for misunderstood, I don't know if there are btaudio in OSS.
I don't use OSS, The dmesg and config don't show OSS
I use snd-87x (ALSA) but compiled in kernel I pass the following parameters
to boot (like I showed in attach):
root=/dev/sda2 ro bttv.tuner=5 bttv.card=70 bttv.radio=1 bttv.bttv_gpio=1
msp3400.once=1 snd_bt87x.enable=1 snd_intel8x0.index=0 snd_bt87x.index=1
snd_virmidi.index=2 snd_bt87x.load_all=1 snd_bt87x.digital_rate=48000 

I assign the index number 1 to snd_bt87x and snd_bt87x.load_all=1 to try all
models (i wonder if not was docummented last one)...

Now I have and idea in 2.6.12.5, I will try snd_bt87x.load_all=0 
Wait a minute ...

-----
bttv: driver version 0.9.15 loaded
bttv: using 8 buffers with 2080k (520 pages) each for capture
bttv: Bt8xx card found (0).
bttv0: Bt878 (rev 2) at 0000:04:00.0, irq: 16, latency: 64, mmio: 0xd0001000
bttv0: using: Prolink Pixelview PV-BT878P+ (Rev.4C,8E) [card=70,insmod option]
bttv0: gpio: en=00000000, out=00000000 in=00ffffff [pre-init]
bttv0: gpio: en=00000000, out=00000000 in=00ffffff [init]
bttv0: using tuner=5
bttv0: registered device video0
bttv0: registered device vbi0
bttv0: registered device radio0
bttv0: gpio: en=0000000f, out=0000000d in=00fffff0 [audio: off]
bttv0: gpio: en=0000000f, out=0000000d in=00fffff0 [audio: off]
bttv0: PLL: 28636363 => 35468950 .. ok
bttv0: add subdevice "remote0"
tvaudio: TV audio decoder + audio/video mux driver
tvaudio: known chips: tda9840,tda9873h,tda9874h/a,tda9850,tda9855,tea6300,tea632
0,tea6420,tda8425,pic16c54 (PV951),ta8874z
bttv0: gpio: en=0000000f, out=0000000d in=00fffff0 [audio: off]
ir-kbd-gpio: bttv IR (card=70) detected at pci-0000:04:00.0/ir0
tuner 0-0061: chip found @ 0xc2 (bt878 #0 [sw])
tuner 0-0061: type set to 5 (Philips PAL_BG (FI1216 and compatibles))

....
....

intel8x0_measure_ac97_clock: measured 49229 usecs
intel8x0: clocking to 48000
ALSA device list:
  #0: Intel ICH6 with AD1981B at 0xdfebfe00, irq 23


------

As I supossed snd_bt87x is not detected like 2.6.13 and higher.

summup:
if snd_bt87x.load_all=1 my snd_bt87x is detected.
if snd_bt87x.load_all=0 is not detected like 2.6.13 and higher.

maybe my chipset is blacklisted?

Regards
Comment 8 Juan Pedro Paredes Caballero 2006-01-11 06:24:07 UTC
seeing changelog in 2.6.13

-------------
commit 4dcef52400fa6b9eb2de589300ae0151a1c65b3b
Author: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Date:   Thu Aug 4 12:53:30 2005 -0700

    [PATCH] v4l: oopsfix for BTTV on badly behaved PCI chipsets

    no_overlay bttv parameter implemented to fix OOPS on some PCI chipsets
    (like some VIA) with these behaviors:

    1) If pci_quicks does identify the chip as having troubles to
       handle PCI2PCI transfers, no_overlay defaults to 1. The user may force
       it to 0, to reenable (not recommended).

    2) For newer chipsets not blacklisted, no_overlay=1 is provided as a
       workaround until PCI chipset included on /drivers/pci/quirks.c
---------------

and seeing patch 2.6.13


-----------
snd_bt87x

-       supported = pci_match_device(snd_bt87x_ids, pci);
+       supported = pci_match_device(&driver, pci);

-----------


Comment 9 Juan Pedro Paredes Caballero 2006-01-11 12:11:40 UTC
in 2.6.15 sound/pci/bt87x.c 
at static int __devinit snd_bt87x_detect_card(struct pci_dev *pci)
---------
        /* Add to debug */
        printk(KERN_NOTICE "juampe debug card %#04x:%#04x-%#04x:%#04x
\n",pci->vendor, pci->device,pci->subsystem_vendor, pci->subsystem_device);
        if (supported)
                return supported->driver_data;
        printk(KERN_NOTICE "juampe not supported\n");

-----------
Advanced Linux Sound Architecture Driver Version 1.0.10rc3 (Mon Nov 07 13:30:21
2005 UTC).
juampe debug card 0x109e:0x878-0xffff:0xffff
ACPI: PCI Interrupt 0000:00:1e.2[A] -> GSI 23 (level, low) -> IRQ 22
PCI: Setting latency timer of device 0000:00:1e.2 to 64
intel8x0_measure_ac97_clock: measured 58344 usecs
intel8x0: clocking to 48000
ALSA device list:
  #0: Intel ICH6 with AD1981B at 0xdfebfe00, irq 22
  #2: Virtual MIDI Card 1
--------

The card is supported in 2.6.15 but not showed by ALSA device list
I continue following the trhead ...

Regards.
Comment 10 Juan Pedro Paredes Caballero 2006-01-11 12:44:21 UTC

Now i try with probe method....
--------------
static int __devinit snd_bt87x_probe(struct pci_dev *pci,
                                     const struct pci_device_id *pci_id)
.....
.....
        rate = pci_id->driver_data;
        if (! rate)
                if ((rate = snd_bt87x_detect_card(pci)) <= 0){
                        printk(KERN_NOTICE "juampe tring to get rate %d\n",rate);
                        return -ENODEV;
                }
----------------



And i got
--------

Advanced Linux Sound Architecture Driver Version 1.0.10rc3 (Mon Nov 07 13:30:21
2005 UTC).
juampe tring to get rate 0
ACPI: PCI Interrupt 0000:00:1e.2[A] -> GSI 23 (level, low) -> IRQ 22
PCI: Setting latency timer of device 0000:00:1e.2 to 64
intel8x0_measure_ac97_clock: measured 58331 usecs
intel8x0: clocking to 48000
ALSA device list:
  #0: Intel ICH6 with AD1981B at 0xdfebfe00, irq 22
  #2: Virtual MIDI Card 1

---------

rate is 0?
goto again to snd_bt87x_detect_card

supported = pci_match_device(&driver, pci);
        if (supported)
                return supported->driver_data;

and the struct
static struct pci_driver driver;

now i will follow this struct...

Regards
Comment 11 Juan Pedro Paredes Caballero 2006-01-11 23:35:59 UTC
OK, after several probes I get the device working like is expected.  
The problem is at ALSA code in bt87x.c  
I have to force default rate to 48000 couse the detection does not works  
snd_bt87x_detect_card(pci) returns always 0  
 
  
My work is the following-----  
--- linux-2.6.15/sound/pci/bt87x.c      2006-01-03 04:21:10.000000000 +0100  
+++ linux-2.6.15/sound/pci/bt87x.c.new  2006-01-12 08:32:20.000000000 +0100  
@@ -831,7 +831,7 @@  
        if (! rate)  
                if ((rate = snd_bt87x_detect_card(pci)) <= 0)  
                        return -ENODEV;  
-  
+       printk(KERN_NOTICE "juampe rate after force to %d",rate);  
        if (dev >= SNDRV_CARDS)  
                return -ENODEV;  
        if (!enable[dev]) {  
@@ -881,6 +881,7 @@  
  
        pci_set_drvdata(pci, card);  
        ++dev;  
+       printk(KERN_NOTICE "juampe Probe is OK");  
        return 0;  
  
 _error:  
@@ -897,8 +898,8 @@  
 /* default entries for all Bt87x cards - it's not exported */  
 /* driver_data is set to 0 to call detection */  
 static struct pci_device_id snd_bt87x_default_ids[] = {  
-       BT_DEVICE(PCI_DEVICE_ID_BROOKTREE_878, PCI_ANY_ID, PCI_ANY_ID, 0),  
-       BT_DEVICE(PCI_DEVICE_ID_BROOKTREE_879, PCI_ANY_ID, PCI_ANY_ID, 0),  
+       BT_DEVICE(PCI_DEVICE_ID_BROOKTREE_878, PCI_ANY_ID, PCI_ANY_ID, 48000),  
+       BT_DEVICE(PCI_DEVICE_ID_BROOKTREE_879, PCI_ANY_ID, PCI_ANY_ID, 48000),  
        { }  
 };  
  
-----  
result  
  
  
-----  
Advanced Linux Sound Architecture Driver Version 1.0.10rc3 (Mon Nov 07 13:30:21  
2005 UTC).  
juampe rate after force to 48000<6>ACPI: PCI Interrupt 0000:04:00.1[A] -> GSI  
16  
 (level, low) -> IRQ 16  
juampe Probe is OK<6>ACPI: PCI Interrupt 0000:00:1e.2[A] -> GSI 23 (level, low)  
-> IRQ 22  
PCI: Setting latency timer of device 0000:00:1e.2 to 64  
intel8x0_measure_ac97_clock: measured 58333 usecs  
intel8x0: clocking to 48000  
ALSA device list:  
  #0: Intel ICH6 with AD1981B at 0xdfebfe00, irq 22  
  #1: Brooktree Bt878 at 0xd0000000, irq 16  
  #2: Virtual MIDI Card 1  
  
  
;) the device is now working,  
but the probe code remain failing and return 0.  
  
Regards.  
Comment 12 Jaroslav Kysela 2006-01-11 23:43:14 UTC
Created attachment 6994 [details]
Patch to test

Could you test this patch? It should fix your problem.
Comment 13 Juan Pedro Paredes Caballero 2006-01-12 00:35:00 UTC
OK, your patch is more ellegant an efficient :P 
It works great, good fix! 
 
---- 
Advanced Linux Sound Architecture Driver Version 1.0.10rc3 (Mon Nov 07 13:30:21 
2005 UTC). 
unknown card 0xffff:0xffff, using default rate 32000 
please mail id, board name, and, if it works, the correct digital_rate option 
to <alsa-devel@lists.sf.net> 
ACPI: PCI Interrupt 0000:04:00.1[A] -> GSI 16 (level, low) -> IRQ 16 
ACPI: PCI Interrupt 0000:00:1e.2[A] -> GSI 23 (level, low) -> IRQ 22 
PCI: Setting latency timer of device 0000:00:1e.2 to 64 
intel8x0_measure_ac97_clock: measured 58342 usecs 
intel8x0: clocking to 48000 
ALSA device list: 
  #0: Intel ICH6 with AD1981B at 0xdfebfe00, irq 22 
  #1: Brooktree Bt878 at 0xd0000000, irq 16 
  #2: Virtual MIDI Card 1 
---- 
 
Regards 
Comment 14 Jaroslav Kysela 2006-01-12 05:02:25 UTC
Ok, I'm closing this bug. The patch is in ALSA CVS thus it will be exported to
mainstream (2.6.16).

Note You need to log in before you can comment on or make changes to this bug.