# Using sndio



## Deleted member 67862 (Apr 4, 2022)

So I've seen a lot of people trying to use sndio, and decided to try to do so myself since some ports have sndio support but not pure OSS (like obs-studio for example). However, I'm having trouble getting it to work and understanding how it works. I've read both the man page and this section of the FreeBSD wiki. According to the wiki, it "just maps OSS /dev/dspN* devices to sndio rsnd/N devices that can be chosen at start-time via the environment variable AUDIODEVICE." However, I  have no /dev/audioN devices or rsnd/N inside of /dev. I couldn't find rsnd/N or audio anywhere via `locate`.

I have sndiod_enable="YES" and also sndiod_flags="-a on" in /etc/rc.conf.  On restart, sndiod is running under root but it gives the following error when I try using a command like `sndioctl`: "default: can't open control device". This error appears for root and my regular user. I've also tried to manually create a device with sndiod but this didn't work either. Does anyone know how to properly configure sndio?


----------



## SirDice (Apr 5, 2022)

hunter0one said:


> According to the wiki, it "just maps OSS /dev/dspN* devices to sndio rsnd/N devices that can be chosen at start-time via the environment variable AUDIODEVICE."


This begs the question, is there any audio being detected? What does `cat /dev/sndstat` output?


----------



## Deleted member 67862 (Apr 5, 2022)

SirDice said:


> This begs the question, is there any audio being detected? What does `cat /dev/sndstat` output?




```
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: <ATI R6xx (HDMI)> (play)
pcm6: <Realtek ALC887 (Rear Analog)> (play/rec) default
pcm7: <Realtek ALC887 (Front Analog)> (play/rec)
No devices installed from userspace.
```


----------



## shkhln (Apr 5, 2022)

hunter0one said:


> According to the wiki, it "just maps OSS /dev/dspN* devices to sndio rsnd/N devices that can be chosen at start-time via the environment variable AUDIODEVICE." However, I  have no /dev/audioN devices or rsnd/N inside of /dev. I couldn't find rsnd/N or audio anywhere via `locate`.


What that means is that /dev/dsp1 is simply called rsnd/1 in sndio, etc. There aren't supposed to be any new device nodes.


----------



## Deleted member 67862 (Apr 5, 2022)

According to GTK-Mixer, /dev/mixer6 is my default device. I don't know which /dev/dsp device it is or if that means it will be rsnd/6.


----------

