You are not logged in.

#1 2010-09-02 22:19:17

k2000
Member
Registered: 2009-12-02
Posts: 33

[Solved] Two soundcards loading in random order

Hi,

I have two soundcards that I want to use for different purpose. I recently post this tread to resove my issue:
https://bbs.archlinux.org/viewtopic.php?id=102677

To resume, the onboard soundcard is connected to my pc speakers and is used to play every sounds like videos, etc. The second soundcard is connected to the speakers in my living room and is only used by mpd to play back music. So I can watch videos on my pc while my girlfriend listen to music in the living room and she does not hear the sound of the video. In mpd, I can select one or another output, or the 2 at the same time.

The solution works fine most of the time, but sometimes after reboots the two soundcards loads in a different order. So the videos play in the living room and mpd plays in my pc speakers.

I tried setting the orders of the sound cards in /etc/modprobe.d/modprobe.conf like this

option snd_ac97_codec index = 0 
option snd_ca0106 index = 1

where snd_ac97_codec is my onboard soundcard and snd_ca0106 is the other one, but it does not seems to be taken in consideration.

I think it's udev that should be tell to load one before the other, but it is over my competences.

In case it helps, aplay -l returns this:

**** List of PLAYBACK Hardware Devices ****
card 0: SI7012 [SiS SI7012], device 0: Intel ICH [SiS SI7012]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: CA0106 [CA0106], device 0: ca0106 [CA0106]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: CA0106 [CA0106], device 1: ca0106 [CA0106]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: CA0106 [CA0106], device 2: ca0106 [CA0106]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: CA0106 [CA0106], device 3: ca0106 [CA0106]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

And /sys/module/snd/holders looks like this:

drwxr-xr-x 2 root root 0  2 sep 17:53 .
drwxr-xr-x 6 root root 0  2 sep 17:43 ..
lrwxrwxrwx 1 root root 0  2 sep 17:53 snd_ac97_codec -> ../../snd_ac97_codec
lrwxrwxrwx 1 root root 0  2 sep 17:53 snd_ca0106 -> ../../snd_ca0106
lrwxrwxrwx 1 root root 0  2 sep 17:53 snd_cs4236 -> ../../snd_cs4236
lrwxrwxrwx 1 root root 0  2 sep 17:53 snd_hwdep -> ../../snd_hwdep
lrwxrwxrwx 1 root root 0  2 sep 17:53 snd_intel8x0 -> ../../snd_intel8x0
lrwxrwxrwx 1 root root 0  2 sep 17:53 snd_mixer_oss -> ../../snd_mixer_oss
lrwxrwxrwx 1 root root 0  2 sep 17:53 snd_mpu401 -> ../../snd_mpu401
lrwxrwxrwx 1 root root 0  2 sep 17:53 snd_mpu401_uart -> ../../snd_mpu401_uart
lrwxrwxrwx 1 root root 0  2 sep 17:53 snd_opl3_lib -> ../../snd_opl3_lib
lrwxrwxrwx 1 root root 0  2 sep 17:53 snd_pcm -> ../../snd_pcm
lrwxrwxrwx 1 root root 0  2 sep 17:53 snd_pcm_oss -> ../../snd_pcm_oss
lrwxrwxrwx 1 root root 0  2 sep 17:53 snd_rawmidi -> ../../snd_rawmidi
lrwxrwxrwx 1 root root 0  2 sep 17:53 snd_seq -> ../../snd_seq
lrwxrwxrwx 1 root root 0  2 sep 17:53 snd_seq_device -> ../../snd_seq_device
lrwxrwxrwx 1 root root 0  2 sep 17:53 snd_seq_oss -> ../../snd_seq_oss
lrwxrwxrwx 1 root root 0  2 sep 17:53 snd_timer -> ../../snd_timer
lrwxrwxrwx 1 root root 0  2 sep 17:53 snd_wavefront -> ../../snd_wavefront
lrwxrwxrwx 1 root root 0  2 sep 17:53 snd_wss_lib -> ../../snd_wss_lib

But, while I'm writing this, the cards are correctly loaded, maybe the output would change in case the were loaded in different order. I dont know...

So, any ideas?

Last edited by k2000 (2010-09-04 17:45:54)

Offline

#2 2010-09-02 22:26:16

Mountainjew
Member
From: Ireland
Registered: 2008-08-24
Posts: 405

Re: [Solved] Two soundcards loading in random order

I believe this should be of some help...

http://wiki.archlinux.org/index.php/Als … sound_card

Edit: oops i see youi've already tried that...

Last edited by Mountainjew (2010-09-02 22:30:59)

Offline

#3 2010-09-02 22:31:44

k2000
Member
Registered: 2009-12-02
Posts: 33

