[ltp] Observation: /dev/dsp in kernel 2.6.16 can now be multiply opened!

Richard Neill linux-thinkpad@linux-thinkpad.org
Tue, 11 Jul 2006 03:31:33 +0100


Dear All,

I just discovered this, and thought it worth sharing:

1)Originally, there was /dev/dsp using OSS. Only one application could 
use it at a time.

2)This resulted in Sound servers as a workaround, like the ghastful 
kludge that is ARtS

3)Then, there was ALSA, which also emulated OSS. ALSA with dmix allowed 
multiple clients. But /dev/dsp could still only be used once at a time.

4)Then came aoss, and soundwrapper, used to take old-style applications 
(which use /dev/dsp), and redirect them into alsa/dmix.

5)Now, to my surprise, I discovered that even /dev/dsp can be opened by 
several applications at a time. This definitely never used to be the case!

Eg:
   play -d /dev/dsp somefile.ogg & play -d /dev/dsp otherfile.ogg
or even:
   frozen-bubble & frozen-bubble & frozen-bubble & frozen-bubble &


This seems to have occurred as of kernel 2.6.16, and a very nice 
surprise it is too. I only discovered it by accident, so thought it 
worth passing on.

Regards,

Richard