xref: /openbsd/usr.bin/sndioctl/sndioctl.1 (revision 09467b48)
1.\" $OpenBSD: sndioctl.1,v 1.14 2020/05/27 17:34:45 schwarze Exp $
2.\"
3.\" Copyright (c) 2014-2020 Alexandre Ratchov <alex@caoua.org>
4.\"
5.\" Permission to use, copy, modify, and distribute this software for any
6.\" purpose with or without fee is hereby granted, provided that the above
7.\" copyright notice and this permission notice appear in all copies.
8.\"
9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\"
17.Dd $Mdocdate: May 27 2020 $
18.Dt SNDIOCTL 1
19.Os
20.Sh NAME
21.Nm sndioctl
22.Nd manipulate audio device controls
23.Sh SYNOPSIS
24.Nm
25.Bk -words
26.Op Fl dimnqv
27.Op Fl f Ar device
28.Op Ar command ...
29.Ek
30.Sh DESCRIPTION
31The
32.Nm
33utility can display or manipulate controls of
34.Xr sndio 7
35audio devices, like the output level.
36The options are as follows:
37.Bl -tag -width Ds
38.It Fl d
39Dump the raw list of available controls and exit.
40Useful as a debugging tool.
41.It Fl f Ar device
42Use this
43.Xr sndio 7
44audio device.
45.It Fl i
46Display characteristics of requested controls
47instead of their values.
48.It Fl m
49Monitor and display audio controls changes.
50.It Fl n
51Suppress printing of the variable name.
52.It Fl q
53Suppress all printing when setting a variable.
54.It Fl v
55Enable verbose mode, a.k.a. multi-channel mode.
56By default controls affecting different channels
57of the same stream are disguised as a single mono
58control to hide details that are not essential.
59.El
60.Pp
61If no commands are specified all valid controls are displayed on
62.Em stdout .
63Unless
64.Fl d ,
65.Fl m ,
66.Fl n ,
67or
68.Fl i
69are used, displayed lines are valid commands.
70The set of available controls depends on the audio device.
71.Pp
72Commands use the following two formats to display and change
73controls respectively:
74.Pp
75.Dl group/stream[channel].function
76.Dl group/stream[channel].function=value
77.Pp
78On the left-hand side are specified the control group (if any),
79the affected stream name, and the optional channel number.
80Examples of left-hand side terms:
81.Pp
82.Dl output.level
83.Dl output[0].level
84.Pp
85If the channel number (including the brackets) is omitted,
86the command is applied to all channels.
87.Pp
88Values are numbers between 0 and 1.
89Two-state controls (switches) take either 0 or 1 as value,
90typically corresponding to the
91.Em off
92and
93.Em on
94states respectively.
95.Pp
96If a decimal is prefixed by the plus (minus) sign then
97the given value is added to (subtracted from) the
98current value of the control.
99If
100.Qq \&!
101is used instead of a number, then the switch is toggled.
102.Sh EXAMPLES
103Increase the
104.Cm level
105control affecting all
106.Cm output
107channels by 10% of the maximum:
108.Pp
109.Dl $ sndioctl output.level=+0.1
110.Pp
111Mute all
112.Cm output
113channels:
114.Pp
115.Dl $ sndioctl output.mute=1
116.Pp
117Toggle the above
118.Cm mute
119control:
120.Pp
121.Dl $ sndioctl output.mute=!
122.Pp
123Allow audio recording and set all
124.Cm input
125channels to 50%:
126.Bd -literal -offset indent
127# sysctl kern.audio.record=1
128$ sndioctl input.mute=0 input.level=0.5
129.Ed
130.Sh SEE ALSO
131.Xr sioctl_open 3
132