GNU/Linux Desktop Survival Guide
by Graham Williams |
|||||
Aduio Multiple Sound Cards |
Generally, any onboard sound card identified is set as the default on boot (/dev/dsp). Additional sound cards (e.g., the SB Live! on Athene (36.26)) are identified as alternatives (/dev/dsp1, etc.).
[080511] To make the alternative sound card the default there have, historically, been several approaches, and has not always been simple. The simplest, and currently suggested approach, is to use the asoundconf command. First, list which sound cards you have available:
$ asoundconf list Names of available sound cards: ICH5 Live |
$ asoundconf set-default-card Live $ asoundconf list Names of available sound cards: Live ICH5 |
Some older and more difficult approaches have included setting up the appropriate configuration file (/etc/modprobe.d/sound). For Athene (36.26) this involved:
alias snd-card-0 snd-emu10k1x alias snd-card-1 snd-intel8x0 |
Another approach was to load the appropriate modules in the order we wish them to be assigned in /etc/modules. For Athene (36.26) this involved:
snd-emu10k1x snd-intel8x0 |
To use the ALSA drivers you simply need to install the right packages (for a 2.6 kernel or newer):
$ wajig install alsa-base alsa-utils alsa-oss |
Once your have the card working, perhaps with alsaconf, run a mixer (e.g., alsamixer to set the volume control:
$ alsamixer |
$ alsactl store |
If multiple cards are configured to run at the same time (i.e., not using alsaconf as above, but instead loading modules for both cards) then some audio applications allow or need the selection of the desired device for the output, usually by selecting the card model. This is true for xmms although, when using ALSA, the OSS option seems to work whilst the ALSA one does not?
A second sound card can also be accessed using the Gnome mixer if both cards are enabled:
From a command line:
$ alsamixer -c 1 |
An alternative, if rather messy, way to make the second sound card the default, you could add the following code to the end of /etc/init.d/bootmisc.sh, where the second sound card is /dev/dsp1:
DEFAULTCARD=1 for f in dsp audio mixer ; do mv /dev/$f /dev/${f}0 ; ln -s /dev/${f}${DEFAULTCARD} /dev/${f} ; done |