mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2026-02-04 04:06:26 -05:00
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:
parent
f30c355278
commit
8fd6bf1a49
1 changed files with 2 additions and 6 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue