Annotation of src/usr.bin/sndioctl/sndioctl.1, Revision 1.6
1.6 ! ratchov 1: .\" $OpenBSD: sndioctl.1,v 1.5 2020/04/16 09:07:24 ratchov Exp $
1.1 ratchov 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: .\"
1.6 ! ratchov 17: .Dd $Mdocdate: April 16 2020 $
1.1 ratchov 18: .Dt SNDIOCTL 1
19: .Os
20: .Sh NAME
21: .Nm sndioctl
22: .Nd control audio parameters
23: .Sh SYNOPSIS
24: .Nm
25: .Bk -words
1.6 ! ratchov 26: .Op Fl dimnqv
1.1 ratchov 27: .Op Fl f Ar device
28: .Op Ar command ...
29: .Ek
30: .Sh DESCRIPTION
31: The
32: .Nm
33: utility can display or change parameters of
34: .Xr sndio 7
35: audio devices.
36: The options are as follows:
37: .Bl -tag -width Ds
38: .It Fl d
39: Dump the raw list of available parameters and exit.
40: Useful as a debugging tool.
41: .It Fl f Ar device
42: Use this
43: .Xr sndio 7
44: audio device.
45: .It Fl i
46: Display characteristics of requested parameters
47: instead of their values.
48: .It Fl m
49: Monitor and display audio parameter changes.
1.5 ratchov 50: .It Fl n
51: Suppress printing of the variable name.
1.6 ! ratchov 52: .It Fl q
! 53: Suppress all printing when setting a variable.
1.1 ratchov 54: .It Fl v
55: Enable verbose mode, a.k.a. multi-channel mode.
56: By default parameters affecting different channels
57: of the same stream are disguised as a single mono
58: parameter to hide details that are not essential.
59: .El
60: .Pp
61: If no commands are specified all valid parameters are displayed on
62: .Em stdout .
63: Unless
64: .Fl d ,
65: .Fl m ,
1.5 ratchov 66: .Fl n ,
1.1 ratchov 67: or
68: .Fl i
69: are used, displayed parameters are valid commands.
70: The set of available controls depends on the control device.
71: .Pp
72: Commands use the following two formats to display and set
73: parameters respectively:
74: .Pp
75: .Dl group/stream[channel].function
76: .Dl group/stream[channel].function=value
77: .Pp
78: On the left-hand side are specified the optional parameter group,
79: the affected stream name, and the optional channel number.
80: Examples of left-hand side terms:
81: .Pp
82: .Dl output.level
83: .Dl hw/spkr[6].mute
84: .Pp
85: There are 4 parameter types: switches, numbers, selectors, and vectors.
86: .Pp
1.4 ratchov 87: Values are numbers between 0 and 1.
1.1 ratchov 88: Two-state controls (switches) take either 0 or 1 as value,
89: typically corresponding to the
90: .Em off
91: and
92: .Em on
93: states respectively.
94: .Pp
95: If a decimal is prefixed by the plus (minus) sign then
96: the given value is added to (subtracted from) the
97: current value of the control.
98: If
99: .Qq \&!
100: is used instead of a number, then the switch is toggled.
101: Examples:
102: .Pp
1.4 ratchov 103: .Dl hw/spkr.level=0.85
104: .Dl hw/spkr.level=+0.1
1.1 ratchov 105: .Dl hw/spkr.mute=0
106: .Dl hw/spkr.mute=!
107: .Pp
108: Selector values are substreams; they are specified
109: as the stream name followed by an optional channel
110: number.
111: If no channel number is specified, the same
112: number as the stream specified on the left-hand side is used.
113: For instance the following are equivalent:
114: .Pp
115: .Dl hw/record[1].source=mic
116: .Dl hw/record[1].source=mic1
117: .Pp
118: Vectors are arrays of numbers.
119: Values are specified as comma-separated components.
120: Each component is a substream, followed by
121: a colon, followed by a number.
1.4 ratchov 122: If the colon and the number are omitted, then 1 is assumed.
1.1 ratchov 123: If a component is missing, then 0 is assumed.
124: Example:
125: .Pp
1.4 ratchov 126: .Dl hw/monitor.mix=play:0.12,linein:0.85
1.1 ratchov 127: .Dl hw/record.source=mic,linein
128: .Pp
129: Numbers are specified as discussed above.
130: Note that a vector of switches is equivalent to
131: a list.
132: .Sh EXAMPLES
133: The following will set all
134: .Ar level
135: parameters that control the
136: .Ar spkr
1.3 ratchov 137: stream to zero:
1.1 ratchov 138: .Pp
139: .Dl $ sndioctl hw/spkr.level=0
140: .Pp
141: The following commands are equivalent:
142: .Pp
143: .Dl $ sndioctl hw/record[0].source=mic0 hw/record[1].source=mic1
144: .Dl $ sndioctl hw/record.source=mic
145: .Sh SEE ALSO
146: .Xr sioctl_open 3