I have a USB headseat that I like to use with my laptop from time
to time. When I plug it in, it becomes a second sound device on
/dev/dsp1 instead of /dev/dsp.
I searched but I couldn't find a setting in Firefox to get it to
use a different device than /dev/dsp, so even with my head set in
the Flash player would use the laptop speakers when playing
videos (like at youtube.com).
I finally came across something that solves it. I thought I'd
pass it around in case anyone else needs the solution. It turns
out that programs like Flash and Totem (another I couldn't
customize) use the Alsa asound library. You can customize your
devices in ~/.asoundrc
I can make it work with:
#----- begin ~/.asoundrc -----
pcm.!default {
type hw
card 1
}
ctl.!default {
type hw
card 1
}
#----- end ~/.asoundrc -----
Since sometimes I have the headset in and sometimes I don't, I
made a script called setaudio that would set things up for me.
#----- begin setaudio -----
#!/bin/bash
if [ -e /dev/dsp1 -a ! -e ~/.asoundrc ]; then
cat > ~/.asoundrc << ASOUNDRC
pcm.!default {
type hw
card 1
}
ctl.!default {
type hw
card 1
}
ASOUNDRC
fi
if [ -e ~/.asoundrc -a ! -e /dev/dsp1 ]; then
rm ~/.asoundrc
fi
exec "$@"
#----- end setaudio -----
Then I can just do:
$ setaudio firefox
or
$ setaudio totem movie.avi
It will set the audio settings correctly and spawn the program.
Have fun.
Don
--
Don Bindner <[EMAIL PROTECTED]>
-----------------------------------------------------------------
To get off this list, send email to [EMAIL PROTECTED]
with Subject: unsubscribe
-----------------------------------------------------------------