Re: Muting only affects audio that is playing
"Christos Margiolis" <[email protected]>
| Newsgroups | gmane.os.freebsd.devel.multimedia |
|---|---|
| Message-ID | <[email protected]> |
Hello Sean, On Wed Feb 25, 2026 at 4:07 AM CET, Sean C. Farley wrote: > Now, this only fixes what I hear regarding vol.mute. pcm.mute still > exhibits the problem but would have to be fixed elsewhere, probably > within the channel code. > > A commit message/description of it: > > ------------------- > > 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. > > ------------------- > > I am also attaching a patch for dsp.c to use chn_getmute_matrix() > instead of CHN_GETMUTE(), but it is cosmetic. > > Sean The patches seem reasonable, feel free to submit them for review on Phabricator. That being said, the issue still sounds rather strange to me, especially given that I cannot reproduce this. Even though I understand your analysis and it does make sense, I don't fully understand exactly how this happens. The volume/muting mechanism seems a bit complicated currently, because we still support the legacy mixer interface of OSS (mixer.c). We keep volumes/mutes in mixer.c which correspond to the OSS devices (vol, pcm, monitor, ...), but we also keep volumes/mutes in channel.c, which get used by feeder_volume. I will look more into how to modernize and clean this up. For now I think your patches will suffice to address this issue. Christos