freebsd-dev/usr.sbin/mixer/mixer.8

246 lines
5.9 KiB
Groff
Raw Normal View History

.\"-
.\" Copyright (c) 2021 Christos Margiolis <christos@FreeBSD.org>
1997-01-10 06:33:13 +00:00
.\"
.\" Permission is hereby granted, free of charge, to any person obtaining a copy
.\" of this software and associated documentation files (the "Software"), to deal
.\" in the Software without restriction, including without limitation the rights
.\" to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
.\" copies of the Software, and to permit persons to whom the Software is
.\" furnished to do so, subject to the following conditions:
1997-01-10 06:33:13 +00:00
.\"
.\" The above copyright notice and this permission notice shall be included in
.\" all copies or substantial portions of the Software.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
.\" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
.\" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
.\" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
.\" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
.\" OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
.\" THE SOFTWARE.
1997-01-10 06:33:13 +00:00
.\"
1999-08-28 01:35:59 +00:00
.\" $FreeBSD$
.\"
.Dd June 30, 2021
.Dt mixer 8
1997-01-10 06:33:13 +00:00
.Os
.Sh NAME
.Nm mixer
.Nd manipulate soundcard mixer controls
1997-01-10 06:33:13 +00:00
.Sh SYNOPSIS
.Nm
.Op Fl f Ar device
.Op Fl d Ar unit
.Op Fl os
.Op Ar dev Ns Op . Ns Ar control Ns Op = Ns Ar value
.Ar ...
.Nm
.Op Fl d Ar unit
.Op Fl os
.Fl a
1997-01-10 06:33:13 +00:00
.Sh DESCRIPTION
The
.Nm
utility is used to set and display soundcard mixer device controls.
.Pp
The options are as follows:
.Bl -tag -width "-f device"
.It Fl a
Print the values for all mixer devices available in the system (see FILES).
.It Fl d Ar unit
Change the default audio card to
.Ar unit .
The unit has to be an integer value. To see what unit values are available, look
at the number each mixer device has by running
.Nm .
.It Fl f Ar device
Open
.Ar device
as the mixer device (see FILES).
.It Fl o
Print mixer values in a format suitable for use inside scripts. The
mixer's header (name, audio card name, ...) will not be printed.
.It Fl s
Print only the recording source(s) of the mixer device.
.El
.Pp
The list of mixer devices that may be modified are:
.Bd -ragged -offset indent
vol, bass, treble, synth, pcm, speaker, line, mic, cd, mix,
pcm2, rec, igain, ogain, line1, line2, line3, dig1, dig2, dig3,
phin, phout, video, radio, and monitor.
.Ed
1997-01-10 06:33:13 +00:00
.Pp
Not all mixer devices are available.
1997-01-10 06:33:13 +00:00
.Pp
2003-06-15 08:46:36 +00:00
Without any arguments,
1997-01-10 06:33:13 +00:00
.Nm
displays all information for each one of the mixer's supported devices to
.Ar stdout .
1997-01-10 06:33:13 +00:00
If the
.Ar dev
2004-07-02 19:07:33 +00:00
argument is specified,
2003-06-15 08:46:36 +00:00
.Nm
displays only the values for
2003-06-15 08:46:36 +00:00
.Ar dev .
More than one device may be specified.
.Pp
Commands use the following format:
.Pp
.Bl -column xxxxxxxxxxxxxxxxxxxxxxxx -offset indent
.It Sy "Name Action"
.It "dev Display all controls"
.It "dev.control Display only the specified control"
.It "dev.control=value Set control value"
.El
.Pp
The available controls are as follows (replace
.Ar dev
with one of the available devices):
.Bl -column xxxxxxxxxxxxxxxxxxxxxxxx -offset indent
.It Sy "Name Value"
.It "dev.volume [[+|-]lvol[:[+|-]rvol]]"
.It "dev.mute {0|1|^}"
.It "dev.recsrc {+|-|^|=}"
.El
1997-01-10 06:33:13 +00:00
.Pp
The
.Ar dev.volume
control modifies a device's volume. The optional
.Ar lvol
and/or
.Ar rvol
values have to be specified. The values have to be normalized 32-bit floats,
from 0.0 to 1.0 inclusivly. If no "." character is present, the value is treated
like a percentage, for backwards compatibility.
If the the left or right volume values are prefixed with
.Cm +
or
.Cm - ,
the value following will be used as a relative adjustment, modifying the
current settings by the amount specified.
.Pp
The
.Ar dev.mute
control (un)mutes a device. The following values are available:
.Bl -tag -width = -offset indent
.It Cm 0
unmutes
.Ar dev .
.It Cm 1
mutes
.Ar dev .
.It Cm ^
toggles the mute of
.Ar dev .
.El
.Pp
The
.Ar dev.recsrc
control modifies the recording sources of a mixer.
.Nm
marks devices which can be used as a recording source with
.Ar rec .
Recording sources are marked with
.Ar src .
To modify the recording source you can use one of the following modifiers
on a
.Ar rec
device:
.Bl -tag -width = -offset indent
.It Cm ^
toggles
.Ar dev
of possible recording devices
.It Cm +
adds
.Ar dev
to possible recording devices
.It Cm -
removes
.Ar dev
from possible recording devices
.It Cm =
sets the recording device to
.Ar dev
.El
.Sh FILES
.Bl -tag -width /dev/mixerN -compact
.It Pa /dev/mixerN
The mixer device, where
.Ar N
is the number of that device, for example
.Ar /dev/mixer0 .
PCM cards and mixers have a 1:1 relationship, which means that
.Ar mixer0
is the mixer for
.Ar pcm0
and so on. By default,
.Nm
prints both the audio card's number and the mixer associated with it
in the form of
.Ar pcmN:mixer .
The
.Ar /dev/mixer
file, although it doesn't exist in the filesystem, points to the default
mixer device and is the file
.Nm
opens when the
.Fl f Ar device
option has not been specified.
.El
.Sh EXAMPLES
.Pp
Change the volume for the
.Ar vol
device of the
.Ar /dev/mixer0
mixer device to 0.65:
.Bl -tag -width Ds -offset indent
.It $ mixer -f /dev/mixer0 vol.volume=0.65
.El
.Pp
Increase the
.Ar mic
device's left volume by 0.10 and decrease the right
volume by 0.05:
.Bl -tag -width Ds -offset indent
.It $ mixer mic.volume=+0.10:-0.05
.El
.Pp
Toggle the mute for
.Ar vol :
.Bl -tag -width Ds -offset indent
.It $ mixer vol.mute=^
.El
.Pp
Set
.Ar mic
and toggle
.Ar line
recording sources:
.Bl -tag -width Ds -offset indent
.It $ mixer mic.recsrc=+ line.recsrc=^
.El
.Pp
Dump
.Ar /dev/mixer0
information to a file and retrieve back later
.Bl -tag -width Ds -offset indent
.It $ mixer -f /dev/mixer0 -o > info
.It ...
.It $ mixer -f /dev/mixer0 `cat info`
1999-11-27 16:55:50 +00:00
.El
1997-01-10 06:33:13 +00:00
.Sh SEE ALSO
.Xr mixer 3 ,
.Xr sound 4 ,
.Xr sysctl 8
1997-01-10 06:33:13 +00:00
.Sh HISTORY
The
.Nm
utility first appeared in FreeBSD 2.0.5 and was rewritten completely in
FreeBSD 12.2. \" FIXME: replace 12.2 with proper version.
1997-01-10 06:33:13 +00:00
.Sh AUTHORS
.An Christos Margiolis Aq Mt christos@margiolis.net