Page MenuHomeFreeBSD

sound: enforce MASTER volume mute during playback
ClosedPublic

Authored by scf on Mar 1 2026, 4:12 PM.
Referenced Files
Unknown Object (File)
Mon, Mar 23, 10:27 PM
Unknown Object (File)
Sun, Mar 22, 8:06 PM
Unknown Object (File)
Sat, Mar 14, 10:20 PM
Unknown Object (File)
Fri, Mar 13, 9:23 PM
Unknown Object (File)
Sat, Mar 7, 6:42 PM
Unknown Object (File)
Sat, Mar 7, 5:20 PM
Unknown Object (File)
Sat, Mar 7, 3:30 PM
Unknown Object (File)
Sat, Mar 7, 1:37 PM
Subscribers

Details

Summary

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.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

scf requested review of this revision.Mar 1 2026, 4:12 PM

Can you please generate the diff with full context or upload it with git-arc?

Updated diff with full context.

Something is messed up with the file paths here. (dev/sound instead of sys/dev/sound).

dev/sound/pcm/feeder_volume.c
286 ↗(On Diff #173162)
289 ↗(On Diff #173162)

Why do we need the != 0 here? It is the same without it.

Something is messed up with the file paths here. (dev/sound instead of sys/dev/sound).

I am not sure what happened. The diff starts with:

diff --git sys/dev/sound/pcm/feeder_volume.c sys/dev/sound/pcm/feeder_volume.c
index fc4ed1bbb0a5..c1a33dcdd8a3 100644
--- sys/dev/sound/pcm/feeder_volume.c
+++ sys/dev/sound/pcm/feeder_volume.c
@@ -1,350 +1,360 @@
 /*-
  * SPDX-License-Identifier: BSD-2-Clause

I have not used git-arc, but it looks like I need to try it.

In D55605#1274023, @scf wrote:

Something is messed up with the file paths here. (dev/sound instead of sys/dev/sound).

I am not sure what happened. The diff starts with:

diff --git sys/dev/sound/pcm/feeder_volume.c sys/dev/sound/pcm/feeder_volume.c
index fc4ed1bbb0a5..c1a33dcdd8a3 100644
--- sys/dev/sound/pcm/feeder_volume.c
+++ sys/dev/sound/pcm/feeder_volume.c
@@ -1,350 +1,360 @@
 /*-
  * SPDX-License-Identifier: BSD-2-Clause

I have not used git-arc, but it looks like I need to try it.

No big deal. You can address the inline comments first. :-)

Hopefully, fixed.

  • Remove unneeded != 0 expression.
  • Use proper full context diff. Do *not* let --no-prefix anywhere near the diff. :)
sys/dev/sound/pcm/feeder_volume.c
252

This can be a bool.

286
sys/dev/sound/pcm/feeder_volume.c
252

I considered that but went with matching muted. I will switch to bool.

Switched to using bool for the type instead of uint8_t.

This is not diff'd against main. Also please address the other inline comment.

  • Rebase against latest main.
  • Make more use of defined variable.

Sorry about that. I was on a branch off of main, but it was a bit stale.

sys/dev/sound/pcm/feeder_volume.c
284–289

Could be rewritten like this, like in chn_syncstate().

This revision was not accepted when it landed; it landed in state Needs Review.Thu, Mar 12, 6:23 PM
This revision was automatically updated to reflect the committed changes.