Music Production > MilkyTracker Community

Making SDL with ALSA use a specific soundcard when multiple available

(1/1)

devnotnull:
For those that have more than one soundcard, SDL compiled with ALSA, and picks the wrong one, there is an env var "AUDIODEV" that can be set to the appropiate device.


--- Code: ---export AUDIODEV=hw:1,0

--- End code ---

raina:
Nice to know. Do you also have a cure for *buntu seemingly randomly selecting the "default" audio device on each boot?

devnotnull:
Not sure what you mean, hw:0 and hw:1 swap places randomly on each reboot ?
or just default is sometimes hw:0 and sometimes hw:1 ?

The link from IRC: http://www.stchman.com/mult_sound.html

segoh:

--- Quote from: raina on July 24, 2007, 01:01:52 ---Do you also have a cure for *buntu seemingly randomly selecting the "default" audio device on each boot?

--- End quote ---

You can set a fixed index for each alsa device in your modprobe configurations in the /etc/modprobe.d directory (that's at least the path in Debian, see man modprobe for more information). The "default" device is normally set to hw:0.

Example: You want your Creative Soundblaster Live (snd-emu10k1) on index 0 (hw:0), your external Terractec Aureon USB (snd-usb-audio) on index 1 and the virtual MIDI device (snd-virmidi) on index 2.

Create a file /etc/modprobe.d/myalsasettings (or something like that) and insert the following:

--- Code: ---options snd-emu10k1 index=0
options snd-usb-audio index=1 pid=0x0028
options snd-virmidi index=2

--- End code ---

Reload the corresponding modules with rmmod/modprobe or just reboot and your done.

To check if your cards got the right index you could use aplay -l or cat /proc/asound/cards.

You can get the product ID for your USB device with lsusb:

--- Code: ---$ lsusb | grep -i terratec
Bus 003 Device 004: ID 0ccd:0028 TerraTec Electronic GmbH

--- End code ---

Navigation

[0] Message Index

Go to full version