mixer

FreeBSD OSS mixer library implementation and a complete rewrite of mixer(8)
git clone git://git.margiolis.net/mixer.git
Log | Files | Refs | README | LICENSE

mixer.8 (5998B)


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