Re: [Solved] Two soundcards loading in random order

Thank you Mountainjew, but I have already read and tried this...

NB: Some modules do not support indexing options eg. snd-hda-intel. If you experience problems on reboot edit /etc/modprobe.d/modprobe.conf to just have the modules.

It does not helped either to let just the modules names.

Offline

#4 2010-09-02 22:51:57

k2000
Member
Registered: 2009-12-02
Posts: 33

Re: [Solved] Two soundcards loading in random order

I think I may have found the solution in ubuntu wiki (in french), here http://doc.ubuntu-fr.org/son_problemes# … cartes_son

It says to take the output of

cat /proc/asound/modules 

witch, in my case, returns this

 0 snd_intel8x0
 1 snd_mpu401
 2 snd_ca0106

I don't know wich is the #1, but #0 is my onboard soundcard and #2 my pci soundcard.

It says to go to /etc/modprobe.d/alsa-base.conf and set the defaults with something like this:

install sound-slot-0 modprobe snd-card-0
install sound-slot-1 modprobe snd-card-2

but there is no /etc/modprobe.d/alsa-base.conf file in arch. Is this file located in another place?

Offline

#5 2010-09-02 23:35:45

e_tank
Member
Registered: 2006-12-21
Posts: 80

Re: [Solved] Two soundcards loading in random order

i have this issue as well but have been to lazy to do anything about it.  what i've been doing is whenever this happens to me i run a very basic script that removes both sound drivers and reloads them in the correct order:

#!/bin/bash
rmmod cx88_alsa snd_hda_intel
sleep 1
modprobe snd_hda_intel
sleep 1
modprobe cx88_alsa
sleep 1
alsactl restore

there seems to be a lot of suggestions for how to deal with this issue over at the alsa wiki, using udev should probably be a last resort.  here are two links that you may find useful:
http://alsa.opensrc.org/index.php/MultipleCards
http://alsa.opensrc.org/index.php/Udev

i'm going to go ahead and try the suggestion listed here.  however, i won't know right away if it's working, as my system seems to load the wrong driver at boot in default slot < 50% of the time.

edit1:

k2000 wrote:

It says to go to /etc/modprobe.d/alsa-base.conf and set the defaults with something like this:

install sound-slot-0 modprobe snd-card-0
install sound-slot-1 modprobe snd-card-2

but there is no /etc/modprobe.d/alsa-base.conf file in arch. Is this file located in another place?

if the file doesn't exist create it with just those commands in it, modprobe will automatically read the *.conf files it finds in /etc/modprobe.d/

Last edited by e_tank (2010-09-02 23:46:21)

Offline

#6 2010-09-03 00:42:22

k2000
Member
Registered: 2009-12-02
Posts: 33

Re: [Solved] Two soundcards loading in random order

I tried creating the file /etc/modprobe.d/alsa-base.conf white the above lines and rebooted.
Everything is ok, but since the problem does not happen all the times....
I suppose I will come back to mark the thread as resolved in about two weeks if the problem does not reappear.
Thanks for your help!

Offline

#7 2010-09-03 01:19:04

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: [Solved] Two soundcards loading in random order

k2000 wrote:

index = 0

Whose idea was it to add those spaces? Remove them.

Offline

#8 2010-09-03 01:32:16

k2000
Member
Registered: 2009-12-02
Posts: 33

Re: [Solved] Two soundcards loading in random order

After another reboot the devices are still inversed sad
@brebs: Don't know whose idea it was, but i'll try removing the spaces... but I feel like I already tried it.

Last edited by k2000 (2010-09-03 01:33:28)

Offline

#9 2010-09-03 03:25:27

e_tank
Member
Registered: 2006-12-21
Posts: 80

Re: [Solved] Two soundcards loading in random order

if what you're trying doesn't work, try putting just the following line in /etc/modprobe.d/alsa-base.conf and nothing else

options snd slots=,snd-ca0106

that's the method that i linked to that i'll be trying first

Offline

#10 2010-09-03 06:01:14

eDio
Member
From: Ukraine, Kyiv
Registered: 2008-12-02
Posts: 422

Re: [Solved] Two soundcards loading in random order

check this
https://bbs.archlinux.org/viewtopic.php?id=87539
and especially this
http://www.gentoo.org/doc/en/alsa-guide.xml

Last edited by eDio (2010-09-03 06:02:36)

Offline

#11 2010-09-04 17:45:29

k2000
Member
Registered: 2009-12-02
Posts: 33

Re: [Solved] Two soundcards loading in random order

Thanks eDio, I think your other post will solve my problem.
When copiing the two lines from modprobe.conf to alsa.conf, I realize I had no "s" at "options".
Smashing my head against the wall. Again.

Offline

Board footer

Powered by FluxBB