OpenBSD manual page server

Manual Page Search Parameters

AUDIOCTL(1) General Commands Manual AUDIOCTL(1)

audioctlget or set audio driver variables

audioctl [-f file]

audioctl [-n] [-f file] name ...

audioctl [-nq] [-f file] name=value ...

The audioctl utility retrieves or sets audio(4) driver variables. The options are as follows:

file
Specifies the audio control device or the audio device. The default is /dev/audioctl0.
Suppress printing of the variable name.
Suppress all output when setting a variable.
name=value
Attempt to set the specified variable name to value.

If the audio control device is used, then values are only stored in the audio(4) driver; they will be submitted to the hardware the next time the device is opened for playback or recording. If the audio device is used instead of the control device, then values are negotiated with the hardware immediately; this requires exclusive access to the device. Variables may only be changed if the device is not opened for playback or recording by another process.

The following variable names are available:

name device name, as shown by dmesg(8)
mode current device mode (play, record, or both)
pause set if not attempting to start
active set if playing or recording
nblks number of blocks (in frames) in the play buffer
blksz number of frames per block
rate sample rate in Hz
encoding current sample format
play.channels number of play channels
play.bytes bytes played since playback started
play.errors bytes inserted during underruns
record.channels number of recording channels
record.bytes bytes recorded since device started
record.errors bytes dropped during overruns

Encoding names use the following scheme: signedness (s or u) followed by the precision in bits, the byte-order (le or be), the number of bytes per sample, and the alignment (msb or lsb). Only the signedness and the precision are mandatory. Examples: u8, s16le, s24le3, s24le4lsb.

/dev/audioctlN
audio control devices
/dev/audioN
audio devices

Display the number of bytes of silence inserted during play buffer underruns since device started:

$ audioctl play.errors

Use signed 24-bit samples and 44100Hz sample rate:

$ audioctl -f /dev/audio0 encoding=s24 rate=44100

Note the use of /dev/audio0 to force negotiation with the hardware. If the above parameters are not supported by the hardware, then supported ones will be selected instead.

aucat(1), cdio(1), mixerctl(1), audio(4), sysctl(8)

The audioctl command first appeared in NetBSD 1.3.

June 21, 2016 OpenBSD-6.4