From nobody Sat Jul 06 18:24:16 2024 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 4WGf0x10tPz5PMHM; Sat, 06 Jul 2024 18:24:17 +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 4WGf0w6108z54SV; Sat, 6 Jul 2024 18:24:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720290256; 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=W3aPSSvS20R5Cn264TO5cZ3Uwbt98IK1RohgBNutW58=; b=LFnaEQfGnjtX9J/P+0uPdXy+qwwee1NZzET3SkXedGV3awVefJxiL+c82eNi47I8j/ZNX8 jSiMlYX2mHrNhHZxlzr03jA0dvrjBO455OH1gpOyCk0mD/Iz4/7FwmOkpQym3BVzVrOtmd XLowveMP0u8SvGNyFml+jle7Uye3jzKKRscAmZ0BjHU92alAotjjmN6NXBSDna2/E0cfOl gZtNXNhBiGbEYp6+xNAvgFxMfMPz93cOZonbWuciuDzbVs6BlRqOE1SiVR06dPJ8Pk4hIX ZK9EhHGjYaTtP9MAey0Lt8BG/s5utDFhFq3UtnLNpizm1svvP1Rz1I75FjQKvA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720290256; a=rsa-sha256; cv=none; b=UXydZFXGAU699UaBxv8Xuu90ZaCT2sU10UYzAuoAzqwUw6jIVRU027TqKXr49yFyR3hlAN gS0DFouZhuA0lYZ3AE1ykcLhRl//iJo+1QLr/wlssdX2wDF4+Yzxm5yAdwrjeMqBORzpzW Yeh9jzDxxWj+p07dgpn3wIxWjJNHpoYkmA1UPWnWlpT2FnsdwuEQrWOkpHMakLeKBHcTYV n1XuD+30WJo9+fNAhKUlH57/MJymZCI0Y68mfJdeCLLqSWpCRLFSw4hz7c3ashY/mZvd1e lGKjT2+2I1XPpiOniMXQDItferOdvL6b/bmN5zElSoCXyV+8A7uuTPTMTfwReg== 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=1720290256; 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=W3aPSSvS20R5Cn264TO5cZ3Uwbt98IK1RohgBNutW58=; b=YlIPYlo2RHgDQ+wy6iLg4wLhcvQ5Uw6qEeiXu3lDcp1Kojl65FfEkzXRQ5jhjEjC3KJEOA dLRdSpbon//P3HBCDI/GRaZmg8bYDzBz2R4igmL5ySHahU5o5kQG1gQCCETEAG3oxgQQdO AT4MgTRDVeug6UMn2HeQyCGNIEc8VRmxVH9ux6RRwt6I7pr6oqjt5gG5KhYSRAnrryB/1T MvD2V+Lk7PS8T5HV1Uqd6OBi8Fk8ZL+Rf5klKVyQCkD8PsEDqr7p3w9hh4XW9BIc7XOJdo wN1R3dhphgehSm+LgTFP+Zw6bi0cimYeV4loKXPEijFL5BGPFefpLBxxptI36Q== 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 4WGf0w5bXPzrWc; Sat, 6 Jul 2024 18:24:16 +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 466IOGsu090988; Sat, 6 Jul 2024 18:24:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 466IOGTK090985; Sat, 6 Jul 2024 18:24:16 GMT (envelope-from git) Date: Sat, 6 Jul 2024 18:24:16 GMT Message-Id: <202407061824.466IOGTK090985@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: 86585210fd56 - main - sound: Fix min/max rate for SNDCTL_AUDIOINFO and SNDCTL_ENGINEINFO 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: 86585210fd5657542884b22eb52b21e960b7be6c Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=86585210fd5657542884b22eb52b21e960b7be6c commit 86585210fd5657542884b22eb52b21e960b7be6c Author: Christos Margiolis AuthorDate: 2024-07-06 18:23:04 +0000 Commit: Christos Margiolis CommitDate: 2024-07-06 18:23:04 +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 --- 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;