From nobody Sat Jul 06 18:24:05 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 4WGf0j5cTlz5PMGn; Sat, 06 Jul 2024 18:24:05 +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 4WGf0j3DPlz544Y; Sat, 6 Jul 2024 18:24:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720290245; 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=u8GpEtRvW5z8moZeHm5wndQ5E/8qIsZAEZg849KGu1Q=; b=Bhpp5zZs6Dq37lSuipHXxU9RDFnkEnNARSAgE0ELbMlkfN6nGTIHfp2uvH9Xp/slwZfrye TaNCsvbbqoD/pJIN402awaZ3SNdImEwn75LeNIKJEUuV1gYUoZqD82Px1X400qgcw48GZ0 AzWQg0m9rXVi8YgX9vdqDakSpx76f51VtTCgt3+xD1Lj7F5f9IypwKBq6VD4vxF0ctZ42q H7WBFOHNysrFyUK20BSyIMq0MOqOTVQu4TxmTZ00zcfk8vb3d/AHnikqEJk9Kxjs3aPXFW lmfdYb/kiIHkyjO+3tDQXNEQgu3OGvPGUnwdaKKgERQ9SjVy7FylMLCgCGosFA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720290245; a=rsa-sha256; cv=none; b=tKbtVrP1/W3BNYq06AcoYhU3n4ez+jhi539/bTq4Va4wvItpqG9PMtq6rA9dptWme/HeZ2 Ka9sNnVtl+a1OsO0/CL637y3es1EIOvnJxds6fOCosckLSxW6c4EipdBgzWjr8oKhcn1Zp 38OIknBFWkDM0pU+DfWu+7m9OwShbQIwldOg2POMvv1lAhOpewo7DruKxPPsnGc1EgT6lo G/I01X1TrP3YYOQ8xbgUUSvpnfrmFjIEXeBGjLDphPAhwF+rMInGZoAfqHooupZ8STO81H kpoUJOpoNpEof9F/GEu1e74j+2lOzDNJNFPR/c0W70V0Py3yi7exg8cE9S/m7Q== 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=1720290245; 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=u8GpEtRvW5z8moZeHm5wndQ5E/8qIsZAEZg849KGu1Q=; b=LPhoTVaM9R/QQxHbGqhFsXKqMtBSJ3aafygH7u4/6uu9MwJwEqC8/2jNqmRPwtGw48lDrq Gu/usbkVXeQr5QD2Q3JDfknzwcssDfUUpgO4dOwg1ATQhAkchDD/KJrdlJQb5dZpFpUxEw y08EgpIn1ltt1DKjNR4mxx8zWxUl151UaP5ds0XZiHl6pLgF+iO6VrcFSsL3BGZYMbDI+T c6TK2Tr/cbs+weRBJnhogW8dz8pFUyiincNZ9gwtW9AKFEnavjoiFEx9IAafIdupwDth2G kw5RgHbjB8zaOTXO0hd87qjLRhefwQqiQCSjTSNvl7x1gnzqBZ6UKtCO2q6TOw== 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 4WGf0j2qxqzrWZ; Sat, 6 Jul 2024 18:24:05 +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 466IO5QM090540; Sat, 6 Jul 2024 18:24:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 466IO5X9090537; Sat, 6 Jul 2024 18:24:05 GMT (envelope-from git) Date: Sat, 6 Jul 2024 18:24:05 GMT Message-Id: <202407061824.466IO5X9090537@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: d6d4586b0b7e - main - sound: Get rid of snd_sb16 workaround in vchan_create() 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: d6d4586b0b7e3b01812e6c26818af78bf9b680a3 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=d6d4586b0b7e3b01812e6c26818af78bf9b680a3 commit d6d4586b0b7e3b01812e6c26818af78bf9b680a3 Author: Christos Margiolis AuthorDate: 2024-07-06 18:22:16 +0000 Commit: Christos Margiolis CommitDate: 2024-07-06 18:22:16 +0000 sound: Get rid of snd_sb16 workaround in vchan_create() The snd_sb16 driver was removed in 716924cb4832 ("Retire snd_sbc ISA sound card driver"). While here, simplify sample rate assignment a bit. Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch, markj, emaste Differential Revision: https://reviews.freebsd.org/D45662 --- sys/dev/sound/pcm/vchan.c | 28 +++++----------------------- 1 file changed, 5 insertions(+), 23 deletions(-) diff --git a/sys/dev/sound/pcm/vchan.c b/sys/dev/sound/pcm/vchan.c index 528c6fa62621..fa4fa2023b71 100644 --- a/sys/dev/sound/pcm/vchan.c +++ b/sys/dev/sound/pcm/vchan.c @@ -768,25 +768,10 @@ vchan_create(struct pcm_channel *parent) &vchanspd); CHN_LOCK(parent); if (r != 0) { - /* - * No saved value, no hint, NOTHING. - * - * Workaround for sb16 running - * poorly at 45k / 49k. - */ - switch (parent_caps->maxspeed) { - case 45000: - case 49000: - vchanspd = 44100; - break; - default: - vchanspd = VCHAN_DEFAULT_RATE; - if (vchanspd > parent_caps->maxspeed) - vchanspd = parent_caps->maxspeed; - break; - } - if (vchanspd < parent_caps->minspeed) - vchanspd = parent_caps->minspeed; + /* No saved value, no hint, NOTHING. */ + vchanspd = VCHAN_DEFAULT_RATE; + RANGE(vchanspd, parent_caps->minspeed, + parent_caps->maxspeed); } save = 1; } @@ -795,10 +780,7 @@ vchan_create(struct pcm_channel *parent) /* * Limit the speed between feeder_rate_min <-> feeder_rate_max. */ - if (vchanspd < feeder_rate_min) - vchanspd = feeder_rate_min; - if (vchanspd > feeder_rate_max) - vchanspd = feeder_rate_max; + RANGE(vchanspd, feeder_rate_min, feeder_rate_max); if (feeder_rate_round) { RANGE(vchanspd, parent_caps->minspeed,