using sndio and OSS simultaneously

If I try to play audio using chromium, which uses sndio by default, while having DeaDBeeF (Audio player, using OSS output) open in the background the audio won't work while DeaDBeeF is still open. I assume this is because they are fighting over the device file. Is there any way to fix this? Is this what 'virtual mixing' is for, and does FreeBSD support it?
Output of /dev/sndstat:
Code:
Installed devices:
pcm0: <ATI R6xx (HDMI)> (play)
pcm1: <ATI R6xx (HDMI)> (play)
pcm2: <ATI R6xx (HDMI)> (play)
pcm3: <ATI R6xx (HDMI)> (play)
pcm4: <ATI R6xx (HDMI)> (play)
pcm5: <Intel Haswell (HDMI/DP 8ch)> (play)
pcm6: <Realtek ALC887 (Rear Analog 7.1/2.0)> (play/rec) default
pcm7: <Realtek ALC887 (Front Analog)> (play/rec)
pcm8: <Realtek ALC887 (Onboard Digital)> (play)
No devices installed from userspace.
My audio-related sysctl's in /etc/sysctl.conf:
Code:
dev.pcm.6.play.vchanformat=s32le:2.0
hw.snd.feeder_rate_quality=4
hw.snd.latency=3
dev.pcm.6.bitperfect=1
kern.timecounter.alloweddeviation=0
hw.snd.maxautovchans=0
Apologies if this doesn't make any sense (or is the cause of the issue), I just cobbled this together from other forum threads on how to get the highest quality audio output 😅 (Except for hw.snd.latency=3, I added that to stop underruns.)
I'm sorry if this is really dumb, I come from Linux where I usually just use Pulseaudio and JACK.
 
Welp, I quickly spun up a bhyve VM just to check what the default value is and set it to that (it's 16), but it seems to still be doing the same thing. :/
Maybe I have to change my DeaDBeeF config to not use /dev/dsp, but some other device file? Setting it to either /dev/dsp or /dev/dsp6 has this issue, and my /dev/sndstat hasn't changed. How is this supposed to work, is OSS supposed to create some new device files that I can use?
 
that's also expected when using bitperfect mode. You either enable it for best possible quality but cannot use by several applications as it exclusively owned by the first or use multi channel mixer. That's the trade-off.
 
I did a sysctl dev.pcm.6.bitperfect=0, but it still isn't working right. Do I need a reboot or something? I'd still like to be able to use bitperfect mode when I don't need multiple devices to access it so a need to reboot would be quite annoying, I'm hoping that isn't the case.
 
usually, you do not need to reboot. it should work on the fly. but you need to make sure there is no application using sound card. so, close it. if you intend to use sndio with this specific device ( dev.pcm.6 ), then you can try using snd/6, that is in your environment ( sh, tsch, zsh, bash ) add:
AUDIODEVICE="snd/6"
or in /etc/rc.conf set:
Code:
sndiod_flags="-f snd/6"
and restart your sndio daemon
 
Back
Top