Commit d8d0db7b authored by Tom Yan's avatar Tom Yan Committed by Takashi Iwai

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: default avatarTom Yan <tom.ty89@gmail.com>
Link: https://lore.kernel.org/r/5f3abc52.1c69fb81.9cf2.fe91@mx.google.comSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 23dc9586
...@@ -2371,7 +2371,7 @@ static int build_audio_procunit(struct mixer_build *state, int unitid, ...@@ -2371,7 +2371,7 @@ static int build_audio_procunit(struct mixer_build *state, int unitid,
int num_ins; int num_ins;
struct usb_mixer_elem_info *cval; struct usb_mixer_elem_info *cval;
struct snd_kcontrol *kctl; 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_info *info;
const struct procunit_value_info *valinfo; const struct procunit_value_info *valinfo;
const struct usbmix_name_map *map; const struct usbmix_name_map *map;
...@@ -2474,6 +2474,12 @@ static int build_audio_procunit(struct mixer_build *state, int unitid, ...@@ -2474,6 +2474,12 @@ static int build_audio_procunit(struct mixer_build *state, int unitid,
break; 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); kctl = snd_ctl_new1(&mixer_procunit_ctl, cval);
if (!kctl) { if (!kctl) {
usb_mixer_elem_info_free(cval); usb_mixer_elem_info_free(cval);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment