From nobody Sat Jul 06 18:24:04 2024 X-Original-To: dev-commits-src-all@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 4WGf0h3HPJz5PMJk; Sat, 06 Jul 2024 18:24:04 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WGf0h2ZdHz546d; Sat, 6 Jul 2024 18:24:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720290244; 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=Dtgr7IAPGw1nSIHAzb5zRcm9SYyScFEB2VmKLdyT+NI=; b=dI2P5bbqfXXUIs2G/2+AZkSgUbVrMa+GdGTq1eZpVOFB/LJtu/y81xCnOaqHkJ1Mthecfn wQgOjYG4wHQ4veX9lJLNmb3AwGNZYE3brCeToziBJB7C0r7RWXQiVozxnkb6obOWKJbLwu Rx02USAEz9pFSa6JfiUvzYTcJhTS3+ibAvD5lx+yw/b0TbJ0Xp6jihA8vlEQz5UzB+X31T YGWmH+bd+VkcAgsYioGg9M6SRERO6Vr9dcKTQc6ND0PczxU8S2nwiai1Pu1m75tRGjTdca ZLhq/Gd+IQiLSnBXFuy7PRkuxL0lpSv0xbHqsZRa94La1dNDW6meU201LqFPUw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720290244; a=rsa-sha256; cv=none; b=wMfKtDR9KVQpIAxdy96wvLakpKyS+IyCIWUFD3wk/XKhRoDsCsrCn+mWeT1PI+/VAG7cZs dRzciK0wo4Z43N8OiDDTWQRSOR/KkyvO6CBaxI2arvKNHVzy/6P4oI5ZJT7fNuhW9UHCX1 DHbv8v0aX8jNfUvICKj97SdrBtOJR90iwdcIpP10RSe3mhaGjs4xcR/i+tdY3SQ7WCrHEP Zksbe8J3U4X7Nv6QyKync5dD+OHGmSM+YT3VjxLa2yTgxl+tdV/vEud1iaFL+G4aPlFJbS IonZJhp7Nm7/PiAOevciffBfgmxwFqDghrD9ZDmiJSXaKNIhXzVd63rkXDyrrg== 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=1720290244; 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=Dtgr7IAPGw1nSIHAzb5zRcm9SYyScFEB2VmKLdyT+NI=; b=tREcKEF2LukbWYXDPpsvY9csVO7hMs6aYH1pxAM8O7XMN4rUIc7zcMNnz4D0aDO1VjQV4K Bl32OcxLbtGdwr6L/D6+nT+Xj6af684BRzH1gIrD7bs0/cwft1lwIPLrvpFJpHVAeZxYOp L8azYy+D6feDkcDjmVD/M06fn6fUp8Da6KWIyqzmR/SE16zqhjHQ63f7z7KbX6cdwx7Tx1 B0rhhQR+BmtYVdtDtTDCkGHYoJmlWXECS3n3e5x4sUbxvBkEqnvc0FF7L5sAuPa5wnS0sU NlZMdejJvuoz6zAtVlLWM+EYBwz/UyJfTVZREqpv6b+Sn1MyQ7cX9Dpii1TnMw== 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 4WGf0h26Xczqw8; Sat, 6 Jul 2024 18:24:04 +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 466IO45d090487; Sat, 6 Jul 2024 18:24:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 466IO4bp090484; Sat, 6 Jul 2024 18:24:04 GMT (envelope-from git) Date: Sat, 6 Jul 2024 18:24:04 GMT Message-Id: <202407061824.466IO4bp090484@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: f30af1f037a6 - main - sound: SNDCTL_AUDIOINFO: Do not skip physical channels if VCHANs are disabled List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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: f30af1f037a68947edbabebc7ab495cd1b7a4ec8 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=f30af1f037a68947edbabebc7ab495cd1b7a4ec8 commit f30af1f037a68947edbabebc7ab495cd1b7a4ec8 Author: Christos Margiolis AuthorDate: 2024-07-06 18:22:08 +0000 Commit: Christos Margiolis CommitDate: 2024-07-06 18:22:08 +0000 sound: SNDCTL_AUDIOINFO: Do not skip physical channels if VCHANs are disabled Currently, we are skipping physical channels when servicing SNDCTL_AUDIOINFO, and VCHANs when servicing SNDCTL_AUDIOINFO_EX. However, if we call SNDCTL_AUDIOINFO with VCHANs disabled, we'll eventually skip all channels, resulting in some of oss_audioinfo's fields containing wrong information (e.g min/max_channels). Fix this by adding an exception to SNDCTL_AUDIOINFO not to skip physical channels when VCHANs are disabled. Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch, emaste Differential Revision: https://reviews.freebsd.org/D45722 --- sys/dev/sound/pcm/dsp.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index 0eb41faaae45..6ac85635b080 100644 --- a/sys/dev/sound/pcm/dsp.c +++ b/sys/dev/sound/pcm/dsp.c @@ -2159,9 +2159,13 @@ dsp_oss_audioinfo(struct cdev *i_dev, oss_audioinfo *ai, bool ex) /* * Skip physical channels if we are servicing SNDCTL_AUDIOINFO, * or VCHANs if we are servicing SNDCTL_AUDIOINFO_EX. + * + * For SNDCTL_AUDIOINFO do not skip the physical channels if + * there are no VCHANs. */ if ((ex && (ch->flags & CHN_F_VIRTUAL) != 0) || - (!ex && (ch->flags & CHN_F_VIRTUAL) == 0)) { + ((!ex && (ch->flags & CHN_F_VIRTUAL) == 0) && + (d->pvchancount > 0 || d->rvchancount > 0))) { CHN_UNLOCK(ch); continue; }