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

race condition audio cards + pcspkr



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


Reply to: