- NetBSD Manual Pages
OSSAUDIO(3) NetBSD Library Functions Manual OSSAUDIO(3)
Powered by man-cgi (2021-06-01).
Maintained for NetBSD
by Kimmo Suominen.
Based on man-cgi by Panagiotis Christias.
ossaudio -- Open Sound System emulation
OSS Audio Emulation Library (libossaudio, -lossaudio)
The ossaudio library provides an emulation of the Open Sound System audio
Use the native audio(4) and mixer(4) interfaces for new programs, and
this emulation library only for building code written for other operating
Mixer Control Map
The following table summarizes the mappings from native interface device
names to OSSv3 mixer controls.
Native Device Name OSS Mixer Control
The ossaudio interface aims to be compatible with the Open Sound System
version 4, as described in:
4Front Technologies, OSS 4.x Programmer's Guide,
ioctl(2), audio(4), midi(4), mixer(4)
The ossaudio library first appeared in NetBSD 1.3.
The Open Sound System up to version 3 was originally the preferred API
for writing audio code under Linux until ALSA became the new default in
Linux 2.6. It remains the preferred API in FreeBSD and Solaris, and a
large body of code exists supporting it.
· The emulation is incomplete. Some less popular features are not emu-
lated (e.g. sync groups), but the essential ioctls used by the major-
ity of software are covered.
· NetBSD AUDIO_MIXER_SET control types cannot be accurately represented
in the OSSv4 mixer API, so are treated as enums.
· Per-stream volume (i.e. SNDCTL_DSP_SETPLAYVOL) is not currently
implemented as in OSSv4, and will instead modify the global volume.
Applications need to provide samples with the appropriate gain.
· Linux, FreeBSD, and Solaris provide /dev/dsp and /dev/mixer devices
in place of the /dev/audio and /dev/mixer devices this compatibility
layer must be accessed through on NetBSD. However, changing this is
typically trivial when porting programs.
· The emulation only covers ioctl(), there are other differences as
well. E.g., on a write that would block in non-blocking mode Linux
returns EINTR whereas NetBSD 1.3 returns EAGAIN.
· The emulation uses a #define for ioctl() so some obscure programs can
fail to compile.
NetBSD 10.99 October 20, 2020 NetBSD 10.99