(Postfix) with ESMTP id 4g8L845VKqz6RcYT for ; Mon, 04 May 2026 12:10:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4g8L843bVDz46bv for ; Mon, 04 May 2026 12:10:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1777896644; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oR8MFOKoRraOxHcxj1RPtF0eNe5s6zDssEPtLWyooew=; b=c05BAy2GF02GR7uHMw/j92SwTN8oBUvAmDd6H/oxOytlO7r2UmRI6fSbuznd8HUKTek6zv +d8OxN9bXcn4PahhKIlvKtQ++jjdFwS3d/zFnmVQCsOQwR9a1xDvW1Y+Y2FnTrKXwMp48h iq+fCU5Nmk1DcdMH0CsQ/MP6awE15WGaZoxQFp9kGxLdFWcKun22dHENVBBOz62OFlOR+1 VvxWr/bpqSSCgJpGiVM5j+1UhoZRWJteIWNGwfZN5c4R8LYBjM4JboCMMJaHojAptVsnOk VQ5uQv9Dt1MFwJyWJoVpALTYC8HMEI7ziDVcDZbGn3JmM9D+VmJBWF+64JE9rw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1777896644; a=rsa-sha256; cv=none; b=A6he6w2PGH+3zotlB2FXQ1WAdUJ6YQgeo9dwFRMnHoOBFmmrRkPQ5RNr8Qfa7TL1DLBdLH sg0JX2uixPIl4OnQL1WegkAAv2XD5UQALruT8cppsb3RRtMqeEqWvLoSJMD47hubld21y7 ZukR5LpVgt7sBL4WOmKsxwIPtHau36WjZfj8eSrw1ofrblci2AUFAFs+7MAZf+M/5EtipV 9NFEPc9OFrbs4DJrraRjlfjEmBLaP4AZmfYgxGl/yDAaDK4JDZY5xOUlaQ+MqZmAX0t1AB h8DmsnOPH/OxIhEEZHMIsG7KsfkErMkXn3fmQtZqQytg82eHumIjC13Anv+Xsw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1777896644; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oR8MFOKoRraOxHcxj1RPtF0eNe5s6zDssEPtLWyooew=; b=WhTpbwrIGNMk0jUsdLI76Oo6EJByIEtU+Yx03LDR7R0/XXND88HL3No4HUqkFMxF+L2fjE uYhv3PuwbqhaROwb0T48zwjkgEibkwr+LsriY+3SlX8CCmhA2JdR/cZZjY11LDz/yEYmcy PdB1wfnnDVdNjJe3CUpsN8vi+MoZDKFLtNf1pL1CLAXAe++xIMX4qmvgi/ZxoKrVNstwKK t2AFsc7cQdXMdKiqnWabnl3fA0l8zK+dLaDrsDZcibYvSnLYhWMecQKDkCBwrqWtgNjGpW zJyqp7IcgRFl/vKkH0TRAJkPqIauxNJihRVNJQLj6WH5oT9OGNQJLQCELdpqRQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4g8L8432bNz4D8 for ; Mon, 04 May 2026 12:10:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 39306 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 04 May 2026 12:10:44 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 1b149c2a9735 - stable/15 - mixer(8): Deprecate some unintuitive control values List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 1b149c2a973526df6ba63f8521c4591aa7250d50 Auto-Submitted: auto-generated Date: Mon, 04 May 2026 12:10:44 +0000 Message-Id: <69f88cc4.39306.3f92b042@gitrepo.freebsd.org> The branch stable/15 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=1b149c2a973526df6ba63f8521c4591aa7250d50 commit 1b149c2a973526df6ba63f8521c4591aa7250d50 Author: Christos Margiolis AuthorDate: 2026-04-23 12:06:15 +0000 Commit: Christos Margiolis CommitDate: 2026-05-04 12:10:25 +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 (cherry picked from commit a28bb575c89c8de62684419ece1ff5e070e4ce24) (cherry picked from commit 54922e4ec8909829a7ca8d2158c2a514a06df094) --- usr.sbin/mixer/mixer.8 | 20 +++++++--------- usr.sbin/mixer/mixer.c | 48 ++++++++++++++++++++++++-------------- usr.sbin/mixer/tests/mixer_test.sh | 18 +------------- 3 files changed, 41 insertions(+), 45 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 +.\" Copyright (c) 2021-2026 Christos Margiolis .\" .\" 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 + * Copyright (c) 2021-2026 Christos Margiolis * * 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); } diff --git a/usr.sbin/mixer/tests/mixer_test.sh b/usr.sbin/mixer/tests/mixer_test.sh index c48512db5ec7..da5f4d7566bc 100755 --- a/usr.sbin/mixer/tests/mixer_test.sh +++ b/usr.sbin/mixer/tests/mixer_test.sh @@ -1,7 +1,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2024 The FreeBSD Foundation +# Copyright (c) 2024-2026 The FreeBSD Foundation # # This software was developed by Christos Margiolis # under sponsorship from the FreeBSD Foundation. @@ -210,16 +210,6 @@ mute_body() atf_check -o ignore -e empty mixer vol.mute=toggle atf_check -o match:"=off" mixer vol.mute - # Test deprecated interface - atf_check -o ignore -e empty mixer vol.mute=0 - atf_check -o match:"=off" mixer vol.mute - - atf_check -o ignore -e empty mixer vol.mute=1 - atf_check -o match:"=on" mixer vol.mute - - atf_check -o ignore -e empty mixer vol.mute=^ - atf_check -o match:"=off" mixer vol.mute - # Test wrong values atf_check -o ignore -e not-empty mixer vol.mute=foobar atf_check -o ignore -e not-empty mixer vol.mute=10 @@ -248,12 +238,6 @@ recsrc_body() atf_check -o ignore -e empty mixer ${recsrc}.recsrc=set atf_check -o ignore -e empty mixer ${recsrc}.recsrc=toggle - # Test deprecated interface - atf_check -o ignore -e empty mixer ${recsrc}.recsrc=+ - atf_check -o ignore -e empty mixer ${recsrc}.recsrc=- - atf_check -o ignore -e empty mixer ${recsrc}.recsrc== - atf_check -o ignore -e empty mixer ${recsrc}.recsrc=^ - # Test wrong values atf_check -o ignore -e not-empty mixer ${recsrc}.recsrc=foobar atf_check -o ignore -e not-empty mixer ${recsrc}.recsrc=10