Skip to content

Commit

Permalink
ALSA: usb-audio: ignore broken processing/extension unit
Browse files Browse the repository at this point in the history
Some devices have broken extension unit where getting current value
doesn't work. Attempt that once when creating mixer control for it. If
it fails, just ignore it, so that it won't cripple the device entirely
(and/or make the error floods).

Signed-off-by: Tom Yan <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
tomty89 authored and tiwai committed Aug 17, 2020
1 parent 23dc958 commit d8d0db7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion sound/usb/mixer.c
Original file line number Diff line number Diff line change
Expand Up @@ -2371,7 +2371,7 @@ static int build_audio_procunit(struct mixer_build *state, int unitid,
int num_ins;
struct usb_mixer_elem_info *cval;
struct snd_kcontrol *kctl;
int i, err, nameid, type, len;
int i, err, nameid, type, len, val;
const struct procunit_info *info;
const struct procunit_value_info *valinfo;
const struct usbmix_name_map *map;
Expand Down Expand Up @@ -2474,6 +2474,12 @@ static int build_audio_procunit(struct mixer_build *state, int unitid,
break;
}

err = get_cur_ctl_value(cval, cval->control << 8, &val);
if (err < 0) {
usb_mixer_elem_info_free(cval);
return -EINVAL;
}

kctl = snd_ctl_new1(&mixer_procunit_ctl, cval);
if (!kctl) {
usb_mixer_elem_info_free(cval);
Expand Down

0 comments on commit d8d0db7

Please sign in to comment.