[PATCH 1/2] ALSA: usb-audio: Skip the clock selector inquiry for single connections
The current USB-audio driver gets an error at probing NUX MG-300 about parsing the clocks. This is because the firmware doesn't return the proper connection of the clock selector that is connected to a single clock; it's likely that the firmware was lazy^w optimized and the inquiry wasn't handled. Actually it makes little sense to inquire and set up the single connection explicitly.
This patch fixes the issue by simply skipping the clock selector inquiry if it's a single connection.
Reported-by: Mike Oliphant oliphant@nostatic.org Signed-off-by: Takashi Iwai tiwai@suse.de --- sound/usb/clock.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/sound/usb/clock.c b/sound/usb/clock.c index dc68ed65e478..8243652d5604 100644 --- a/sound/usb/clock.c +++ b/sound/usb/clock.c @@ -298,6 +298,11 @@ static int __uac_clock_find_source(struct snd_usb_audio *chip, if (selector) { int ret, i, cur;
+ if (selector->bNrInPins == 1) { + ret = 1; + goto find_source; + } + /* the entity ID we are looking for is a selector. * find out what it currently selects */ ret = uac_clock_selector_get_val(chip, selector->bClockID); @@ -314,6 +319,7 @@ static int __uac_clock_find_source(struct snd_usb_audio *chip, return -EINVAL; }
+ find_source: cur = ret; ret = __uac_clock_find_source(chip, fmt, selector->baCSourceID[ret - 1],
At probing a UAC2/UAC3 device like NUX MG-300 USB interface, we get error messages "RANGE setting not yet supported". It comes the place where the driver tries to determine the resolution of mixer volumes via SET_CUR_RES and GET_CUR_RES verbs. Those verbs aren't supported on UAC2 and UAC3, hence the driver warns like the above. Although the driver handles this error and works as expected, it's still ugly to show such errors unnecessarily.
This patch papers over the errors by applying the resolution detection only for UAC1 and skipping it for UAC2/UAC3.
Reported-by: Mike Oliphant oliphant@nostatic.org Signed-off-by: Takashi Iwai tiwai@suse.de --- sound/usb/mixer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c index 12b15ed59eaa..1a6d154a548c 100644 --- a/sound/usb/mixer.c +++ b/sound/usb/mixer.c @@ -1232,7 +1232,7 @@ static int get_min_max_with_quirks(struct usb_mixer_elem_info *cval, (cval->control << 8) | minchn, &cval->res) < 0) { cval->res = 1; - } else { + } else if (cval->head.mixer->protocol == UAC_VERSION_1) { int last_valid_res = cval->res;
while (cval->res > 1) {
participants (1)
-
Takashi Iwai