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 <jorik.devreese@barco.com>
This commit is contained in:
Devreese Jorik 2025-12-15 16:38:52 +01:00
parent f30c355278
commit 8fd6bf1a49

View file

@ -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,