[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: race condition audio cards + pcspkr



On Wednesday 17 December 2008 21:18, Hugo Vanwoerkom wrote:
> Hi,
>
> How does one put a wait in the initialization of the pcspkr module?
>
> I have 2 audio cards:
> one the builtin card of the mobo
> two a CA0106 PCI card.
>
> They are supposed to be like this:
>
> hugo@debian:/etc/udev$ cd /etc/modprobe.d/
> hugo@debian:/etc/modprobe.d$ more sound
> alias snd-card-0 snd-via82xx
> options snd-via82xx index=0
> alias snd-card-1 snd_ca0106
> options snd_ca0106 index=1
>
> That way I can play sound either through one card or the other depending
> how on what monitor I am at like this:
>
> case "$DISPLAY" in
>
> :0.*)   export ALSA_CARD=1
>
>          export ALSA_CTL_CARD=1
>          export ALSA_PCM_CARD=1
>          export MUS_ALSA_DEVICE="hw:1,0"
>          ;;
>
> :1.*)   export ALSA_CARD=0
>
>          export ALSA_CTL_CARD=0
>          export ALSA_PCM_CARD=0
>          export MUS_ALSA_DEVICE="hw:0,0"
>          ;;
> * )
>         # Default option.
>          export ALSA_CARD=0
>          export ALSA_CTL_CARD=0
>          export ALSA_PCM_CARD=0
>          export MUS_ALSA_DEVICE="hw:0,0"
>          ;;
> esac
>
> But on the latest Sid linux-image-2.6.26-1-686 I get a race condition
> between the CA0106 and pcspkr: when pcspkr wins the CA0106 fails to
> initialize:
>
>
> Dec 17 13:48:22 debian kernel: [   21.430714] VIA 82xx Audio
> 0000:00:11.5: VIA VLink IRQ fixup, from 5 to 11
> Dec 17 13:48:22 debian kernel: [   21.438860] PCI: Setting latency timer
> of device 0000:00:11.5 to 64
> Dec 17 13:48:22 debian kernel: [   21.844739] input: PC Speaker as
> /class/input/input6
> Dec 17 13:48:22 debian kernel: [   21.994233] Error: Driver 'pcspkr' is
> already registered, aborting...
> Dec 17 13:48:22 debian kernel: [   22.039829] cannot find the slot for
> index 1 (range 0-1), error: -16
> Dec 17 13:48:22 debian kernel: [   22.047800] CA0106: probe of
> 0000:00:0a.0 failed with error -12
> Dec 17 13:48:22 debian kernel: [   22.103001] Error: Driver 'pcspkr' is
> already registered, aborting..
>
> and the pcspkr becomes the second card:
>
> hugo@debian:/$ aplay -l
> **** List of PLAYBACK Hardware Devices ****
> card 0: V8237 [VIA 8237], device 0: VIA 8237 [VIA 8237]
>    Subdevices: 4/4
>    Subdevice #0: subdevice #0
>    Subdevice #1: subdevice #1
>    Subdevice #2: subdevice #2
>    Subdevice #3: subdevice #3
> card 0: V8237 [VIA 8237], device 1: VIA 8237 [VIA 8237]
>    Subdevices: 1/1
>    Subdevice #0: subdevice #0
> card 1: pcsp [pcsp], device 0: pcspeaker [pcsp]
>    Subdevices: 1/1
>    Subdevice #0: subdevice #0
>
> Is there a way to make the pcspkr wait until after the CA0106 is
> initialized?
>
> This never happens with my own compiled kernel, just with the Debian
> kernel and it does not always happen, just most of the time.
>
> Anybody have an idea?
>
> Hugo

Hi Hugo.

Interesting what you say about the pcspkr (pcsp) module. I'm have problems 
getting sound from the 2.6.24-etchnhalf kernel using the 1.0.15 alsa driver. 
I had problems with no sound from Etch's 2.6.18-6 kernel, with no sounds, but 
upgrading the 1.0.12rc1 alsa driver to 1.0.15 got the sounds working.

I wonder if I have the same sort of problem as you, because I'm almost sure I 
saw something in dmesg saying that the pcspkr module was already loaded 
"skipping". This is with the 2.6.24-etchnhalf kernel.
<this line in particular from above>
Dec 17 13:48:22 debian kernel: [   21.994233] Error: Driver 'pcspkr' is
 already registered, aborting...

If you want rid of the pcspkr module, how about the following line 
in /etc/modules.d/alsa-base.

install pcspkr /bin/true

That will send it to never never land

Not sure how the module is named, so you may have to look in lsmod for that. 
It could be, pcspkr, or pcsp. change the line above to suit.

I'll try the same myself, when updates on another distro have finished. It may 
fix my problem too.

Nigel.


Reply to: