Reference

audioctl(8)

get or set audio driver variables

NAME

audioctl – get or set audio driver variables

SYNOPSIS

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

DESCRIPTION

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

-f file

Specifies the audio control device or the audio device. The default is /dev/audioctl0.

-n

Suppress printing of the variable name.

-q

Suppress all output when setting a variable.

-w 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:

NameMeaning
namedevice name, as shown by
modecurrent device mode (
pauseset if not attempting to start
activeset if playing or recording
nblksnumber of blocks (in frames) in the play buffer
blksznumber of frames per block
ratesample rate in Hz
encodingcurrent sample format
play.channelsnumber of play channels
play.bytesbytes played since playback started
play.errorsbytes inserted during underruns
record.channelsnumber of recording channels
record.bytesbytes recorded since device started
record.errorsbytes 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.

FILES

/dev/audioctlN

audio control devices

/dev/audioN

audio devices

EXAMPLES

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.

SEE ALSO

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

HISTORY

The audioctl command first appeared in NetBSD 1.3.

History

-w since OpenBSD 7.3.