ALSA: scarlett2: Correct channel mute status after mute button pressed

After the hardware mute button is pressed, private->vol_updated is set
so that the mute status is invalidated. As the channel mute values may
be affected by the global mute value, update scarlett2_mute_ctl_get()
to call scarlett2_update_volumes() if private->vol_updated is set.

Signed-off-by: Geoffrey D. Bennett <g@b4.vu>
Link: https://lore.kernel.org/r/aa18ddbf8d8bd7f31832ab1b6b6057c00b931202.1626959758.git.g@b4.vu
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Geoffrey D. Bennett 2021-07-23 05:42:48 +09:30 committed by Takashi Iwai
parent d3a4f784d2
commit 9ee0fc8366
1 changed files with 7 additions and 1 deletions

View File

@ -1856,9 +1856,15 @@ static int scarlett2_mute_ctl_get(struct snd_kcontrol *kctl,
struct snd_ctl_elem_value *ucontrol)
{
struct usb_mixer_elem_info *elem = kctl->private_data;
struct scarlett2_data *private = elem->head.mixer->private_data;
struct usb_mixer_interface *mixer = elem->head.mixer;
struct scarlett2_data *private = mixer->private_data;
int index = line_out_remap(private, elem->control);
mutex_lock(&private->data_mutex);
if (private->vol_updated)
scarlett2_update_volumes(mixer);
mutex_unlock(&private->data_mutex);
ucontrol->value.integer.value[0] = private->mute_switch[index];
return 0;
}