Computers With Multiple Soundcards

Installing Multiple Soundcards On A Linux System

With the standard kernel code, this can be tricky. You'll probably compile sound support as modules, and insert the cards one at a time with any necessary parameters.

With the commercial OSS drivers from 4front technology, I had no problem getting several cards to work at once. Their configuration utility autodetected and installed all three of my sound cards. Many cheap and a few professional cards are supported. A basic license costs $20, certain cards require more expensive options.

The ALSA project has developed a free set of drivers meant as a powerful alternative to the standard kernel drivers. Many cards are supported, and the system is designed to support multiple cards without conflict.

Supporting Multiple Soundcards In GDAM

Make sure all of your available devices are listed in the server.config file. Any client can be run with the --device flag to change the default sound device. The gdam-launcher program accepts multiple --device flags, and can switch a source from one device to another. If no --device flags are given, most clients will use the value of the GDAM_DEVICE environment variable. gdam-launcher will use both GDAM_DEVICE and GDAM_DEVICE2 if not given other soundcards on the command line.

Supporting Four-Channel or "Surround" Soundcards In GDAM

An alternative to multiple sound cards is a four-channel sound card. I get great performance from my Trident 4DWave sound card, which features seperate front and rear stereo outputs. SoundBlaster Live cards also offer four channels of audio output. A benefit of cardlike this over two seperate soundcards is that the timing of two channels, and the devices which feed them, is identical... they will not drift or be read from at different times.

Four-Channel soundcards offer seperate front and rear stereo outputs. This is usually accomplished by having multiple "subdevices" for writing audio data to the soundcard. Hardware mixing controls determine whether each subdevice sends sound to the front outputs, the rear outputs, or both. The mixer controls are reset each time a subdevice is opened, so i have to set the mixer controls each time i restart the gdam server.

In order to use front and rear outputs of a card such as the 4DWave or the Soundblaster Live, you need drivers which support the card's internal mixing controls. The ALSA drivers, version 0.5 and higher, support these controls and the following instructions apply to alsa drivers. I am unaware whether the kernel OSS drivers or the commercial OSS drivers export these mixer controls... if so, a similar process should allow output.

After installing ALSA drivers, add entries to the server.config file which describe specific subdevices on your four-channel soundcard.

# ALSA Devices [if you have sys/asoundlib.h installed.]
#
#  appending '#n' to a device name causes gdam to use subdevice n, 
#  if possible.   otherwise, the first available subchannel is used.  
#  You probably don't want entries for both specific subdevices and 
#  the general device, it may conflict.
#
#Device  "alsa"  "/dev/snd/pcmC0D0"   "numfragments=3:logfragsize=12"
Device  "alsa"  "/dev/snd/pcmC0D0#0" "numfragments=3:logfragsize=12"
Device  "alsa"  "/dev/snd/pcmC0D0#1" "numfragments=3:logfragsize=12"

Once the GDAM server knows about subdevices, GDAM clients need to be told to use them. Run gdam-launcher with multiple --device flags, or set the GDAM_DEVICE and GDAM_DEVICE2 environment variables.

% GDAM_DEVICE=/dev/snd/pcmC0D0#0 GDAM_DEVICE2=/dev/snd/pcmC0D0#1 gdam-launcher

The mixing controls on your soundcard need to be set each time the subdevice is opened (i.e. when gdam-server is run.) I use alsactl and gamix to change these settings. Each time an ALSA driver opens a subdevice, new controls are made available to set that device's volume to the front and rear outputs. In alsactl, these controls are named "PCM Front Volume" and "PCM Reverb Volume" for each subdevice. gamix presents front/rear/pan controls for each subdevice under headings such as "PCM Playback" and "PCM Playback 1". Whichever method you use, set subdevice 0 to full volume on the front channel / zero volume on the rear, and set subdevice 1 to zero volume on the front channel / full volume on the rear.  Screenshot of gamix

Once you are pleased with the soundcard settings, use alsactl -f ~/fourout.ctl store to save soundcard settings. After restarting gdam-server and gdam-launcher, you can restore the setting with alsactl -f ~/fourout.ctl restore