Mod Archive Forums Mod Archive Forums
Advanced search  

News:

Please note: Your main modarchive.org account will not work here, you must create a forum account to post on the forums.

Pages: [1]   Go Down

Author Topic: Making SDL with ALSA use a specific soundcard when multiple available  (Read 14104 times)

0 Members and 1 Guest are viewing this topic.

devnotnull

  • New User
  • Offline Offline
  • Posts: 4
    • View Profile

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: [Select]
export AUDIODEV=hw:1,0
« Last Edit: July 24, 2007, 00:42:56 by devnotnull »
Logged

raina

  • Milkytracker Moderator
  • Great Poster
  • ***
  • Offline Offline
  • Posts: 719
    • View Profile
    • raina.kapsi.fi

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

devnotnull

  • New User
  • Offline Offline
  • Posts: 4
    • View Profile

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
« Last Edit: July 24, 2007, 17:26:59 by devnotnull »
Logged

segoh

  • New User
  • Offline Offline
  • Posts: 5
    • View Profile

Do you also have a cure for *buntu seemingly randomly selecting the "default" audio device on each boot?

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: [Select]
options snd-emu10k1 index=0
options snd-usb-audio index=1 pid=0x0028
options snd-virmidi index=2

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: [Select]
$ lsusb | grep -i terratec
Bus 003 Device 004: ID 0ccd:0028 TerraTec Electronic GmbH
Logged
Pages: [1]   Go Up