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