5 ms·
Sndio: a small audio and MIDI framework part of the OpenBSD project
- rushsteve1 9y agoI know very very little about audio frameworks, but what does sndio have over it's competition? It is clearly a simpler and likely cleaner system than PulseAudio, but what about compared to ALSA and OSS?
- brynet 9y agoOn Linux, this is implemented on top of ALSA, which is the native Linux kernel sound API.
- rushsteve1 9y agoSo then would sndio be the OpenBSD native sound API?
- brynet 9y agoFor the sake of easier application software, yes. sndio is the higher level of abstraction. There is a lower level API, audio/mixer/midi(4), but they exist as only ioctl(2) calls.
- ratchov 9y agoBasically, on OpenBSD, audio functionality was partially moved from kernel to user space, it was extended and called sndio. From this standpoint it's the OpenBSD native audio API. The remaining kernel audio(4) and midi(4) APIs are internal interfaces used by sndio to get access to the bare hardware; they are too limited to be useful to typical programs.
- isatty 9y agoI've never heard of someone preferring PulseAudio to ALSA
- deleted 9y ago[deleted]
- michaelmrose 9y agoI like network transparency and the ability to move running streams from speakers to USB headphones.
- Zardoz84 9y agoor duplicate streams and send it to multiple sound outputs.
- black_knight 9y agoPulse audio is OK for routing audio around. It even supports LADSPA filters through a module. So I’ve used it when playing Dungeons & Dragons over Mumble, to filter my voice when role-playing monsters (nothing beats a little reverb and pitch tuning to make the monster boss more frightening to the players) and putting music into the channel. I would not know how to do that with ALSA. But Pulse Audio uses ALSA, so... That said, JACK is much better for routing audio through applications. And jack-rack actually lets you change the parameters of LADSPA filters without reloading. And it is easy to get a graphical mixer up controlling individually the volume from all the sources.
- nightcracker 9y agoI've tried 3 times in the past to run JACK on Ubuntu. Each time I had bricked audio after installing, tried to fix for around 1-2 hours and gave up. My experience with JACK has been horrible.
- johnnybones 9y agoYou should try Gentoo Studio, very nice 64-bit desktop real-time Linux audio production, based on Gentoo (duh). Works very well.
- black_knight 9y ago
- zuzun 9y agoFor simple audio playback there's not much difference between their APIs. OSS is a bit of an outlier because it works on a sound device via standard IO system calls. All the other frameworks expose very similar functions: you initialize the library, you tell it about your audio format and then you start writing the audio data. Xiph.org's libao [1] is worth a mention because it's a very neat library that offers true cross-platform support. [1] https://xiph.org/ao/ https://xiph.org/ao/
- upofadown 9y agoI have been using a OpenBSD system as my living room "media" computer for a while. Before that it was a Linux system. I have to discuss sndiod (the mixer daemon) as that is the interface that is normally used and it has the same API as the underlying sound drivers. Comments: 1. There was a learning curve. You put all your default configuration in the /etc/mixerctl.conf file. After boot you use the mixerctl command to change anything you need to change. In my case I never use the mixerctl command as everything just works by using the per application volume controls. I have the master volume mapped to some function keys but I never use them. 2. The Sndio drivers, at least for my hardware, simplify the interface. That had good and bad results over the previous ALSA interface. The bad was that there were missing features. The good is that it was possible to actually figure out how to use regular audio. I was never able to figure out how to configure 5.1 audio properly on ALSA due to the ridiculous complexity of the onboard HD audio exposed through ALSA. When I moved to OpenBSD I was able to get rid of the extra sound card (which OpenBSD did not support). 3. The addition of sndiod (the mixer daemon) is for all practical purposes transparent. You get a single volume control per app and that is that. The hardware mixer controls are effectively hidden in a useful way. There is nothing like the separate ALSA hardware controls you have to mess with when you use Pulseaudio. 4. Once you set up your audio inputs (which are also done in a transparent way through sndiod) you are done. So when I pick up the mic to talk on mumble I expect that I will be heard, even if I have rebooted. Compared to my experience on Linux, this feels like witchcraft. 5. Sndio through sndiod has network transparency that is done in a fairly transparent way. You just add on a server name when specifying the device name. I use this functionality for a whole house audio system where the target is a sndiod running on a Linux system using ALSA as the backend. Debian has a sndiod package now.
- brynet 9y agoThis is the native audio subsystem used by OpenBSD, it includes a library (libsndio) and a privsep server (sndiod). There was a massive successful undertaking to write backends for most 3rd party audio software in the ports tree, things like chromium, and it is now included upstream in SDL, OpenAL, Mozilla Firefox, mpd, etc.
- bnolsen 9y agovoidlinux's firefox package has sndio support in it. It takes very little cpu to run this unlike pulseaudio which would kill this little underpowered laptop I'm currently on (several generations old sual dore atom).
- bkor 9y agoFor Pulseaudio please file bugreports. Could be that it's transcoding things (44.1kHz to 48kHz conversion, etc). I have a pretty slow CPU (NUC5PPYH) and Pulseaudio has been working fine for loads of years.
- rollcat 9y ago> voidlinux's firefox package has sndio support in it. Wow, didn't know that. I'm a fan of all three but no time to muck around with distros. Might reconsider.
- tobik 9y agoThere is a good support for sndio in the FreeBSD ports tree as well. Albeit hidden behind the SNDIO build time option. It was quite the ride to get it to that point :-) There are also now some sndio backends out there for applications not in the OpenBSD ports tree like Cava, shairport-sync, and Kodi.
- cjhanks 9y agoCan sndio replace Jack?
- fundamental 9y agoIt doesn't look like sndio targets the application->application audio routing use-case, nor does it appear to prefer a lower latency audio pull-API. So, it does not look like by design it can be a jack replacement.