"Default sound unit" functionality is needed.

Vasily Postnicov shamaz.mazum at gmail.com
Thu Jul 3 08:56:27 PDT 2014


Hello!

I need functionality similar to FreeBSD hw.snd.default_unit sysctl. It
defines which audio devices (/dev/dspN, /dev/mixerN) will be opened if
someone opens /dev/dsp or /dev/mixer.

I don't have a good idea how this can be done. I've made a quick patch for
dsp devices, it is attached.
The problem is that now the "default" node is opened all the time, no
matter if I open /dev/dsp or a specific /dev/dspN device.

My first thought was to compare ap->a_name to "dsp" to know if we just open
/dev/dsp or more specific /dev/dspN, but ap->a_name always has a form
"dspN", even if /dev/dsp is opened.

Any ideas how to implement this correctly?

                Vasily
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.dragonflybsd.org/pipermail/kernel/attachments/20140703/ad3b6e79/attachment-0002.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pcm.patch
Type: text/x-patch
Size: 3730 bytes
Desc: not available
URL: <http://lists.dragonflybsd.org/pipermail/kernel/attachments/20140703/ad3b6e79/attachment-0015.bin>


More information about the Kernel mailing list