From nobody Wed Oct 22 11:51:33 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cs6vT3xRjz6F98W; Wed, 22 Oct 2025 11:51:33 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cs6vT3CxWz3dX0; Wed, 22 Oct 2025 11:51:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1761133893; 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=MxuNO9vH7bdkMw4CJVOokWG3kE/da2c2MtzBG30faac=; b=gL4GoBq/dHcb8jbOfxoAZ5FezgwgMDTRJ76kcm819q6K2Wxy31KU4I7OV/rRxMO3bCYXW9 vASQ2e2IGe5XFTd0TW2MIpR4qKK+Uf+Uh5I1Q1pMaAkk3KpzE9pJC6Zx6JP99UzoP8DxgY SMdtgWUPrAL+ySJLDpzWfu3318udzm5MJFM+hBGNngn2SKpWvErDX7QXR0qwSllXmmiCcW eirr2/J2PxhBQfPf/SOe8wMnKuwQhDSknSG6kWKrc+yzIlgvDMjP8naAjYS253y0CXKS7S 7WhmZTIm0uH7r+38ctaIvYePXg3Iv5sedPnifatOrbY2aEkzbrHtp9jX9s1XTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1761133893; 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=MxuNO9vH7bdkMw4CJVOokWG3kE/da2c2MtzBG30faac=; b=HV+fntSAVlmsYiEvPuaHpF5AV4PsdpWstTVlRoRJBlfPr/anJzbi0inR84XwFJtpEsNN36 84bw+JDgDNLSDqLv0sMZrpX1DHtKzI+jgmddTE6UB9kwdb3j8hMxmu+Mwg3kmRX3gu2dN5 bQuPxlhNDbrWT6uaFo9IUZpq4ZVyD8qyOA4u2TctBLhlS8Zx0AzYD828UMZObC47eESfYY fLk6XTvqi6TabSqm4i2se4zfEOISA81CU5zb0WO9aFHg4pBS2ei4xumeU6QaMgK+Q42Rny MN8VX9gFmpNwSEXfuBrzlbL1vUnC7CJSKDaXdU5/vgDtyXGiECrcAo8msUSIzg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1761133893; a=rsa-sha256; cv=none; b=S4HTT9LIlYsmrR9bkm4oiWBM9p4ZnL76f4ucZZPIVWz5wIJt65eTQZIdOVtkwFv/KRS41v pcpPLRTbSyqnR7hAg+nYyWSpjQ7oUvlUohb0OxppCTBxUvaWmDHC5ihK0/6l2phWxFftyv wxl1x67l548BDZn5FwtzS5tEhR9bh6svwUdeWpoax2d0ZhaE6JGl+y0Jyq84HNbGFg/XWl grbW6BwMyuk91dCc9Lrcvk+aqdY31MhD4u7x74MCVf55apCcKzSc84L3fI5JGrRZHxqQw3 24PHU4a0nwnIzUGpsxle2jhJ+LWs0PgVK7vu9L1mRjNHIW60F1U/mulDzPWDgg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cs6vT2mJgzCNg; Wed, 22 Oct 2025 11:51:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 59MBpXdx075890; Wed, 22 Oct 2025 11:51:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 59MBpXKT075887; Wed, 22 Oct 2025 11:51:33 GMT (envelope-from git) Date: Wed, 22 Oct 2025 11:51:33 GMT Message-Id: <202510221151.59MBpXKT075887@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 70b34fbdbea1 - main - sndctl(8): Modify vchans only on supported directions List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org 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/main X-Git-Reftype: branch X-Git-Commit: 70b34fbdbea13c006a724844caa53f59e0e53bd0 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=70b34fbdbea13c006a724844caa53f59e0e53bd0 commit 70b34fbdbea13c006a724844caa53f59e0e53bd0 Author: Christos Margiolis AuthorDate: 2025-10-22 11:50:55 +0000 Commit: Christos Margiolis CommitDate: 2025-10-22 11:50:55 +0000 sndctl(8): Modify vchans only on supported directions Currently mod_play_vchans() and mod_rec_vchans() run unconditionally, even if the direction (playback, recording) is not supported by the device. This results in the "autoconv" (see mod_autoconv()) control failing when run on simplex devices, because we'll be trying to modify vchans on an unsupported direction. Test whether the direction is supported and silently move on if it isn't. Sponsored by: The FreeBSD Foundation MFC after: 4 days Differential Revision: https://reviews.freebsd.org/D53233 --- usr.sbin/sndctl/sndctl.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/usr.sbin/sndctl/sndctl.c b/usr.sbin/sndctl/sndctl.c index 156c845481c5..6977f0ab0ebe 100644 --- a/usr.sbin/sndctl/sndctl.c +++ b/usr.sbin/sndctl/sndctl.c @@ -830,6 +830,8 @@ mod_play_vchans(struct snd_dev *dp, void *arg) if (dp->from_user) return (-1); + if (!dp->play.pchans) + return (0); snprintf(buf, sizeof(buf), "dev.pcm.%d.play.vchans", dp->unit); @@ -873,6 +875,8 @@ mod_rec_vchans(struct snd_dev *dp, void *arg) if (dp->from_user) return (-1); + if (!dp->rec.pchans) + return (0); snprintf(buf, sizeof(buf), "dev.pcm.%d.rec.vchans", dp->unit);