Skip to content

Commit 2b8b12b

Browse files
geoffreybennetttiwai
authored andcommitted
ALSA: scarlett2: Fix line out/speaker switching notifications
The values of the line output controls can change when the SW/HW switches are set to HW, and also when speaker switching is enabled. These notifications were sent with a mask of only SNDRV_CTL_EVENT_MASK_INFO. Change the notifications to set the SNDRV_CTL_EVENT_MASK_VALUE mask bit as well. When the mute control is updated, the notification was sent with a mask of SNDRV_CTL_EVENT_MASK_INFO. Change the mask to the correct value of SNDRV_CTL_EVENT_MASK_VALUE. 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 9ee0fc8 commit 2b8b12b

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

sound/usb/mixer_scarlett_gen2.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1961,10 +1961,12 @@ static void scarlett2_vol_ctl_set_writable(struct usb_mixer_interface *mixer,
19611961
~SNDRV_CTL_ELEM_ACCESS_WRITE;
19621962
}
19631963

1964-
/* Notify of write bit change */
1965-
snd_ctl_notify(card, SNDRV_CTL_EVENT_MASK_INFO,
1964+
/* Notify of write bit and possible value change */
1965+
snd_ctl_notify(card,
1966+
SNDRV_CTL_EVENT_MASK_VALUE | SNDRV_CTL_EVENT_MASK_INFO,
19661967
&private->vol_ctls[index]->id);
1967-
snd_ctl_notify(card, SNDRV_CTL_EVENT_MASK_INFO,
1968+
snd_ctl_notify(card,
1969+
SNDRV_CTL_EVENT_MASK_VALUE | SNDRV_CTL_EVENT_MASK_INFO,
19681970
&private->mute_ctls[index]->id);
19691971
}
19701972

@@ -2599,7 +2601,9 @@ static int scarlett2_speaker_switch_enable(struct usb_mixer_interface *mixer)
25992601

26002602
/* disable the line out SW/HW switch */
26012603
scarlett2_sw_hw_ctl_ro(private, i);
2602-
snd_ctl_notify(card, SNDRV_CTL_EVENT_MASK_INFO,
2604+
snd_ctl_notify(card,
2605+
SNDRV_CTL_EVENT_MASK_VALUE |
2606+
SNDRV_CTL_EVENT_MASK_INFO,
26032607
&private->sw_hw_ctls[i]->id);
26042608
}
26052609

@@ -2923,7 +2927,7 @@ static int scarlett2_dim_mute_ctl_put(struct snd_kcontrol *kctl,
29232927
if (private->vol_sw_hw_switch[line_index]) {
29242928
private->mute_switch[line_index] = val;
29252929
snd_ctl_notify(mixer->chip->card,
2926-
SNDRV_CTL_EVENT_MASK_INFO,
2930+
SNDRV_CTL_EVENT_MASK_VALUE,
29272931
&private->mute_ctls[i]->id);
29282932
}
29292933
}

0 commit comments

Comments
 (0)