- Thread Starter
- #26
Thanks for your reply!Hey tembun, sorry I didn't reply to this sooner.
The issue here is, OSS audio cards as seen by application are just files. The application itself may try to sift through /dev/ and only pick up the files it deems appropriate like dspX. It may only open the /dev/dsp which is expected to be routed to the "default sound card".
This is in my opinion the biggest issue on the application part of the OSS audio, the API is low level UNIX and hence client code is very non-standardized. Everyone may use another approach of parsing files and directories...
What should work is using sysctl hw.snd.default_unit to point to the pcmN number of your device per.Code:cat /dev/sndstat
In case everything else is correct, e.g. sndstat showing your vdev, and it shows rec capability, and is default_unit per sysctl, you should run the client app with truss and see what /dev/ files related to sound is it trying to open, or perhaps it opens correctly but cannot do an ioctl, etc.
I recently contacted christos@ (Christos Margiolis, he's been actively doing a lot of sound-related stuff in FreeBSD kernel & userland) and he helped me a lot to understand things better.
Regarding making an application (in my case, I wanted a browser) use a particular /dev/dsp* node: yeah, it largely depends on what sound system interface a particular application supports. I.e. this program 'knows' only about ALSA or sndio(7) and doesn't know about OSS - well, sorry, not this time. And ... www/chromium is one of these programs - it doesn't support OSS. But www/firefox does - is has an OSS backend. I spent quite some time figuring out how to use it instead of a default one (because when I was trying to select a microphone device, I didn't see any /dev/dsp* like option). In order to turn it on, one should manually set
media.cubeb.backend to oss in about:config. And that is not widely documented, so I hope that will help someone. After that, you can select whatever /dev/dsp* that /dev/sndstat reports you like as your microphone.I've been a little busy with other stuff, so my project that I've been talking about in these posts is still in progress! So far so good