Skip to content

Commit

Permalink
ALSA: usb-audio: uac1: Invalidate ctl on interrupt
Browse files Browse the repository at this point in the history
When an interrupt occurs, the value of at least one of the belonging
controls should have changed. To make sure they get re-read from device
on the next read, invalidate the cache. This was correctly implemented
for uac2 already, but missing for uac1.

Signed-off-by: Julian Scheel <julian@jusst.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Julian Scheel authored and Takashi Iwai committed Nov 17, 2017
1 parent 3aabf94 commit b2500b5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion sound/usb/mixer.c
Original file line number Diff line number Diff line change
Expand Up @@ -2330,9 +2330,14 @@ void snd_usb_mixer_notify_id(struct usb_mixer_interface *mixer, int unitid)
{
struct usb_mixer_elem_list *list;

for (list = mixer->id_elems[unitid]; list; list = list->next_id_elem)
for (list = mixer->id_elems[unitid]; list; list = list->next_id_elem) {
struct usb_mixer_elem_info *info =
(struct usb_mixer_elem_info *)list;
/* invalidate cache, so the value is read from the device */
info->cached = 0;
snd_ctl_notify(mixer->chip->card, SNDRV_CTL_EVENT_MASK_VALUE,
&list->kctl->id);
}
}

static void snd_usb_mixer_dump_cval(struct snd_info_buffer *buffer,
Expand Down

0 comments on commit b2500b5

Please sign in to comment.