From nobody Wed Jul 10 16:48:57 2024 X-Original-To: dev-commits-src-branches@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 4WK3j61w42z5QmsY; Wed, 10 Jul 2024 16:48:58 +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 4WK3j613Mpz4gDG; Wed, 10 Jul 2024 16:48:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720630138; 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=honuPEOgTEK/gEhRaDKzGWiHMwlRBiNgzOXgGMnEAJ0=; b=FexjkdMpLLHF4bwuBLnoEC1MYyVhOwLFgWNvwYwip6ldzL3YGS38ykSRz8chyubAXuftB5 ZRJPajaHC7dY1AumYDqFKXacFcITpDdeKaj0xXJIHV0v5Irkaj/eA7xBTr10xqXw6hA/EP wfz7gq1c8+FxsatVhCYccT++XTEJeB0haAfWcVj8ats2xa94LAD4qo/sfRBIuJNh17LpT8 ieA3g57UGYfxx/FJ9cc8DHQMNuLLRRVBfqGEVuL5pq8wHk0FHUzY7E+PR20b67xfFt8Ne4 wuBHcPDNfLZlooFaGzhh+2CrjEmO4yxYEkZ7zN0WciazNfIuvDhRm33gj1Poig== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720630138; a=rsa-sha256; cv=none; b=ns0VCYxeswKP2Vg+OI/2X/HeLSH/ga/VZW+p6E60gVYgaR/dO3EqL+cLmIBErvCJVFQ8OW 4JBMbK2eFctobK8mg0O5qQbDyeBY5PM5UHBTvGDcK9f1uuWVQVnL04Z5redvgm5cFm5Xnr Zcmx0IHM5BXlnmpMRq9DpcuywQuaRuXw2zS7x835wyeFvewo8LoQYd/cBuYUhL0jb5G1s/ m4thSVWUBatAeBWvYoWlL6mbTfqp2hO3a7fFJN/DwV9ZjUiGHmR+U7tr7T/25Cc0OnwRzd IuCGMYaElKP4/ZnybZr+La0uOxISVFt5EhnpUj30SefM3B2Kn8y6vezRYfpaHw== 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=1720630138; 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=honuPEOgTEK/gEhRaDKzGWiHMwlRBiNgzOXgGMnEAJ0=; b=FScgy2Z6JFy5hUUc84QvmjNRAIWsOwHCqRNQeopF7iiLjkHMT5GqGFNUvtXe3Da64bzJhl Rfm1oGz8V5oet0sgN3VsuTOsWQRXn2yz1AMenh41Xj8twzBlhqgIplHs/Z673I4dwJf/xb me2VHvvby8W+J433LG5udq424VKK+NO19lWCKkdc/qtadF1wLxSZyeO6qf5uZ0LIym7QYc ESBn3VpmYU2DvnO6G6CQnciaqIlTKLFpc+yyonpJtAx3FikUfC3PtibMVNw9reUZ1lg4c4 Jo+T94HbIYiadyZTvBzN4NPRpyi32+axILzj+CGs1rZqkvOI0YZdZAx7Ur0Uuw== 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 4WK3j60dnnzQ5Q; Wed, 10 Jul 2024 16:48:58 +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 46AGmval034597; Wed, 10 Jul 2024 16:48:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46AGmvbs034594; Wed, 10 Jul 2024 16:48:57 GMT (envelope-from git) Date: Wed, 10 Jul 2024 16:48:57 GMT Message-Id: <202407101648.46AGmvbs034594@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 6158fa24aca6 - stable/14 - sound: SNDCTL_AUDIOINFO: Do not skip physical channels if VCHANs are disabled 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 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/14 X-Git-Reftype: branch X-Git-Commit: 6158fa24aca661221defbf5738546ba68697cac8 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=6158fa24aca661221defbf5738546ba68697cac8 commit 6158fa24aca661221defbf5738546ba68697cac8 Author: Christos Margiolis AuthorDate: 2024-07-06 18:22:08 +0000 Commit: Christos Margiolis CommitDate: 2024-07-10 16:48:12 +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 (cherry picked from commit f30af1f037a68947edbabebc7ab495cd1b7a4ec8) --- 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; }