Warning: THE VOID WIKI IS DEPRECATED. It is no longer being maintained, contains outdated and incorrect information, and will eventually be shut down. Please refer to the Void Handbook, https://docs.voidlinux.org/, for the official documentation. If you can't find the information you're seeking, please raise an issue at https://github.com/void-linux/void-docs/issues


From Void Linux Wiki
Revision as of 06:13, 29 January 2018 by Tactica (talk | contribs) (Created proper references section; minor style amendments.)
Jump to navigation Jump to search

Medic template.svgThis article or section needs expansion.

Reason: An explanation of how to use sndio for network sound and controlling MIDI devices is needed. (Discuss)

sndio is a small audio and MIDI framework part of the OpenBSD project. It provides an optional sound server (sndiod) and a documented application programming interface to access either the server or the audio and MIDI hardware in a uniform way.

It is an alternative to the well known PulseAudio and jack sound servers.

Some prominent features of sndio include:

  • Performs re-sampling and format conversions.
  • Allows concurrent access to an audio device.
  • Split an audio device into sub-devices.
  • Allows one program to record what other programs play.
  • Control the volume of individual programs.
  • Route audio and MIDI data through a network and between programs.


# xbps-install -S sndio

To start the sound server sndiod:

# ln -s /etc/sv/sndiod /var/service

It is recommended to have all ALSA outputs at 0dB and control the volume through sndiod instead.

Controlling volume

sndiod controls application volume using MIDI messages, to do this without a MIDI device, aucatctl can be used.

aucatctl sends MIDI volume controller messages to adjust the volume of audio programs using the sndiod server for output.


# xbps-install -S aucatctl


List available volume controls and their values:

$ aucatctl

Set master volume to maximum:

$ aucatctl master=127

Mute mpv and set sox to 100:

$ aucatctl mpv0=0 sox0=100

Extra utilities

sndio also provides two extra utilities, aucat and midicat.


The aucat utility can play, record, mix, and process audio files on the fly. Similar to that of aplay and arecord from ALSA. See aucat(1) for usage.


The midicat utility receives MIDI data from a given input MIDI port and/or sends it to a given output MIDI port. See midicat(1) for usage.

Known issues

Some programs play sound at maximum volume

Either the program is not configured to use sndio as its output or it does not support sndio. The program will play at maximum volume as it will connect to the master ALSA output, which should be configured to 0dB.

To prevent programs from exploding your speakers when they don't support sndio, create /etc/asound.conf with these contents:

pcm.null {
    type null

pcm.default null

This will cause programs that connect to ALSA instead of sndio to discard their output instead.

Note: An alternative option is to start sndiod with the -a on flag. This causes sndiod to take exclusive control of the audio device, instead of accessing it on demand.

sndio via ALSA[1]

Warning: This has not been thoroughly tested, it is possible you may encounter sound issues, quality loss, sync issues, etc. You have been warned!

To get programs that only support outputting to ALSA to use sndio, create /$HOME/.asoundrc with these contents:

pcm.sndio {
    type asym
    playback.pcm "sndio-play"
    hint {
        show on description "OpenBSD sndio"

pcm.sndio-play {
    type plug
    slave {
        pcm "sndio-raw"
        rate 48000
        format s16_le
        channels 2

pcm.sndio-raw {
    type file
    slave.pcm null
    format raw
    file "| aucat -f snd/0 -i -"

pcm.default sndio

This will create a signed 16 bit stereo ALSA output at 48000Hz.


  1. purple mountains — OpenBSD sndio via ALSA on ARCH Linux works (Github)

External links