/dev/audioctlN
audio control devices
Get 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:
-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.
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 | Meaning |
| name | device name, as shown by |
| mode | current device mode ( |
| 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.
15 releases since OpenBSD 6.7; the text changed 1 time.
-w since OpenBSD 7.3.