summaryrefslogtreecommitdiff
path: root/usr.bin/sndioctl/sndioctl.1
blob: 0808e5be9005dd2d79a925b2de75ea81c701a3e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
.\" $OpenBSD: sndioctl.1,v 1.4 2020/02/26 15:36:27 ratchov Exp $
.\"
.\" 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: February 26 2020 $
.Dt SNDIOCTL 1
.Os
.Sh NAME
.Nm sndioctl
.Nd control audio parameters
.Sh SYNOPSIS
.Nm
.Bk -words
.Op Fl dimv
.Op Fl f Ar device
.Op Ar command ...
.Ek
.Sh DESCRIPTION
The
.Nm
utility can display or change parameters of
.Xr sndio 7
audio devices.
The options are as follows:
.Bl -tag -width Ds
.It Fl d
Dump the raw list of available parameters 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 parameters
instead of their values.
.It Fl m
Monitor and display audio parameter changes.
.It Fl v
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.
.El
.Pp
If no commands are specified all valid parameters are displayed on
.Em stdout .
Unless
.Fl d ,
.Fl m ,
or
.Fl i
are used, displayed parameters are valid commands.
The set of available controls depends on the control device.
.Pp
Commands use the following two formats to display and set
parameters respectively:
.Pp
.Dl group/stream[channel].function
.Dl group/stream[channel].function=value
.Pp
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:
.Pp
.Dl output.level
.Dl hw/spkr[6].mute
.Pp
There are 4 parameter types: switches, numbers, selectors, and vectors.
.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.
Examples:
.Pp
.Dl hw/spkr.level=0.85
.Dl hw/spkr.level=+0.1
.Dl hw/spkr.mute=0
.Dl hw/spkr.mute=!
.Pp
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:
.Pp
.Dl hw/record[1].source=mic
.Dl hw/record[1].source=mic1
.Pp
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:
.Pp
.Dl hw/monitor.mix=play:0.12,linein:0.85
.Dl hw/record.source=mic,linein
.Pp
Numbers are specified as discussed above.
Note that a vector of switches is equivalent to
a list.
.Sh EXAMPLES
The following will set all
.Ar level
parameters that control the
.Ar spkr
stream to zero:
.Pp
.Dl $ sndioctl hw/spkr.level=0
.Pp
The following commands are equivalent:
.Pp
.Dl $ sndioctl hw/record[0].source=mic0 hw/record[1].source=mic1
.Dl $ sndioctl hw/record.source=mic
.Sh SEE ALSO
.Xr sioctl_open 3