Skip to content

Commit 9ee0fc8

Browse files
geoffreybennetttiwai
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent d3a4f78 commit 9ee0fc8

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

sound/usb/mixer_scarlett_gen2.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1856,9 +1856,15 @@ static int scarlett2_mute_ctl_get(struct snd_kcontrol *kctl,
18561856
struct snd_ctl_elem_value *ucontrol)
18571857
{
18581858
struct usb_mixer_elem_info *elem = kctl->private_data;
1859-
struct scarlett2_data *private = elem->head.mixer->private_data;
1859+
struct usb_mixer_interface *mixer = elem->head.mixer;
1860+
struct scarlett2_data *private = mixer->private_data;
18601861
int index = line_out_remap(private, elem->control);
18611862

1863+
mutex_lock(&private->data_mutex);
1864+
if (private->vol_updated)
1865+
scarlett2_update_volumes(mixer);
1866+
mutex_unlock(&private->data_mutex);
1867+
18621868
ucontrol->value.integer.value[0] = private->mute_switch[index];
18631869
return 0;
18641870
}

0 commit comments

Comments
 (0)