Go to TogaWare.com Home Page. GNU/Linux Desktop Survival Guide
by Graham Williams
Duck Duck Go



CLICK HERE TO VISIT THE UPDATED SURVIVAL GUIDE

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
Here, the onboard sound card is listed first (and hence is the default). To set the better quality Live card as the default:
$ 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
Then configure the sound card(s) using alsaconf. This allows the selection of one sound card from many, if you have more than one. Select one will ensure, right there, that the appropriate modules are loaded and /dev/dsp will be set up appropriately. This directly modifies /etc/modprobe.d/sound so if you have modified it yourself don't use alsaconf.

Once your have the card working, perhaps with alsaconf, run a mixer (e.g., alsamixer to set the volume control:

  $ alsamixer
And store the default volume settings you have chosen with:
  $ 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:

Image gnome-mixer-dual

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


Support further development by purchasing the PDF version of the book.
Other online resources include the Data Science Desktop Survival Guide.
Books available on Amazon include Data Mining with Rattle and Essentials of Data Science.
Popular open source software includes rattle and wajig.
Hosted by Togaware, a pioneer of free and open source software since 1984.
Copyright © 1995-2020 Togaware Pty Ltd. Creative Commons ShareAlike V4.