User:AngryGopher/Drafts/Sndio

From Gentoo Wiki
Jump to:navigation Jump to:search

Sndio is a small audio and MIDI framework part of the OpenBSD project and ported to FreeBSD, Linux and NetBSD. It provides a lightweight audio & MIDI server and a fully documented user-space API to access either the server or the hardware directly in a uniform way.

Emerge

Emerge

root #emerge --ask media-sound/sndio

USE flags

Global

Several packages are aware of the global sndio USE flag to enable support for sndio. Enabling this USE flag in make.conf will enable support for sndio in these packages.

FILE /etc/portage/make.conf
USE="sndio"

Configuration

Sndio should work out of the box on systems with only one audio device, further configuration can be achieved by passing arguments to the sndio daemon.

Configuration via OpenRC

Currently in order to pass arguments to the daemon the OpenRC init script must be edited to allow user opts, this requires appending a command_args variable to the script. Below is an example of what this file should look like after editing.

FILE /etc/init.d/sndiod
#!/sbin/openrc-run
command="sndiod"
command_args="${SNDIO_OPTS}"

Below is an example of passing arguments to the sndio daemon when using OpenRC.

FILE /etc/conf.d/sndiod
SNDIO_OPTS="-r 96000"

Application specific configuration

media-sound/mpd

Mpd requires software mixing for audio volume control when using sndio, this can be enabled by appending the following the audio_output section of the mpd configuration

FILE /etc/mpd.conf
mixer_type "software"

Sndio also requires extra configuration when used with multiple users, as is often the case with mpd {...}

See also