git: a28bb575c89c - main - mixer(8): Deprecate some unintuitive control values
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 27 Apr 2026 16:25:09 UTC
The branch main has been updated by christos:
URL: https://cgit.FreeBSD.org/src/commit/?id=a28bb575c89c8de62684419ece1ff5e070e4ce24
commit a28bb575c89c8de62684419ece1ff5e070e4ce24
Author: Christos Margiolis <christos@FreeBSD.org>
AuthorDate: 2026-04-23 12:06:15 +0000
Commit: Christos Margiolis <christos@FreeBSD.org>
CommitDate: 2026-04-27 16:23:36 +0000
mixer(8): Deprecate some unintuitive control values
This is a follow-up to cc7479d7dc9b ("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
---
usr.sbin/mixer/mixer.8 | 20 +++++++++-----------
usr.sbin/mixer/mixer.c | 48 +++++++++++++++++++++++++++++++-----------------
2 files changed, 40 insertions(+), 28 deletions(-)
diff --git a/usr.sbin/mixer/mixer.8 b/usr.sbin/mixer/mixer.8
index bdff0dbedc11..2d12e6057797 100644
--- a/usr.sbin/mixer/mixer.8
+++ b/usr.sbin/mixer/mixer.8
@@ -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.
diff --git a/usr.sbin/mixer/mixer.c b/usr.sbin/mixer/mixer.c
index a0fc9705a301..c9efacc666eb 100644
--- a/usr.sbin/mixer/mixer.c
+++ b/usr.sbin/mixer/mixer.c
@@ -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, "1", strlen(val)) == 0) {
+ warnx("%s: deprecated: use \"on\" instead", val);
opt = MIX_MUTE;
- else if (strncmp(val, "toggle", strlen(val)) == 0 ||
- strncmp(val, "^", strlen(val)) == 0)
+ } else if (strncmp(val, "toggle", strlen(val)) == 0) {
+ opt = MIX_TOGGLEMUTE;
+ } else if (strncmp(val, "^", strlen(val)) == 0) {
+ warnx("%s: deprecated: use \"toggle\" instead", val);
opt = MIX_TOGGLEMUTE;
- else {
+ } 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, "+", strlen(val)) == 0) {
+ warnx("%s: deprecated: use \"add\" instead", val);
opt = MIX_ADDRECSRC;
- else if (strncmp(val, "remove", strlen(val)) == 0 ||
- strncmp(val, "-", strlen(val)) == 0)
+ } 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, "=", strlen(val)) == 0) {
+ warnx("%s: deprecated: use \"set\" instead", val);
opt = MIX_SETRECSRC;
- else if (strncmp(val, "toggle", strlen(val)) == 0 ||
- strncmp(val, "^", strlen(val)) == 0)
+ } 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);
}