Changeset View
Changeset View
Standalone View
Standalone View
usr.sbin/mixer/mixer.8
Show All 15 Lines | |||||
.\" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | .\" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||||
.\" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | .\" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||||
.\" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | .\" 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 | .\" OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||||
.\" THE SOFTWARE. | .\" THE SOFTWARE. | ||||
.\" | .\" | ||||
.\" $FreeBSD$ | .\" $FreeBSD$ | ||||
.\" | .\" | ||||
.Dd March 13, 2022 | .Dd March 18, 2022 | ||||
.Dt MIXER 8 | .Dt MIXER 8 | ||||
.Os | .Os | ||||
.Sh NAME | .Sh NAME | ||||
.Nm mixer | .Nm mixer | ||||
.Nd manipulate soundcard mixer controls | .Nd manipulate soundcard mixer controls | ||||
.Sh SYNOPSIS | .Sh SYNOPSIS | ||||
.Nm | .Nm | ||||
.Op Fl f Ar device | .Op Fl f Ar device | ||||
.Op Fl d Ar unit | .Op Fl d Ar unit | ||||
.Op Fl os | .Op Fl os | ||||
.Op Ar dev Ns Op Cm \&. Ns Ar control Ns Op Cm \&= Ns Ar value | .Op Ar dev Ns Op . Ns Ar control Ns Op = Ns Ar value | ||||
.Ar ... | .Ar ... | ||||
.Nm | .Nm | ||||
.Op Fl d Ar unit | .Op Fl d Ar unit | ||||
.Op Fl os | .Op Fl os | ||||
.Fl a | .Fl a | ||||
.Nm | .Nm | ||||
.Fl h | .Fl h | ||||
.Sh DESCRIPTION | .Sh DESCRIPTION | ||||
The | The | ||||
.Nm | .Nm | ||||
utility is used to set and display soundcard mixer device controls. | utility is used to set and display soundcard mixer device controls. | ||||
.Pp | .Pp | ||||
The options are as follows: | The options are as follows: | ||||
.Bl -tag -width "-f device" | .Bl -tag -width "-f device" | ||||
.It Fl a | .It Fl a | ||||
Print the values for all mixer devices available in the system | Print the values for all mixer devices available in the system (see FILES). | ||||
.Pq see Sx FILES . | |||||
.It Fl d Ar unit | .It Fl d Ar unit | ||||
Change the default audio card to | Change the default audio card to | ||||
.Ar unit . | .Ar unit . | ||||
The unit has to be an integer value. | The unit has to be an integer value. | ||||
To see what unit values are available, look | To see what unit values are available, look at the number each mixer device has by running | ||||
at the number each mixer device has by running | |||||
.Nm . | .Nm . | ||||
.It Fl f Ar device | .It Fl f Ar device | ||||
Open | Open | ||||
.Ar device | .Ar device | ||||
as the mixer device | as the mixer device (see FILES). | ||||
.Pq see Sx FILES . | |||||
.It Fl h | .It Fl h | ||||
Print a help message. | Print a help message to stderr. | ||||
.It Fl o | .It Fl o | ||||
Print mixer values in a format suitable for use inside scripts. | Print mixer values in a format suitable for use inside scripts. | ||||
The mixer's header (name, audio card name, ...) will not be printed. | The mixer's header (name, audio card name, ...) will not be printed. | ||||
.It Fl s | .It Fl s | ||||
Print only the recording source(s) of the mixer device. | Print only the recording source(s) of the mixer device. | ||||
.El | .El | ||||
.Pp | .Pp | ||||
The list of mixer devices that may be modified are: | The list of mixer devices that may be modified are: | ||||
.Bd -ragged -offset indent | .Bd -ragged -offset indent | ||||
.Cm vol , bass , treble , synth , pcm , speaker , line , mic , cd , mix , | vol, bass, treble, synth, pcm, speaker, line, mic, cd, mix, | ||||
.Cm pcm2 , rec , | pcm2, rec, igain, ogain, line1, line2, line3, dig1, dig2, dig3, | ||||
.Cm igain , ogain , | phin, phout, video, radio, and monitor. | ||||
.Cm line1 , line2 , line3 , | |||||
.Cm dig1 , dig2 , dig3 , | |||||
.Cm phin , phout , video , radio , | |||||
and | |||||
.Cm monitor . | |||||
.Ed | .Ed | ||||
.Pp | .Pp | ||||
Not all mixer devices are available. | Not all mixer devices are available. | ||||
.Pp | .Pp | ||||
Without any arguments, | Without any arguments, | ||||
.Nm | .Nm | ||||
displays all information for each one of the mixer's supported devices to | displays all information for each one of the mixer's supported devices to | ||||
.Ar stdout . | .Ar stdout . | ||||
If the | If the | ||||
.Ar dev | .Ar dev | ||||
argument is specified, | argument is specified, | ||||
.Nm | .Nm | ||||
displays only the values for | displays only the values for | ||||
.Ar dev . | .Ar dev . | ||||
More than one device may be specified. | More than one device may be specified. | ||||
.Pp | .Pp | ||||
Commands use the following format: | Commands use the following format: | ||||
.Bl -column xxxxxxxxxxxxxxxxxxxxxxxx -offset indent | .Bl -column xxxxxxxxxxxxxxxxxxxxxxxx -offset indent | ||||
.It Sy Name Ta Sy Action | .It Sy "Name Action" | ||||
.It Ar dev Ta Display all controls | .It "dev Display all controls" | ||||
.It Ar dev Ns Cm \&. Ns Ar control Ta Display only the specified control | .It "dev.control Display only the specified control" | ||||
.It Ar dev Ns Cm \&. Ns Ar control Ns Cm \&= Ns Ar value Ta Set control value | .It "dev.control=value Set control value" | ||||
.El | .El | ||||
.Pp | .Pp | ||||
The available controls are as follows (replace | The available controls are as follows (replace | ||||
.Ar dev | .Ar dev | ||||
with one of the available devices): | with one of the available devices): | ||||
.Sm off | |||||
.Bl -column xxxxxxxxxxxxxxxxxxxxxxxx -offset indent | .Bl -column xxxxxxxxxxxxxxxxxxxxxxxx -offset indent | ||||
.It Sy Name Ta Sy Value | .It Sy "Name Value" | ||||
.It Ar dev Cm .volume Ta Xo | .It "dev.volume [[+|-]lvol[:[+|-]rvol]]" | ||||
.Ar vol | | .It "dev.mute {0|1|^}" | ||||
.Oo Cm \&+ | Cm \&- Oc Ar lvol | .It "dev.recsrc {+|-|^|=}" | ||||
.Oo Cm \&: Oo Cm \&+ | Cm \&- Oc Ar rvol Oc | |||||
.Xc | |||||
.It Ar dev Cm .mute Ta Cm 0 | 1 | ^ | |||||
.It Ar dev Cm .recsrc Ta Cm ^ | + | - | = | |||||
.El | .El | ||||
.Sm on | |||||
.Pp | .Pp | ||||
The | The | ||||
.Ar dev Ns Cm .volume | .Ar dev.volume | ||||
control modifies a device's volume. | control modifies a device's volume. | ||||
The optional | The optional | ||||
.Ar lvol | .Ar lvol | ||||
and/or | and/or | ||||
.Ar rvol | .Ar rvol | ||||
values have to be specified. | values have to be specified. | ||||
The values have to be normalized 32-bit floats, | The values have to be normalized 32-bit floats, from 0.0 to 1.0 inclusivly. | ||||
from 0.0 to 1.0 inclusivly. | If no "." character is present, the value is treated like a percentage, for backwards compatibility. | ||||
If no | If the the left or right volume values are prefixed with | ||||
.Ql \&. | |||||
character is present, the value is treated | |||||
like a percentage, for backwards compatibility. | |||||
If the left or right volume values are prefixed with | |||||
.Cm + | .Cm + | ||||
or | or | ||||
.Cm - , | .Cm - , | ||||
the value following will be used as a relative adjustment, modifying the | the value following will be used as a relative adjustment, modifying the | ||||
current settings by the amount specified. | current settings by the amount specified. | ||||
.Pp | .Pp | ||||
The | The | ||||
.Ar dev Ns Cm .mute | .Ar dev.mute | ||||
control (un)mutes a device. | control (un)mutes a device. | ||||
The following values are available: | The following values are available: | ||||
.Bl -tag -width = -offset indent | .Bl -tag -width = -offset indent | ||||
.It Cm 0 | .It Cm 0 | ||||
unmutes | unmutes | ||||
.Ar dev | .Ar dev . | ||||
.It Cm 1 | .It Cm 1 | ||||
mutes | mutes | ||||
.Ar dev | .Ar dev . | ||||
.It Cm ^ | .It Cm ^ | ||||
toggles the mute of | toggles the mute of | ||||
.Ar dev | .Ar dev . | ||||
.El | .El | ||||
.Pp | .Pp | ||||
The | The | ||||
.Ar dev Ns Cm .recsrc | .Ar dev.recsrc | ||||
control modifies the recording sources of a mixer. | control modifies the recording sources of a mixer. | ||||
.Nm | .Nm | ||||
marks devices which can be used as a recording source with | marks devices which can be used as a recording source with | ||||
.Sy rec . | .Ar rec . | ||||
Recording sources are marked with | Recording sources are marked with | ||||
.Sy src . | .Ar src . | ||||
To modify the recording source you can use one of the following modifiers | To modify the recording source you can use one of the following modifiers | ||||
on a | on a | ||||
.Sy rec | .Ar rec | ||||
device: | device: | ||||
.Bl -tag -width = -offset indent | .Bl -tag -width = -offset indent | ||||
.It Cm ^ | .It Cm ^ | ||||
toggles | toggles | ||||
.Ar dev | .Ar dev | ||||
of possible recording devices | of possible recording devices | ||||
.It Cm + | .It Cm + | ||||
adds | adds | ||||
Show All 10 Lines | |||||
.Sh FILES | .Sh FILES | ||||
.Bl -tag -width /dev/mixerN -compact | .Bl -tag -width /dev/mixerN -compact | ||||
.It Pa /dev/mixerN | .It Pa /dev/mixerN | ||||
The mixer device, where | The mixer device, where | ||||
.Ar N | .Ar N | ||||
is the number of that device, for example | is the number of that device, for example | ||||
.Ar /dev/mixer0 . | .Ar /dev/mixer0 . | ||||
PCM cards and mixers have a 1:1 relationship, which means that | PCM cards and mixers have a 1:1 relationship, which means that | ||||
.Pa /dev/mixer0 | .Ar mixer0 | ||||
is the mixer for | is the mixer for | ||||
.Pa /dev/pcm0 | .Ar pcm0 | ||||
and so on. | and so on. | ||||
By default, | By default, | ||||
.Nm | .Nm | ||||
prints both the audio card's number and the mixer associated with it | prints both the audio card's number and the mixer associated with it | ||||
in the form of | in the form of | ||||
.Ar pcmN:mixer . | .Ar pcmN:mixer . | ||||
The | The | ||||
.Pa /dev/mixer | .Ar /dev/mixer | ||||
file, although it does not exist in the filesystem, points to the default | file, although it doesn't exist in the filesystem, points to the default | ||||
mixer device and is the file | mixer device and is the file | ||||
.Nm | .Nm | ||||
opens when the | opens when the | ||||
.Fl f Ar device | .Fl f Ar device | ||||
option has not been specified. | option has not been specified. | ||||
.El | .El | ||||
.Sh EXAMPLES | .Sh EXAMPLES | ||||
Change the volume for the | Change the volume for the | ||||
.Cm vol | .Ar vol | ||||
device of the | device of the | ||||
.Pa /dev/mixer0 | .Ar /dev/mixer0 | ||||
mixer device to 0.65: | mixer device to 0.65: | ||||
.Bd -literal -offset indent | .Bl -tag -width Ds -offset indent | ||||
$ mixer -f /dev/mixer0 vol.volume=0.65 | .It $ mixer -f /dev/mixer0 vol.volume=0.65 | ||||
.Ed | .El | ||||
.Pp | .Pp | ||||
Increase the | Increase the | ||||
.Cm mic | .Ar mic | ||||
device's left volume by 0.10 and decrease the right | device's left volume by 0.10 and decrease the right | ||||
volume by 0.05: | volume by 0.05: | ||||
.Bd -literal -offset indent | .Bl -tag -width Ds -offset indent | ||||
$ mixer mic.volume=+0.10:-0.05 | .It $ mixer mic.volume=+0.10:-0.05 | ||||
.Ed | .El | ||||
.Pp | .Pp | ||||
Toggle the mute for | Toggle the mute for | ||||
.Cm vol : | .Ar vol : | ||||
.Bd -literal -offset indent | .Bl -tag -width Ds -offset indent | ||||
$ mixer vol.mute=^ | .It $ mixer vol.mute=^ | ||||
.Ed | .El | ||||
.Pp | .Pp | ||||
Set | Set | ||||
.Cm mic | .Ar mic | ||||
and toggle | and toggle | ||||
.Cm line | .Ar line | ||||
recording sources: | recording sources: | ||||
.Bd -literal -offset indent | .Bl -tag -width Ds -offset indent | ||||
$ mixer mic.recsrc=+ line.recsrc=^ | .It $ mixer mic.recsrc=+ line.recsrc=^ | ||||
.Ed | .El | ||||
.Pp | .Pp | ||||
Dump | Dump | ||||
.Pa /dev/mixer0 | .Ar /dev/mixer0 | ||||
information to a file and retrieve back later: | information to a file and retrieve back later | ||||
.Bd -literal -offset indent | .Bl -tag -width Ds -offset indent | ||||
$ mixer -f /dev/mixer0 -o > info | .It $ mixer -f /dev/mixer0 -o > info | ||||
\&... | .It ... | ||||
$ mixer -f /dev/mixer0 `cat info` | .It $ mixer -f /dev/mixer0 `cat info` | ||||
.Ed | .El | ||||
.Sh SEE ALSO | .Sh SEE ALSO | ||||
.Xr mixer 3 , | .Xr mixer 3 , | ||||
.Xr sound 4 , | .Xr sound 4 , | ||||
.Xr sysctl 8 | .Xr sysctl 8 | ||||
.Sh HISTORY | .Sh HISTORY | ||||
The | The | ||||
.Nm | .Nm | ||||
utility first appeared in | utility first appeared in | ||||
.Fx 2.0.5 | .Fx 2.0.5 | ||||
and was rewritten completely in | and was rewritten completely in | ||||
.Fx 14.0 . | .Fx 14.0 . | ||||
.Sh AUTHORS | .Sh AUTHORS | ||||
.An Christos Margiolis Aq Mt christos@FreeBSD.org | .An Christos Margiolis Aq Mt christos@FreeBSD.org |