All of lore.kernel.org
 help / color / mirror / Atom feed
From: Clemens Ladisch <clemens@ladisch.de>
To: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org, nightmixes <nightmixes@gmail.com>
Subject: [PATCH] ALSA: usb-audio: fix missing input volume controls in MAYA44	USB(+)
Date: Wed, 03 Jun 2015 11:36:51 +0200	[thread overview]
Message-ID: <556ECAB3.907@ladisch.de> (raw)
In-Reply-To: <CAKfvqMWBgeJb_sMJdmb0cYcq2qD8UocfEyGY1B-BKERjAXpY7A@mail.gmail.com>

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 <nightmixes@gmail.com>
Tested-by: nightmixes <nightmixes@gmail.com>
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>

--- 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)

  parent reply	other threads:[~2015-06-03  9:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAKfvqMUuD4ywuKktwko4DxgKpX1+vTCYHkngPXxKBjHNnmt_iw@mail.gmail.com>
     [not found] ` <5552F162.8000309@googlemail.com>
     [not found]   ` <CAKfvqMVEWGDUUh4e0i9fEsbhBQyYPuzqs3xAQKA_FuZYtPuigg@mail.gmail.com>
     [not found]     ` <CAKfvqMVQHt157QmE5Fx=NV_U0i_JdH6UKtNXfcGaNvJNEW9M4Q@mail.gmail.com>
     [not found]       ` <CAKfvqMW9P-_fzx86c=bM_cD0sd93hsnaLuGwWRgKmPpEFLP7Ww@mail.gmail.com>
     [not found]         ` <CAKfvqMUJ+JDJoSWL5WjLugMoSN3FFbD0AFTJJ2-nW-dsgjLtdg@mail.gmail.com>
     [not found]           ` <5559AD0A.6060709@googlemail.com>
     [not found]             ` <CAKfvqMUA=CvfEETYWEESWs7xh3GiDgbjXHaAnx0UkpUxpBn_NA@mail.gmail.com>
     [not found]               ` <CAKfvqMV0xm0_fGs7=qEmjyE6p4Wf-xO0r3x7BuRbzo15h+pjew@mail.gmail.com>
     [not found]                 ` <555C4A38.7030005@googlemail.com>
     [not found]                   ` <CAKfvqMUPGMiukizZqSN5nY_OR3_ur6FF44GVcGmiQWNTMc8-1A@mail.gmail.com>
     [not found]                     ` <555D840D.1060000@googlemail.com>
     [not found]                       ` <CAKfvqMXWFNK3XvK8A9JY5xFnyQqw4C77D61JZb6xOqT92yDpug@mail.gmail.com>
     [not found]                         ` <CAKfvqMUf7ET5KLAvYXNU2haLyeyBL Wd+3O_O2_O_84HUV+zgkg@mail.gmail.com>
     [not found]                           ` <555EDCB4.8040507@googlemail.com>
     [not found]                             ` <CAKfvqMWBgeJb_sMJdmb0cYcq2qD8UocfEyGY1B-BKERjAXpY7A@mail.gmail.com>
2015-06-03  9:36                               ` [PATCH] ALSA: usb-audio: add MAYA44 USB+ mixer control names Clemens Ladisch
2015-06-03 12:02                                 ` Takashi Iwai
2015-06-03  9:36                               ` Clemens Ladisch [this message]
2015-06-03 12:02                                 ` [PATCH] ALSA: usb-audio: fix missing input volume controls in MAYA44 USB(+) Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=556ECAB3.907@ladisch.de \
    --to=clemens@ladisch.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=nightmixes@gmail.com \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.