]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.sbin/mixer/mixer.8
mixer: make .Dt tags uppercase
[FreeBSD/FreeBSD.git] / usr.sbin / mixer / mixer.8
1 .\"-
2 .\" Copyright (c) 2021 Christos Margiolis <christos@FreeBSD.org>
3 .\"
4 .\" Permission is hereby granted, free of charge, to any person obtaining a copy
5 .\" of this software and associated documentation files (the "Software"), to deal
6 .\" in the Software without restriction, including without limitation the rights
7 .\" to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 .\" copies of the Software, and to permit persons to whom the Software is
9 .\" furnished to do so, subject to the following conditions:
10 .\"
11 .\" The above copyright notice and this permission notice shall be included in
12 .\" all copies or substantial portions of the Software.
13 .\"
14 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 .\" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 .\" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 .\" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 .\" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 .\" OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 .\" THE SOFTWARE.
21 .\"
22 .\" $FreeBSD$
23 .\"
24
25 .Dd October 17, 2021
26 .Dt MIXER 8
27 .Os
28 .Sh NAME
29 .Nm mixer
30 .Nd manipulate soundcard mixer controls
31 .Sh SYNOPSIS
32 .Nm
33 .Op Fl f Ar device
34 .Op Fl d Ar unit
35 .Op Fl os
36 .Op Ar dev Ns Op . Ns Ar control Ns Op = Ns Ar value
37 .Ar ...
38 .Nm
39 .Op Fl d Ar unit
40 .Op Fl os
41 .Fl a
42 .Nm
43 .Fl h
44 .Sh DESCRIPTION
45 The
46 .Nm
47 utility is used to set and display soundcard mixer device controls.
48 .Pp
49 The options are as follows:
50 .Bl -tag -width "-f device"
51 .It Fl a
52 Print the values for all mixer devices available in the system (see FILES).
53 .It Fl d Ar unit
54 Change the default audio card to
55 .Ar unit .
56 The unit has to be an integer value. To see what unit values are available, look
57 at the number each mixer device has by running
58 .Nm .
59 .It Fl f Ar device
60 Open
61 .Ar device
62 as the mixer device (see FILES).
63 .It Fl h
64 Print a help message.
65 .It Fl o
66 Print mixer values in a format suitable for use inside scripts. The
67 mixer's header (name, audio card name, ...) will not be printed.
68 .It Fl s
69 Print only the recording source(s) of the mixer device.
70 .El
71 .Pp
72 The list of mixer devices that may be modified are:
73 .Bd -ragged -offset indent
74 vol, bass, treble, synth, pcm, speaker, line, mic, cd, mix,
75 pcm2, rec, igain, ogain, line1, line2, line3, dig1, dig2, dig3,
76 phin, phout, video, radio, and monitor.
77 .Ed
78 .Pp
79 Not all mixer devices are available.
80 .Pp
81 Without any arguments,
82 .Nm
83 displays all information for each one of the mixer's supported devices to
84 .Ar stdout .
85 If the
86 .Ar dev
87 argument is specified,
88 .Nm
89 displays only the values for
90 .Ar dev .
91 More than one device may be specified.
92 .Pp
93 Commands use the following format:
94 .Pp
95 .Bl -column xxxxxxxxxxxxxxxxxxxxxxxx -offset indent
96 .It Sy "Name    Action"
97 .It "dev        Display all controls"
98 .It "dev.control        Display only the specified control"
99 .It "dev.control=value  Set control value"
100 .El
101 .Pp
102 The available controls are as follows (replace
103 .Ar dev
104 with one of the available devices):
105 .Bl -column xxxxxxxxxxxxxxxxxxxxxxxx -offset indent
106 .It Sy "Name    Value"
107 .It "dev.volume [[+|-]lvol[:[+|-]rvol]]"
108 .It "dev.mute   {0|1|^}"
109 .It "dev.recsrc {+|-|^|=}"
110 .El
111 .Pp
112 The
113 .Ar dev.volume
114 control modifies a device's volume. The optional
115 .Ar lvol
116 and/or
117 .Ar rvol
118 values have to be specified. The values have to be normalized 32-bit floats,
119 from 0.0 to 1.0 inclusivly. If no "." character is present, the value is treated
120 like a percentage, for backwards compatibility.
121 If the the left or right volume values are prefixed with
122 .Cm +
123 or
124 .Cm - ,
125 the value following will be used as a relative adjustment, modifying the
126 current settings by the amount specified.
127 .Pp
128 The
129 .Ar dev.mute
130 control (un)mutes a device. The following values are available:
131 .Bl -tag -width = -offset indent
132 .It Cm 0
133 unmutes
134 .Ar dev .
135 .It Cm 1
136 mutes
137 .Ar dev .
138 .It Cm ^
139 toggles the mute of
140 .Ar dev .
141 .El
142 .Pp
143 The
144 .Ar dev.recsrc
145 control modifies the recording sources of a mixer.
146 .Nm
147 marks devices which can be used as a recording source with
148 .Ar rec .
149 Recording sources are marked with
150 .Ar src .
151 To modify the recording source you can use one of the following modifiers
152 on a
153 .Ar rec
154 device:
155 .Bl -tag -width = -offset indent
156 .It Cm ^
157 toggles
158 .Ar dev
159 of possible recording devices
160 .It Cm +
161 adds
162 .Ar dev
163 to possible recording devices
164 .It Cm -
165 removes
166 .Ar dev
167 from possible recording devices
168 .It Cm =
169 sets the recording device to
170 .Ar dev
171 .El
172 .Sh FILES
173 .Bl -tag -width /dev/mixerN -compact
174 .It Pa /dev/mixerN
175 The mixer device, where
176 .Ar N
177 is the number of that device, for example
178 .Ar /dev/mixer0 .
179 PCM cards and mixers have a 1:1 relationship, which means that
180 .Ar mixer0
181 is the mixer for
182 .Ar pcm0
183 and so on. By default,
184 .Nm
185 prints both the audio card's number and the mixer associated with it
186 in the form of
187 .Ar pcmN:mixer .
188 The
189 .Ar /dev/mixer
190 file, although it doesn't exist in the filesystem, points to the default
191 mixer device and is the file
192 .Nm
193 opens when the
194 .Fl f Ar device
195 option has not been specified.
196 .El
197 .Sh EXAMPLES
198 .Pp
199 Change the volume for the
200 .Ar vol
201 device of the
202 .Ar /dev/mixer0
203 mixer device to 0.65:
204 .Bl -tag -width Ds -offset indent
205 .It $ mixer -f /dev/mixer0 vol.volume=0.65
206 .El
207 .Pp
208 Increase the
209 .Ar mic
210 device's left volume by 0.10 and decrease the right
211 volume by 0.05:
212 .Bl -tag -width Ds -offset indent
213 .It $ mixer mic.volume=+0.10:-0.05
214 .El
215 .Pp
216 Toggle the mute for
217 .Ar vol :
218 .Bl -tag -width Ds -offset indent
219 .It $ mixer vol.mute=^
220 .El
221 .Pp
222 Set
223 .Ar mic
224 and toggle
225 .Ar line
226 recording sources:
227 .Bl -tag -width Ds -offset indent
228 .It $ mixer mic.recsrc=+ line.recsrc=^
229 .El
230 .Pp
231 Dump
232 .Ar /dev/mixer0
233 information to a file and retrieve back later
234 .Bl -tag -width Ds -offset indent
235 .It $ mixer -f /dev/mixer0 -o > info
236 .It ...
237 .It $ mixer -f /dev/mixer0 `cat info`
238 .El
239 .Sh SEE ALSO
240 .Xr mixer 3 ,
241 .Xr sound 4 ,
242 .Xr sysctl 8
243 .Sh HISTORY
244 The
245 .Nm
246 utility first appeared in FreeBSD 2.0.5 and was rewritten completely in
247 FreeBSD 14.0.
248 .Sh AUTHORS
249 .An Christos Margiolis Aq Mt christos@FreeBSD.org