From nobody Thu Mar 12 18:22:55 2026 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 4fWww43y3qz6VlSQ for ; Thu, 12 Mar 2026 18:23:00 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fWwvz32Mqz3VW9 for ; Thu, 12 Mar 2026 18:22:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1773339775; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uDavcAnpISW/e3cvxd/BdMhflyp3uwb4F0TlRwwoR/Q=; b=ae17dKe2ert6bZrjW1FZjewrbJHdo0pGtUf3a1zLtZpYEd41jCIVl4JVd5jmUFZD/HOUOd 5+S4khcI0f34N6xiNCBSPxoELhCFPfFNq0yysM9PORYR+WCJYKRBjBeJIA6RDqO89dS1mx U7laMDmOUsbIlKM9aD4+QT4szUJN4UP0b4wKBP5qf2U3SiAkzWxvEu3VnL+i9qA41cEkqA Ju7qYMbsGovOSFw3QPG852PEQu25fFY5d7czqEsaXvSuemWWVOXvF4ZgfeEwhWCoUy1oX1 x/F0+eTbAr59Q5/E6X7/6NnBPp3Aoh6WKZlFD6CLIF2uU//kq6+TjKWFvGRm0A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1773339775; a=rsa-sha256; cv=none; b=Rl+OzN+ozR4k3fpOCqzkdxfxeeektfXKHGsGHiyfm9hixpMXmQGq7tjrcO/nkYtQ7kYP9j m046ZyUwUK6f2aQxSpP5DIW7jrXLHs/An/4YF1+aF2x2pq2kdbWJ/e3zO4I9Dl31XrRPYx ZAKLbID4KdqmNpOsK0jxAfWo4Kyz+j2JPZgM3hIzd15HJkWu9/wgagmybZHIMLdBabgioO EG+0Qqwi9rZ7ZUosty0L9B0J0aGuTbvdF+Iww548VUiL4PoNbm7eGL1BNKHQL4a6CtKlck EZlYHAVZUMVgXFlzrE4uq5eX1M14dSHfYxN3NYljxFkTUQpaRAFm04VZrA+TVw== 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=1773339775; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uDavcAnpISW/e3cvxd/BdMhflyp3uwb4F0TlRwwoR/Q=; b=gVmIcKjf+97Xz/a6aUR9nWMuJQchrkFn5sfVjsIItQTC0pcMB+NUnXvdYUBoVBJW4nHwf1 qwfRFt65yQEM8nw5c3p0ccTfpxEILx63cbAy9uccegPNDxy5+8zAgPS38KiLTrdzyaSdxB TIxMRJOtYabZkpMCItnb4Ewwy2MlnE0v6cN+HdO6ePdVL93iLNncTMsbSODvu+2wacNnE2 nlbmccnFboZnzI6XuBbdiDUJUhYCeN29H9EbCz8Ucn5fmlBLf21kqwatJSH1HxHtxvFoa7 q/Wcu+10vC9mue1VZ3uYbjRhMC3Wtc4sKeUpGBAdAQfZ7FLaPmBYdGl+eeJJFw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fWwvz2Tp0zxJF for ; Thu, 12 Mar 2026 18:22:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1fd0e by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 12 Mar 2026 18:22:55 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Sean Farley From: Christos Margiolis Subject: git: ac5ff2813027 - main - sound: enforce MASTER volume mute during playback 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: ac5ff2813027c385f9037b47b2b164d4c1bebd09 Auto-Submitted: auto-generated Date: Thu, 12 Mar 2026 18:22:55 +0000 Message-Id: <69b3047f.1fd0e.58f3ac16@gitrepo.freebsd.org> The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=ac5ff2813027c385f9037b47b2b164d4c1bebd09 commit ac5ff2813027c385f9037b47b2b164d4c1bebd09 Author: Sean Farley AuthorDate: 2026-03-12 18:22:02 +0000 Commit: Christos Margiolis CommitDate: 2026-03-12 18:22:02 +0000 sound: enforce MASTER volume mute during playback MASTER mute (vol.mute) works while audio is playing. However, if a stream is stopped and restarted (PCMTRIG_STOP -> PCMTRIG_START), the audio will resume even though the mixer shows the MASTER volume as muted. Other streams that are already playing remain silent. New streams may also start playing audio regardless of the MASTER mute state. The volume feeder now considers the MASTER mute when determining whether a channel should be muted. This ensures MASTER mute is consistently enforced for all streams and removes the dependency on trigger-driven state propagation. Tested with Creative Labs CA0132 card. MFC after: 1 week Reviewed by: christos Differential Revision: https://reviews.freebsd.org/D55605 --- sys/dev/sound/pcm/feeder_volume.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/sys/dev/sound/pcm/feeder_volume.c b/sys/dev/sound/pcm/feeder_volume.c index fc4ed1bbb0a5..e43b2594c7e0 100644 --- a/sys/dev/sound/pcm/feeder_volume.c +++ b/sys/dev/sound/pcm/feeder_volume.c @@ -242,11 +242,14 @@ feed_volume_feed(struct pcm_feeder *f, struct pcm_channel *c, uint8_t *b, { int temp_vol[SND_CHN_T_VOL_MAX]; struct feed_volume_info *info; + struct snd_mixer *m; + struct snddev_info *d; uint32_t j, align; int i, *matrix; uint8_t *dst; const int16_t *vol; const int8_t *muted; + bool master_muted = false; /* * Fetch filter data operation. @@ -278,8 +281,14 @@ feed_volume_feed(struct pcm_feeder *f, struct pcm_channel *c, uint8_t *b, return (FEEDER_FEED(f->source, c, b, count, source)); /* Check if any controls are muted. */ + d = (c != NULL) ? c->parentsnddev : NULL; + m = (d != NULL && d->mixer_dev != NULL) ? d->mixer_dev->si_drv1 : NULL; + + if (m != NULL) + master_muted = (mix_getmutedevs(m) & (1 << SND_VOL_C_MASTER)); + for (j = 0; j != SND_CHN_T_VOL_MAX; j++) - temp_vol[j] = muted[j] ? 0 : vol[j]; + temp_vol[j] = (muted[j] || master_muted) ? 0 : vol[j]; dst = b; align = info->bps * info->channels;