mixer(8): Deprecate some unintuitive control values

This is a follow-up to cc7479d7dc ("mixer(8): Improve mute and recsrc
controls"). These deprecated values will be completely removed on
2026-06-15.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Reviewed by:	0mp
Pull Request:	https://ron-dev.freebsd.org/FreeBSD/src/pulls/21
This commit is contained in:
Christos Margiolis
2026-04-23 14:06:15 +02:00
parent f65a4854bf
commit a28bb575c8
2 changed files with 40 additions and 28 deletions
+9 -11
View File
@@ -1,5 +1,5 @@
.\"-
.\" Copyright (c) 2021 Christos Margiolis <christos@FreeBSD.org>
.\" Copyright (c) 2021-2026 Christos Margiolis <christos@FreeBSD.org>
.\"
.\" Permission is hereby granted, free of charge, to any person obtaining a copy
.\" of this software and associated documentation files (the "Software"), to deal
@@ -19,7 +19,7 @@
.\" OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
.\" THE SOFTWARE.
.\"
.Dd February 26, 2026
.Dd April 4, 2026
.Dt MIXER 8
.Os
.Sh NAME
@@ -113,9 +113,7 @@ with one of the available devices):
.Oo Cm \&+ | Cm \&- Oc Ar lvol Oo % Oc
.Oo Cm \&: Oo Cm \&+ | Cm \&- Oc Ar rvol Oo % Oc Oc
.Xc
.It Ar dev Cm .mute Ta Cm 0 | 1 | ^
.It Ar dev Cm .mute Ta Cm off | on | toggle
.It Ar dev Cm .recsrc Ta Cm ^ | + | - | =
.It Ar dev Cm .recsrc Ta Cm toggle | add | remove | set
.El
.Sm on
@@ -153,13 +151,13 @@ The
control (un)mutes a device.
The following values are available:
.Bl -tag -width "xxxxxxxxxx" -offset indent
.It Cm 0 | off
.It Cm off
unmutes
.Ar dev
.It Cm 1 | on
.It Cm on
mutes
.Ar dev
.It Cm ^ | toggle
.It Cm toggle
toggles the mute of
.Ar dev
.El
@@ -177,19 +175,19 @@ on a
.Sy rec
device:
.Bl -tag -width "xxxxxxxxxx" -offset indent
.It Cm ^ | toggle
.It Cm toggle
toggles
.Ar dev
of possible recording devices
.It Cm + | add
.It Cm add
adds
.Ar dev
to possible recording devices
.It Cm - | remove
.It Cm remove
removes
.Ar dev
from possible recording devices
.It Cm = | set
.It Cm set
makes
.Ar dev
the only recording device.
+31 -17
View File
@@ -1,5 +1,5 @@
/*-
* Copyright (c) 2021 Christos Margiolis <christos@FreeBSD.org>
* Copyright (c) 2021-2026 Christos Margiolis <christos@FreeBSD.org>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -428,16 +428,22 @@ mod_mute(struct mix_dev *d, void *p)
m = d->parent_mixer;
cp = mixer_get_ctl(m->dev, C_MUT);
val = p;
if (strncmp(val, "off", strlen(val)) == 0 ||
strncmp(val, "0", strlen(val)) == 0)
if (strncmp(val, "off", strlen(val)) == 0) {
opt = MIX_UNMUTE;
else if (strncmp(val, "on", strlen(val)) == 0 ||
strncmp(val, "1", strlen(val)) == 0)
} else if (strncmp(val, "0", strlen(val)) == 0) {
warnx("%s: deprecated: use \"off\" instead", val);
opt = MIX_UNMUTE;
} else if (strncmp(val, "on", strlen(val)) == 0) {
opt = MIX_MUTE;
else if (strncmp(val, "toggle", strlen(val)) == 0 ||
strncmp(val, "^", strlen(val)) == 0)
} else if (strncmp(val, "1", strlen(val)) == 0) {
warnx("%s: deprecated: use \"on\" instead", val);
opt = MIX_MUTE;
} else if (strncmp(val, "toggle", strlen(val)) == 0) {
opt = MIX_TOGGLEMUTE;
else {
} else if (strncmp(val, "^", strlen(val)) == 0) {
warnx("%s: deprecated: use \"toggle\" instead", val);
opt = MIX_TOGGLEMUTE;
} else {
warnx("%s: no such modifier", val);
return (-1);
}
@@ -464,19 +470,27 @@ mod_recsrc(struct mix_dev *d, void *p)
m = d->parent_mixer;
cp = mixer_get_ctl(m->dev, C_SRC);
val = p;
if (strncmp(val, "add", strlen(val)) == 0 ||
strncmp(val, "+", strlen(val)) == 0)
if (strncmp(val, "add", strlen(val)) == 0) {
opt = MIX_ADDRECSRC;
else if (strncmp(val, "remove", strlen(val)) == 0 ||
strncmp(val, "-", strlen(val)) == 0)
} else if (strncmp(val, "+", strlen(val)) == 0) {
warnx("%s: deprecated: use \"add\" instead", val);
opt = MIX_ADDRECSRC;
} else if (strncmp(val, "remove", strlen(val)) == 0) {
opt = MIX_REMOVERECSRC;
else if (strncmp(val, "set", strlen(val)) == 0 ||
strncmp(val, "=", strlen(val)) == 0)
} else if (strncmp(val, "-", strlen(val)) == 0) {
warnx("%s: deprecated: use \"remove\" instead", val);
opt = MIX_REMOVERECSRC;
} else if (strncmp(val, "set", strlen(val)) == 0) {
opt = MIX_SETRECSRC;
else if (strncmp(val, "toggle", strlen(val)) == 0 ||
strncmp(val, "^", strlen(val)) == 0)
} else if (strncmp(val, "=", strlen(val)) == 0) {
warnx("%s: deprecated: use \"set\" instead", val);
opt = MIX_SETRECSRC;
} else if (strncmp(val, "toggle", strlen(val)) == 0) {
opt = MIX_TOGGLERECSRC;
else {
} else if (strncmp(val, "^", strlen(val)) == 0) {
warnx("%s: deprecated: use \"toggle\" instead", val);
opt = MIX_TOGGLERECSRC;
} else {
warnx("%s: no such modifier", val);
return (-1);
}