From nobody Wed Jul 10 16:49:10 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 4WK3jL5VJnz5Qmqv; Wed, 10 Jul 2024 16:49:10 +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 4WK3jL3jmTz4gYg; Wed, 10 Jul 2024 16:49:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720630150; 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=mjdUhxVOFWPFiifMb/aWGS5wBuedF9vKF3r52+6HG+M=; b=x/E2t9o9VJN1ZCjiGya/FXuuByE1qbnJ+Xy08UAATnNhMMiYDNiTLkh9U5uLcWIVyfk7rS DM60LjyzjOi24OJp/ZcvtAiCbRE6ClFNSVi73VDT0FsgrL1NeY+Fp8XEQ9usUNCaX6D7f1 AmY0O+9qTsZ3n9VprSIuNRXruKWrwCCVUCPO8sC++NW3yGLGVVpbelhtCfkNpPfupdqWO6 xxalbQ5bd6lhD0aD06EZobdQ5Ckp2+LLxxRNLlQbqyqSoTCSR8TtPqP91G8bGdRomJFS6G KXMIDTV1S43bGg8/RoWf0s1zyidZoZ7akKTH1MaGepgczGq4mO+GMQZpxDhahA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720630150; a=rsa-sha256; cv=none; b=i7uzMT3E6v8NSpRKyy+MnSeMlfMJXVNnmqP9rOymzACSsJ5Gm90wmply03ZhczZpUUiDN9 sWgjV95eApk3PdOv1UXrE8jFSfi3+ZHEVWrSoxhlIEtqOUwCbv/cuSPW7mWnFHyah1dfyu 31mE0Y/dyHPQuT0UDP6vKhUyUir+5muvp3PCchIhJAERamdnd6KiBrHmUzLh4dSEL49qhJ Mzqk4MnfnkEZIddIYgGTxU70KdkTjx8x898HSVR5ikmScXxfjzj+Z1IdlUy15vr6nvRA3m AGodOQ7q/QZR8xyma2/vWHMMRkUWvmQES3lSiBQWObh3VtymgavUvJo7l/GuSw== 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=1720630150; 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=mjdUhxVOFWPFiifMb/aWGS5wBuedF9vKF3r52+6HG+M=; b=lnEiLF0zzQ1lzMOlTcM/zGYjm2spybfe4ByFZbIN0xvUPe6KRxTfgobgvbBu3I+3pPhQmY IaQcVwulVar22/vhVci3iZZIiDFZHF1FcUICYut9IEGLdMRR731xiVSPoSMNdAYtefI7L6 EU8FqftZLbNCK0oQBK+l+f5EWmLvuRk0kGaWlJmZMr+JRo2JbKT2qLUkyoqOHMWR6NybRy lPl0mmSswCwDsTzQPVbGFwJ3brrKU4LKZaOPPajpHr1tYSupIthPuuG/aauquJaFNgrZh2 M39fHjlwLWP8Pw+cA44R/IQm6xbcbIGV180t59fEBG9AQMooekjKV51sdqE/0w== 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 4WK3jL3LPnzQ5T; Wed, 10 Jul 2024 16:49:10 +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 46AGnAfL035132; Wed, 10 Jul 2024 16:49:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46AGnAPD035129; Wed, 10 Jul 2024 16:49:10 GMT (envelope-from git) Date: Wed, 10 Jul 2024 16:49:10 GMT Message-Id: <202407101649.46AGnAPD035129@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: 95d3abff7375 - stable/14 - sound: Fix min/max rate for SNDCTL_AUDIOINFO and SNDCTL_ENGINEINFO 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 95d3abff7375b8cfa41756288a3cbcdcb218f4cb Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=95d3abff7375b8cfa41756288a3cbcdcb218f4cb commit 95d3abff7375b8cfa41756288a3cbcdcb218f4cb Author: Christos Margiolis AuthorDate: 2024-07-06 18:23:04 +0000 Commit: Christos Margiolis CommitDate: 2024-07-10 16:48:13 +0000 sound: Fix min/max rate for SNDCTL_AUDIOINFO and SNDCTL_ENGINEINFO Since we allow feeding of any rate within the [feeder_rate_min, feeder_rate_max] range, report this as the min/max rate as well. Only exceptions are when we the device is opened in exclusive or bitperfect mode. Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D45862 (cherry picked from commit 86585210fd5657542884b22eb52b21e960b7be6c) --- sys/dev/sound/pcm/dsp.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index 27c89c3231b7..0689dfedb9c2 100644 --- a/sys/dev/sound/pcm/dsp.c +++ b/sys/dev/sound/pcm/dsp.c @@ -2170,8 +2170,13 @@ dsp_oss_audioinfo(struct cdev *i_dev, oss_audioinfo *ai, bool ex) else ai->iformats |= fmts; - ai->min_rate = min(ai->min_rate, caps->minspeed); - ai->max_rate = max(ai->max_rate, caps->maxspeed); + if (ex || (pcm_getflags(d->dev) & SD_F_BITPERFECT)) { + ai->min_rate = min(ai->min_rate, caps->minspeed); + ai->max_rate = max(ai->max_rate, caps->maxspeed); + } else { + ai->min_rate = min(ai->min_rate, feeder_rate_min); + ai->max_rate = max(ai->max_rate, feeder_rate_max); + } ai->min_channels = min(ai->min_channels, minch); ai->max_channels = max(ai->max_channels, maxch); @@ -2369,8 +2374,15 @@ dsp_oss_engineinfo(struct cdev *i_dev, oss_audioinfo *ai) * @todo @c handle - haven't decided how to generate * this yet; bus, vendor, device IDs? */ - ai->min_rate = caps->minspeed; - ai->max_rate = caps->maxspeed; + + if ((ch->flags & CHN_F_EXCLUSIVE) || + (pcm_getflags(d->dev) & SD_F_BITPERFECT)) { + ai->min_rate = caps->minspeed; + ai->max_rate = caps->maxspeed; + } else { + ai->min_rate = feeder_rate_min; + ai->max_rate = feeder_rate_max; + } ai->min_channels = minch; ai->max_channels = maxch;