Unlock /dev/dsp?

Ian Smith smithi at nimnet.asn.au
Sun Feb 10 04:15:08 UTC 2008


On Sat, 9 Feb 2008 20:17:48 +0100 (CET) Andreas Davour <ante at Update.UU.SE> wrote:

 > I have begin to find it annoying that when I have a Firefox running with 
 > a page with a youtube link it it, I can't at the same time play a mp3 
 > file with mplayer. When I try I get an error saying that /dev/dsp is 
 > busy. Is there a way to make it play me some music anyway?
 > 
 > I use KDE if that matters.

See sound(4) .. you want to set up some virtual channels, eg in
/etc/sysctl.conf (though you can set them manually meanwhile)

hw.snd.verbose=2
hw.snd.pcm0.vchans=4
hw.snd.maxautovchans=4

smithi on paqi% ls -lrt /dev/dsp*
crw-rw-rw-  1 root  wheel   30,  11 Nov 28 01:27 /dev/dspr0.0
crw-rw-rw-  1 root  wheel   30, 0x00050005 Nov 28 01:27 /dev/dspW0.5
crw-rw-rw-  1 root  wheel   30, 0x00040005 Nov 28 01:27 /dev/dspW0.4
crw-rw-rw-  1 root  wheel   30, 0x00030005 Nov 28 01:27 /dev/dspW0.3
crw-rw-rw-  1 root  wheel   30, 0x00020005 Nov 28 01:27 /dev/dspW0.2
crw-rw-rw-  1 root  wheel   30, 0x00010005 Nov 28 01:27 /dev/dspW0.1
crw-rw-rw-  1 root  wheel   30,   5 Nov 28 01:27 /dev/dspW0.0
crw-rw-rw-  1 root  wheel   30, 0x00050003 Nov 28 01:27 /dev/dsp0.5
crw-rw-rw-  1 root  wheel   30, 0x00040003 Nov 28 01:27 /dev/dsp0.4
crw-rw-rw-  1 root  wheel   30, 0x00030003 Nov 28 01:27 /dev/dsp0.3
crw-rw-rw-  1 root  wheel   30, 0x00020003 Nov 28 01:27 /dev/dsp0.2
crw-rw-rw-  1 root  wheel   30, 0x00010003 Nov 28 01:27 /dev/dsp0.1
crw-rw-rw-  1 root  wheel   30,   3 Feb 10 15:06 /dev/dsp0.0

If you use the KDE sound setup, you could specify say /dev/dsp0.2 for
KDE noises.  Other programs (mplayer, xmms ..) will use a free channel,
and you can run as many others as you like (if you like cacophony :)

You can run 'cat /dev/sndstat' to see what's using what.

cheers, Ian



More information about the freebsd-questions mailing list