SNDIO(7)

NAME
sndio - interface to audio and MIDI

DESCRIPTION
The sndio audio and MIDI system provides access to audio and MIDI hardware and to services provided by sndiod(1), 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(1) 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(1).

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

DEVICE NAMES
From the user's perspective every audio interface, MIDI port, and sndiod(1) 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:

    rsnd
        Raw audio(4) device.
    rmidi
        Raw midi(4) port.
    snd Audio device exposed by sndiod(1).
    midithru
        MIDI thru box created with sndiod(1).
    midi
        MIDI port exposed by sndiod(1).
    default
        Any audio device or MIDI port.

hostname
    The hostname or address where the remote sndiod(1) server to connect to is running.

unit
    The number of the sndiod(1) server to connect to, corresponding to the integer specified using the -U option of sndiod(1). Useful only if multiple sndiod(1) 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(1) it corresponds to the number of the corresponding -fM option on the command line.

option
    Corresponds to the sub-device string registered using the -s option of sndiod(1).

For example:

rsnd/0
    First hardware audio device.
rmidi/5
    Hardware MIDI port number 5.
snd/0
    First audio device exposed by sndiod(1).
snd/0.rear
    Sub-device registered with -s rear.
midithru/0
    First MIDI thru box created with sndiod(1).

AUTHENTICATION
If a shared sndiod(1) 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 session cookie, which is automatically generated by audio or MIDI applications upon the first connection to the server. The cookie is stored in $HOME/.aucat_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.

ENVIRONMENT
AUCAT_COOKIE
    Path to file containing the session cookie to be used when connecting to sndiod(1).
AUDIODEVICE
    Audio device to use if the application provides no device chooser.
MIDIDEVICE
    MIDI port to use if the application provides no MIDI port chooser.

Environment variables are ignored by programs with the set-user-ID or set-group-ID bits set.

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

SEE ALSO
sndiod(1), mio_open(3), sio_open(3), audio(4), midi(4)