OpenBSD manual page server

Manual Page Search Parameters

SNDIOCTL(1) General Commands Manual SNDIOCTL(1)

sndioctlcontrol audio parameters

sndioctl [-dimv] [-f device] [command ...]

The sndioctl utility can display or change parameters of sndio(7) audio devices. The options are as follows:

Dump the raw list of available parameters and exit. Useful as a debugging tool.
device
Use this sndio(7) audio device.
Display characteristics of requested parameters instead of their values.
Monitor and display audio parameter changes.
Enable verbose mode, a.k.a. multi-channel mode. By default parameters affecting different channels of the same stream are disguised as a single mono parameter to hide details that are not essential.

If no commands are specified all valid parameters are displayed on . Unless -d, -m, or -i are used, displayed parameters are valid commands. The set of available controls depends on the control device.

Commands use the following two formats to display and set parameters respectively:

group/stream[channel].function
group/stream[channel].function=value

On the left-hand side are specified the optional parameter group, the affected stream name, and the optional channel number. Examples of left-hand side terms:

output.level
hw/spkr[6].mute

There are 4 parameter types: switches, numbers, selectors, and vectors.

Values are numbers between 0 and 1. Two-state controls (switches) take either 0 or 1 as value, typically corresponding to the and states respectively.

If a decimal is prefixed by the plus (minus) sign then the given value is added to (subtracted from) the current value of the control. If "!" is used instead of a number, then the switch is toggled. Examples:

hw/spkr.level=0.85
hw/spkr.level=+0.1
hw/spkr.mute=0
hw/spkr.mute=!

Selector values are substreams; they are specified as the stream name followed by an optional channel number. If no channel number is specified, the same number as the stream specified on the left-hand side is used. For instance the following are equivalent:

hw/record[1].source=mic
hw/record[1].source=mic1

Vectors are arrays of numbers. Values are specified as comma-separated components. Each component is a substream, followed by a colon, followed by a number. If the colon and the number are omitted, then 1 is assumed. If a component is missing, then 0 is assumed. Example:

hw/monitor.mix=play:0.12,linein:0.85
hw/record.source=mic,linein

Numbers are specified as discussed above. Note that a vector of switches is equivalent to a list.

The following will set all level parameters that control the spkr stream to zero:

$ sndioctl hw/spkr.level=0

The following commands are equivalent:

$ sndioctl hw/record[0].source=mic0 hw/record[1].source=mic1
$ sndioctl hw/record.source=mic

sioctl_open(3)

February 26, 2020 OpenBSD-current