Talk:MultipleCards
From the ALSA wiki
Contents |
[edit] Major rewrite
Ouch, this page need a major rewrite. It is so many approximations in it. I will try to make some corrections.
For any ALSA configuration (I assume ALSA is built as modules), the reference is [file:///usr/src/linux/Documentation/sound/alsa/ALSA-Configuration.txt /usr/src/linux/Documentation/sound/alsa/ALSA-Configuration.txt] from the kernel documentation. If you don't have the kernel sources, this file is with the documentation of the alsa-driver package.
First, somme comments on this page. I will begin them with #
Well, I edited the article. It is mostly done, but I didn't get the time to review the examples section.
[edit] Multiple soundcards in Gentoo
In this setup the cards get a specific order nothing more, the first one (audigy) is the default card which amarok, mplayer,... will use
You could of course also compile the kernel without the second driver.
sample /etc/modules.d/alsa file for multiple soundcards
1. snd-ca0106 (creative audigy ls)
2. snd-intel8x0 (onboard)
options snd-ca0106 index=0 options snd-intel8x0 index=1 # alias snd-card-0 snd-ca0106 alias snd-slot-0 snd-card-0 alias sound-slot-0 snd-slot-0 # alias snd-card-1 snd-intel8x0 alias snd-slot-1 snd-card-1 alias sound-slot-1 snd-slot-1
# You did forget options snd cards_limit=2
after that you need to run:
modules-update && /etc/init.d/alsasound restart
Howto get the needed information:
(current sound card order can change because udev loads the modules in random order. dont know about drivers compiled in the kernel)
cat /proc/asound/cards
0 [CA0106 ]: CA0106 - CA0106
Audigy SE [SB0570] at 0xdf00 irq 19
1 [CK804 ]: NFORCE - NVidia CK804
NVidia CK804 with ALC655 at 0xfebfd000, irq 22
(used modules)
cat /proc/asound/modules
0 snd_ca0106 1 snd_intel8x0
[edit] Multiple Sound Cards on Debian, different approach
I did not manage to get the modules config version to solve the problem working, so I took a different approach. I created an init script to determine the desired primary device and change the alsa config accordingly. It tries to find the device from the information available through /proc/asound/modules and creates the /etc/asound.conf.
The latest version of the skript is available here Github Repository - set_alsa_card.sh (just grab the raw version of set_alsa_card.sh)
You just have to ajust the variables according to your needs and place the script in your bootup process. I placed the file to /etc/init.d/set_alsa_card.sh and linked it into /etc/rc2.d/S20_set_alsa_card. After that it creates the config file during each boot. Make sure you don't have a ~/.asoundrc that is interfering with the global config and be aware that the specified config file will be ovewritten.
The following config is created for example:
/etc/asound.conf
# Warning, this file is created by script - do not modify
# or deal with lost changes.
#
# This config makes 'emu10k1' the first card.
#
# Updated: Wed Feb 4 22:36:16 CET 2009
pcm.!default {
type hw
card 0
}
ctl.!default {
type hw
card 0
}
[edit] USB webcam kills sound card on Debian Lenny box
I found when plugging a Logitech pro 9000 webcam into my debian lenny box that the sound card on the motherboard would randomly be disabled.
If the soundcard was disabled during boot I found this in dmesg
[ 10.698812] cannot find the slot for index 0 (range 0-0), error: -16 [ 10.698812] Intel ICH: probe of 0000:00:1e.2 failed with error -12
and this if I looked for working soundcards
debdesk:~# cat /proc/asound/cards
0 [U0x46d0x990 ]: USB-Audio - USB Device 0x46d:0x990
USB Device 0x46d:0x990 at usb-0000:00:1d.7-2, high speed
My solution was to edit the /etc/modprobe.d/alsa-base file and add this to the bottom
# Keep webcam from being loaded first options snd_usb_audio index=-2
# good. In some cases (when your solution alone fail), it can even be needed to blacklist snd_usb_audio in /etc/modprobe.d/blacklist.conf, in order to prevent udev from loading this module before alsasound.
no problems since