OpenBSD manual page server

Manual Page Search Parameters

AUDIOCTL(8) System Manager's Manual AUDIOCTL(8)

audioctlget or set audio driver variables

audioctl [-nq] [-f file] [-w wait] [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.
wait
Display variables every wait seconds. audioctl will continue to display variables until interrupted.
name[=value]
Retrieve the specified variable name, or attempt to set it to value. Multiple name[=value] arguments may be given.

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

Once per second, display the number of bytes of silence inserted due to buffer underruns (since the device started playback):

# audioctl -w 1 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), audio(4), mixerctl(8), sysctl(8)

The audioctl command first appeared in NetBSD 1.3.

January 9, 2023 OpenBSD-current