Page 1 of 1
wrong soundcard
Posted: Tue Apr 26, 2011 5:13 pm
by Ganelon
It's really a minor issue, but for some reason Oolite likes to insist on using my second soundcard rather than the on-the-motherboard card that is set as system default. I'm currently running Ubuntu Karmic Koala.
I usually just physically change the plug when I go to play Oolite, but if anybody happens to know some command line option or config setting or whatever to direct Oolite to a specific soundcard, it would be nice.
Re: wrong soundcard
Posted: Fri Apr 29, 2011 7:13 pm
by Getafix
Hi Ganelon,
it seems there is an SDL environment variable that can be used on that matter. I quote from
libsdl.org.
Code: Select all
AUDIODEV
The audio device to use, if SDL_PATH_DSP isn't set.
...
SDL_PATH_DSP
The audio device to use. If not set, SDL tries AUDIODEV and then a platform-dependent default value (/dev/audio on Solaris, /dev/dsp on Linux etc).
I suspect that you could force the use of a device by setting the SDL_PATH_DSP variable.
Make sure the speakers are connected to the preferred sound-card and the linux audio is functional.
For starters get all the available dsp devices:
Example:
Code: Select all
$ ls /dev/dsp*
/dev/dsp
/dev/dsp1
$
Then locate the oolite executable script:
Example
Then backup this script:
Example:
Code: Select all
$ sudo cp -p /usr/bin/oolite /usr/bin/oolite.original
$
Now recreate the oolite script by adding the SDL environment variable definition:
Example:
Code: Select all
$ sudo bash
# echo "export SDL_PATH_DSP=/dev/dsp" > /usr/bin/oolite
# cat /usr/bin/oolite.original >> /usr/bin/oolite
# exit
$
Execute oolite. If you don't get audio, then execute this last chunk of code again
by altering /dev/dsp to the second device /dev/dsp1.
If this approach did not work, then rollback to your original oolite script.
Example:
Code: Select all
$ sudo mv /usr/bin/oolite.original /usr/bin/oolite
$
Re: wrong soundcard
Posted: Sat Apr 30, 2011 4:41 am
by JensAyton
As a side note, if SDL is not defaulting to the system default, that would appear to be an SDL bug and should be reported to them.