From 8fd6bf1a490c5dd1e4dfaaee7fc7000e95c311b7 Mon Sep 17 00:00:00 2001 From: Devreese Jorik Date: Mon, 15 Dec 2025 16:38:52 +0100 Subject: [PATCH] mixer: fix cache coherency issue in multi-application scenario Remove conditional hardware writes in set_volume_ops and set_switch_ops to ensure hardware state is always updated. This fixes an issue where setting controls to the same value repeatedly does nothing, even if the hardware state has changed due to actions from other applications. Signed-off-by: Devreese Jorik --- src/mixer/simple_none.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/mixer/simple_none.c b/src/mixer/simple_none.c index e0945602..501265f2 100644 --- a/src/mixer/simple_none.c +++ b/src/mixer/simple_none.c @@ -1262,9 +1262,7 @@ static int set_volume_ops(snd_mixer_elem_t *elem, int dir, changed = _snd_mixer_selem_set_volume(elem, dir, channel, value); if (changed < 0) return changed; - if (changed) - return selem_write(elem); - return 0; + return selem_write(elem); } static int ask_dB_vol_ops(snd_mixer_elem_t *elem, int dir, @@ -1318,9 +1316,7 @@ static int set_switch_ops(snd_mixer_elem_t *elem, int dir, changed = _snd_mixer_selem_set_switch(elem, dir, channel, value); if (changed < 0) return changed; - if (changed) - return selem_write(elem); - return 0; + return selem_write(elem); } static int enum_item_name_ops(snd_mixer_elem_t *elem,