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 aucat(1) and midicat(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, aucat(1) can be used. It exposes one or more software subdevices backed by the underlying hardware, while doing all necessary conversions on the fly. It can mix multiple streams or split the hardware into multiple subdevices, to allow programs to use the hardware concurently.

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 midicat(1).

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

DEVICE NAMES
From the user's perspective every audio interface, MIDI port, aucat(1) or midicat(1) service has a name of the form:

    type:[hostname/]unit[.option]

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

type
    The type of the audio or MIDI device. Possible values for audio devices are aucat and sun, corresponding to aucat(1) sockets and hardware audio(4) devices. Possible values for MIDI devices are midithru, rmidi, and aucat corresponding to midicat(1) software MIDI thru boxes, hardware midi(4) ports and aucat(1) control through MIDI respectively.

hostname
    The hostname where the remote aucat(1) or midicat(1) server to connect to is running.

unit
    For hardware audio or MIDI devices, this corresponds to the character device minor number. For audio or MIDI devices created with aucat(1) or midicat(1) it corresponds to the server unit number, typically 0.

option
    Corresponds to the profile string registered using the -s option of aucat(1) or midicat(1). Only meaningful for aucat and midithru device types.

For example:

sun:0
    First hardware audio device.
aucat:0
    Default audio device of the first aucat(1) audio server.
aucat:0.rear
    First aucat(1) server; device registered with -s rear.
rmidi:5
    Hardware MIDI port number 5.
midithru:0
    First software MIDI thru box created with midicat(1).
aucat:0
    MIDI port controlling the first aucat(1) audio server.

AUTHENTICATION
If a shared aucat(1) or midicat(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 aucat or midicat.
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
aucat(1), midicat(1), mio_open(3), sio_open(3), audio(4), midi(4)