OpenBSD manual page server

Manual Page Search Parameters

SNDIO(7) Miscellaneous Information Manual SNDIO(7)

sndiointerface to audio and MIDI

The sndio audio and MIDI system provides access to audio and MIDI hardware and to services provided by sndiod(8), summarized below.

Hardware audio(4) devices correspond to peripherals. Only one application may use any device at a given time. Generally a limited number of encodings, sample rates and channel numbers are supported by the hardware, which may not meet the requirements of audio programs.

To overcome hardware limitations and to allow multiple applications to share the hardware, sndiod(8) can be used. It exposes one or more software sub-devices backed by the underlying hardware, while doing all necessary conversions on the fly. It can mix multiple streams or split the hardware into multiple sub-devices, to allow programs to use the hardware concurrently.

Hardware MIDI ports correspond to serial connectors provided by the midi(4) driver. They are typically used to access MIDI hardware (synthesizers, keyboards, control surfaces, etc.), but they do not allow applications to exchange information using the MIDI protocol.

Software MIDI thru boxes allow one application to send MIDI data to other applications connected to the thru box (for instance a software sequencer can send events to multiple software synthesizers). There's no hardware involved: thru boxes are created by sndiod(8).

Additionally, sndiod(8) exposes a MIDI port used to control and monitor audio streams in real time using MIDI.

From the user's perspective every audio interface, MIDI port, and sndiod(8) service has a name of the form:

type[@hostname][,unit]/devnum[.option]

This information is used by audio and MIDI applications to determine how to access the audio device or MIDI port.

type
The type of the audio device or MIDI port. Possible values are:

Raw audio(4) device.
Raw midi(4) port.
Audio device exposed by sndiod(8).
MIDI thru box created with sndiod(8).
MIDI port exposed by sndiod(8).
Default audio device or MIDI port (see below).
hostname
The hostname or address where the remote sndiod(8) server to connect to is running.
unit
The number of the sndiod(8) server to connect to, corresponding to the integer specified using the -U option of sndiod(8). Useful only if multiple sndiod(8) servers are running on the same system.
devnum
Device number. For hardware audio or MIDI ports, this corresponds to the character device minor number. For audio devices or MIDI ports created with sndiod(8) it corresponds to the number of the corresponding -fq option on the command line.
option
Corresponds to the sub-device string registered using the -s option of sndiod(8).

For example:

First hardware audio device.
Hardware MIDI port number 5.
First audio device exposed by sndiod(8).
Sub-device registered with -s rear.
First MIDI thru box created with sndiod(8).

If default is used as the audio device, the program will use the one specified in the AUDIODEVICE environment variable. If it is not set, the program first tries to connect to snd/0. If that fails, it then tries to use rsnd/0. This allows the sndiod(8) audio server to be used by default and the bare hardware as fallback; programs don't have to be reconfigured when sndiod(8) is started or stopped.

If default is used as the MIDI port, the program will use the one specified in the MIDIDEVICE environment variable. If it is not set, the program first tries to connect to midithru/0. If that fails, it then tries to use rmidi/0. As long as sndiod(8) is running, this allows programs to exchange MIDI data on machines with no MIDI hardware by default, e.g. a MIDI player could use a software synthesizer with no manual configuration required.

If a shared sndiod(8) server is running, for privacy reasons only one user may have connections to it at a given time (though the same user could have multiple connections to it). Users are identified by their , which is automatically generated by audio or MIDI applications upon the first connection to the server. The cookie is stored in $HOME/.sndio/cookie and contains 128 bits of raw random data.

If a session needs to be shared between multiple users, they can connect to the server using the same cookie.

Audio device that sio_open(3) uses if the application provides no device chooser.
MIDI port that mio_open(3) uses if the application provides no MIDI port chooser.

These environment variables are ignored by sndio if the program has the set-user-ID or set-group-ID bits set.

/dev/audioN
Audio devices.
/dev/rmidiN
MIDI ports.

mio_open(3), sio_open(3), audio(4), midi(4), sndiod(8)

July 28, 2018 OpenBSD-6.5