From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: [PATCH] ALSA: usb-audio: fix missing input volume controls in MAYA44 USB(+) Date: Wed, 03 Jun 2015 14:02:40 +0200 Message-ID: References: <5552F162.8000309@googlemail.com> <5559AD0A.6060709@googlemail.com> <555C4A38.7030005@googlemail.com> <555D840D.1060000@googlemail.com> <555EDCB4.8040507@googlemail.com> <556ECAB3.907@ladisch.de> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 7F98D2659F9 for ; Wed, 3 Jun 2015 14:02:41 +0200 (CEST) In-Reply-To: <556ECAB3.907@ladisch.de> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Clemens Ladisch Cc: alsa-devel@alsa-project.org, nightmixes List-Id: alsa-devel@alsa-project.org At Wed, 03 Jun 2015 11:36:51 +0200, Clemens Ladisch wrote: > > The driver worked around an error in the MAYA44 USB(+)'s mixer unit > descriptor by aborting before parsing the missing field. However, > aborting parsing too early prevented parsing of the other units > connected to this unit, so the capture mixer controls would be missing. > > Fix this by moving the check for this descriptor error after the parsing > of the unit's input pins. > > Reported-by: nightmixes > Tested-by: nightmixes > Signed-off-by: Clemens Ladisch Applied, thanks. Takashi > > --- a/sound/usb/mixer.c > +++ b/sound/usb/mixer.c > @@ -1583,18 +1583,15 @@ static int parse_audio_mixer_unit(struct > unitid); > return -EINVAL; > } > - /* no bmControls field (e.g. Maya44) -> ignore */ > - if (desc->bLength <= 10 + input_pins) { > - usb_audio_dbg(state->chip, "MU %d has no bmControls field\n", > - unitid); > - return 0; > - } > > num_ins = 0; > ich = 0; > for (pin = 0; pin < input_pins; pin++) { > err = parse_audio_unit(state, desc->baSourceID[pin]); > if (err < 0) > + continue; > + /* no bmControls field (e.g. Maya44) -> ignore */ > + if (desc->bLength <= 10 + input_pins) > continue; > err = check_input_term(state, desc->baSourceID[pin], &iterm); > if (err < 0) >