xref: /freebsd/usr.sbin/mixer/mixer.8 (revision 5bb3134a8c21cb87b30e135ef168483f0333dabb)
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
45The
46.Nm
47utility is used to set and display soundcard mixer device controls.
48.Pp
49The options are as follows:
50.Bl -tag -width "-f device"
51.It Fl a
52Print the values for all mixer devices available in the system (see FILES).
53.It Fl d Ar unit
54Change the default audio card to
55.Ar unit .
56The unit has to be an integer value. To see what unit values are available, look
57at the number each mixer device has by running
58.Nm .
59.It Fl f Ar device
60Open
61.Ar device
62as the mixer device (see FILES).
63.It Fl h
64Print a help message.
65.It Fl o
66Print mixer values in a format suitable for use inside scripts. The
67mixer's header (name, audio card name, ...) will not be printed.
68.It Fl s
69Print only the recording source(s) of the mixer device.
70.El
71.Pp
72The list of mixer devices that may be modified are:
73.Bd -ragged -offset indent
74vol, bass, treble, synth, pcm, speaker, line, mic, cd, mix,
75pcm2, rec, igain, ogain, line1, line2, line3, dig1, dig2, dig3,
76phin, phout, video, radio, and monitor.
77.Ed
78.Pp
79Not all mixer devices are available.
80.Pp
81Without any arguments,
82.Nm
83displays all information for each one of the mixer's supported devices to
84.Ar stdout .
85If the
86.Ar dev
87argument is specified,
88.Nm
89displays only the values for
90.Ar dev .
91More than one device may be specified.
92.Pp
93Commands 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
102The available controls are as follows (replace
103.Ar dev
104with 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
112The
113.Ar dev.volume
114control modifies a device's volume. The optional
115.Ar lvol
116and/or
117.Ar rvol
118values have to be specified. The values have to be normalized 32-bit floats,
119from 0.0 to 1.0 inclusivly. If no "." character is present, the value is treated
120like a percentage, for backwards compatibility.
121If the the left or right volume values are prefixed with
122.Cm +
123or
124.Cm - ,
125the value following will be used as a relative adjustment, modifying the
126current settings by the amount specified.
127.Pp
128The
129.Ar dev.mute
130control (un)mutes a device. The following values are available:
131.Bl -tag -width = -offset indent
132.It Cm 0
133unmutes
134.Ar dev .
135.It Cm 1
136mutes
137.Ar dev .
138.It Cm ^
139toggles the mute of
140.Ar dev .
141.El
142.Pp
143The
144.Ar dev.recsrc
145control modifies the recording sources of a mixer.
146.Nm
147marks devices which can be used as a recording source with
148.Ar rec .
149Recording sources are marked with
150.Ar src .
151To modify the recording source you can use one of the following modifiers
152on a
153.Ar rec
154device:
155.Bl -tag -width = -offset indent
156.It Cm ^
157toggles
158.Ar dev
159of possible recording devices
160.It Cm +
161adds
162.Ar dev
163to possible recording devices
164.It Cm -
165removes
166.Ar dev
167from possible recording devices
168.It Cm =
169sets the recording device to
170.Ar dev
171.El
172.Sh FILES
173.Bl -tag -width /dev/mixerN -compact
174.It Pa /dev/mixerN
175The mixer device, where
176.Ar N
177is the number of that device, for example
178.Ar /dev/mixer0 .
179PCM cards and mixers have a 1:1 relationship, which means that
180.Ar mixer0
181is the mixer for
182.Ar pcm0
183and so on. By default,
184.Nm
185prints both the audio card's number and the mixer associated with it
186in the form of
187.Ar pcmN:mixer .
188The
189.Ar /dev/mixer
190file, although it doesn't exist in the filesystem, points to the default
191mixer device and is the file
192.Nm
193opens when the
194.Fl f Ar device
195option has not been specified.
196.El
197.Sh EXAMPLES
198.Pp
199Change the volume for the
200.Ar vol
201device of the
202.Ar /dev/mixer0
203mixer 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
208Increase the
209.Ar mic
210device's left volume by 0.10 and decrease the right
211volume by 0.05:
212.Bl -tag -width Ds -offset indent
213.It $ mixer mic.volume=+0.10:-0.05
214.El
215.Pp
216Toggle the mute for
217.Ar vol :
218.Bl -tag -width Ds -offset indent
219.It $ mixer vol.mute=^
220.El
221.Pp
222Set
223.Ar mic
224and toggle
225.Ar line
226recording sources:
227.Bl -tag -width Ds -offset indent
228.It $ mixer mic.recsrc=+ line.recsrc=^
229.El
230.Pp
231Dump
232.Ar /dev/mixer0
233information 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
244The
245.Nm
246utility first appeared in FreeBSD 2.0.5 and was rewritten completely in
247FreeBSD 14.0.
248.Sh AUTHORS
249.An Christos Margiolis Aq Mt christos@FreeBSD.org
250