sndio/sndioctl/sndioctl.1

132 lines
3.2 KiB
Groff

.\" $OpenBSD$
.\"
.\" Copyright (c) 2014-2020 Alexandre Ratchov <alex@caoua.org>
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.Dd $Mdocdate$
.Dt SNDIOCTL 1
.Os
.Sh NAME
.Nm sndioctl
.Nd manipulate audio device controls
.Sh SYNOPSIS
.Nm
.Bk -words
.Op Fl dimnqv
.Op Fl f Ar device
.Op Ar command ...
.Ek
.Sh DESCRIPTION
The
.Nm
utility can display or manipulate controls of
.Xr sndio 7
audio devices, like the output level.
The options are as follows:
.Bl -tag -width Ds
.It Fl d
Dump the raw list of available controls and exit.
Useful as a debugging tool.
.It Fl f Ar device
Use this
.Xr sndio 7
audio device.
.It Fl i
Display characteristics of requested controls
instead of their values.
.It Fl m
Monitor and display audio controls changes.
.It Fl n
Suppress printing of the variable name.
.It Fl q
Suppress all printing when setting a variable.
.It Fl v
Enable verbose mode, a.k.a. multi-channel mode.
By default controls affecting different channels
of the same stream are disguised as a single mono
control to hide details that are not essential.
.El
.Pp
If no commands are specified all valid controls are displayed on
.Em stdout .
Unless
.Fl d ,
.Fl m ,
.Fl n ,
or
.Fl i
are used, displayed lines are valid commands.
The set of available controls depends on the audio device.
.Pp
Commands use the following two formats to display and change
controls respectively:
.Pp
.Dl [group/]stream[channel].function
.Dl [group/]stream[channel].function=value
.Pp
On the left-hand side are specified the control group (if any),
the affected stream name, and the optional channel number.
Examples of left-hand side terms:
.Pp
.Dl output.level
.Dl output[0].level
.Pp
If the channel number (including the brackets) is omitted,
the command is applied to all channels.
.Pp
Values are numbers between 0 and 1.
Two-state controls (switches) take either 0 or 1 as value,
typically corresponding to the
.Em off
and
.Em on
states respectively.
.Pp
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
.Qq \&!
is used instead of a number, then the switch is toggled.
.Sh EXAMPLES
Increase the
.Cm level
control affecting all
.Cm output
channels by 10% of the maximum:
.Pp
.Dl $ sndioctl output.level=+0.1
.Pp
Mute all
.Cm output
channels:
.Pp
.Dl $ sndioctl output.mute=1
.Pp
Toggle the above
.Cm mute
control:
.Pp
.Dl $ sndioctl output.mute=!
.Pp
Allow audio recording and set all
.Cm input
channels to 50%:
.Bd -literal -offset indent
# sysctl kern.audio.record=1
$ sndioctl input.mute=0 input.level=0.5
.Ed
.Sh SEE ALSO
.Xr sioctl_open 3