Skip to content

Commit d8d0db7

Browse files
tomty89tiwai
authored andcommitted
ALSA: usb-audio: ignore broken processing/extension unit
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]>
1 parent 23dc958 commit d8d0db7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

sound/usb/mixer.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2371,7 +2371,7 @@ static int build_audio_procunit(struct mixer_build *state, int unitid,
23712371
int num_ins;
23722372
struct usb_mixer_elem_info *cval;
23732373
struct snd_kcontrol *kctl;
2374-
int i, err, nameid, type, len;
2374+
int i, err, nameid, type, len, val;
23752375
const struct procunit_info *info;
23762376
const struct procunit_value_info *valinfo;
23772377
const struct usbmix_name_map *map;
@@ -2474,6 +2474,12 @@ static int build_audio_procunit(struct mixer_build *state, int unitid,
24742474
break;
24752475
}
24762476

2477+
err = get_cur_ctl_value(cval, cval->control << 8, &val);
2478+
if (err < 0) {
2479+
usb_mixer_elem_info_free(cval);
2480+
return -EINVAL;
2481+
}
2482+
24772483
kctl = snd_ctl_new1(&mixer_procunit_ctl, cval);
24782484
if (!kctl) {
24792485
usb_mixer_elem_info_free(cval);

0 commit comments

Comments
 (0)