xref: /openbsd/usr.bin/mixerctl/mixerctl.8 (revision d415bd75)
1.\" $OpenBSD: mixerctl.8,v 1.7 2020/04/23 14:47:20 ratchov Exp $
2.\" $NetBSD: mixerctl.1,v 1.8 1998/05/09 12:41:16 augustss Exp $
3.\"
4.\" Copyright (c) 1997 The NetBSD Foundation, Inc.
5.\" All rights reserved.
6.\"
7.\" Author: Lennart Augustsson
8.\"
9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions
11.\" are met:
12.\" 1. Redistributions of source code must retain the above copyright
13.\"    notice, this list of conditions and the following disclaimer.
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\"    notice, this list of conditions and the following disclaimer in the
16.\"    documentation and/or other materials provided with the distribution.
17.\"
18.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28.\" POSSIBILITY OF SUCH DAMAGE.
29.\"
30.Dd $Mdocdate: April 23 2020 $
31.Dt MIXERCTL 8
32.Os
33.Sh NAME
34.Nm mixerctl
35.Nd manipulate controls for audio hardware
36.Sh SYNOPSIS
37.Nm mixerctl
38.Op Fl anv
39.Op Fl f Ar file
40.Nm mixerctl
41.Op Fl nv
42.Op Fl f Ar file
43.Ar name ...
44.Nm mixerctl
45.Op Fl qt
46.Op Fl f Ar file
47.Ar name ...
48.Nm mixerctl
49.Op Fl q
50.Op Fl f Ar file
51.Ar name Ns = Ns Ar value ...
52.Sh DESCRIPTION
53The
54.Nm
55command displays or sets various controls for audio hardware,
56such as microphone reference voltage or output level.
57Where hardware defaults are not the desired ones,
58controls can be set at system startup using the configuration file
59.Xr mixerctl.conf 5 .
60.Pp
61.Nm
62itself can only be run by the superuser.
63Common controls should be adjusted at runtime using
64.Xr sndioctl 1 ,
65which is intended for every day use and requires no superuser privileges.
66Manual use of
67.Nm
68is intended for controls which cannot be set using
69.Xr sndioctl 1 .
70.Pp
71If a list of control names is present on the command line,
72.Nm
73prints the current value of those controls for the specified device.
74.Pp
75The options are as follows:
76.Bl -tag -width "-f file"
77.It Fl a
78Print all device controls and their current values.
79This is the default, if no parameters are given to
80.Nm .
81.It Fl f Ar file
82Specify an alternative audio control device.
83The default is
84.Pa /dev/audioctl0 .
85.It Fl n
86Suppress printing of the control name.
87.It Fl q
88Suppress all printing when setting a control.
89.It Fl t
90Toggle.
91Attempt to select the next possible value
92of an enum
93(see below).
94.It Fl v
95Show all possible values of controls.
96Enum values are shown in
97.Sq []
98and values belonging to a set are shown in
99.Sq {}
100(see below).
101.It Ar name Ns = Ns Ar value
102Attempt to set the control with given
103.Ar name
104to
105.Ar value .
106.El
107.Pp
108The exact set of controls that can be manipulated depends on
109the device.
110The general format (in both getting and setting a value) is:
111.Pp
112.D1 class.name=value
113.Pp
114The
115.Ar class
116can have values like
117.Dq inputs
118or
119.Dq outputs ,
120indicating that the control affects the input or output, respectively,
121to the device.
122The
123.Ar name
124indicates what part of the device the control affects.
125Continuous values, e.g. volume,
126have numeric values in the range 0\-255.
127If
128.Ar value
129can be set for each channel independently,
130the values are printed separated by commas.
131Discrete values, e.g. the recording source,
132have symbolic names.
133.Pp
134Variables may take one of three types,
135again dependent on the mixer:
136.Bl -enum
137.It
138Enums.
139These may take only one out of a possible list of symbolic values
140or the literal string
141.Dq toggle ,
142which toggles the value,
143e.g. inputs.mic.source=mic0.
144.It
145Sets.
146These can take one or more of a possible list of symbolic values;
147multiple values are specified as a comma-separated list,
148e.g. record.source=mic,cd.
149Additionally,
150.Ar value
151may be omitted to specify the empty set,
152e.g. record.source=.
153.It
154Numbers.
155Numerical values may be specified in either absolute or relative forms.
156The relative form is indicated by a prefix of
157.Ql +
158or
159.Ql -
160to denote an increase or decrease, respectively.
161.El
162.Sh ENVIRONMENT
163.Bl -tag -width "MIXERDEVICEXXX"
164.It Ev MIXERDEVICE
165The audio control device to use.
166.El
167.Sh FILES
168.Bl -tag -width "/etc/mixerctl.confXXX" -compact
169.It Pa /dev/audioctl0
170Default audio control device.
171.It Pa /etc/mixerctl.conf
172.Nm
173configuration file.
174.El
175.Sh EXAMPLES
176Show possible values for all controls,
177and their current settings:
178.Bd -literal -offset indent
179# mixerctl -av
180inputs.mic=0,0 volume
181inputs.mic.mute=off  [ off on ]
182inputs.cd=220,220 volume
183inputs.cd.mute=off  [ off on ]
184inputs.dac=220,220 volume
185inputs.dac.mute=off  [ off on ]
186record.record=220,220 volume
187record.record.source=mic  [ mic cd dac ]
188monitor.monitor=0 volume
189.Ed
190.Pp
191Toggle inputs.dac.mute:
192.Bd -literal -offset indent
193# mixerctl -t inputs.dac.mute
194inputs.dac.mute: off -> on
195# mixerctl inputs.dac.mute=toggle
196inputs.dac.mute: on -> off
197.Ed
198.Sh SEE ALSO
199.Xr aucat 1 ,
200.Xr cdio 1 ,
201.Xr audio 4 ,
202.Xr mixerctl.conf 5 ,
203.Xr audioctl 8 ,
204.Xr sysctl 8
205.Sh HISTORY
206The
207.Nm
208command first appeared in
209.Ox 2.4 .
210