From patchwork Wed Jun 3 09:36:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Clemens Ladisch X-Patchwork-Id: 6533651 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id DF3809F3D1 for ; Wed, 3 Jun 2015 09:37:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1A43C206AC for ; Wed, 3 Jun 2015 09:37:39 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id CA442206AA for ; Wed, 3 Jun 2015 09:37:37 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 8A64D2606C5; Wed, 3 Jun 2015 11:37:32 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id DB8C026058B; Wed, 3 Jun 2015 11:36:54 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 876CF260599; Wed, 3 Jun 2015 11:36:54 +0200 (CEST) Received: from dehamd003.servertools24.de (dehamd003.servertools24.de [31.47.254.18]) by alsa0.perex.cz (Postfix) with ESMTP id BFF30260418 for ; Wed, 3 Jun 2015 11:36:51 +0200 (CEST) Received: from [10.1.2.65] (unknown [94.101.37.4]) by dehamd003.servertools24.de (Postfix) with ESMTPSA id 53DF0F520005; Wed, 3 Jun 2015 11:36:51 +0200 (CEST) Message-ID: <556ECAB3.907@ladisch.de> Date: Wed, 03 Jun 2015 11:36:51 +0200 From: Clemens Ladisch User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Takashi Iwai References: <5552F162.8000309@googlemail.com> <5559AD0A.6060709@googlemail.com> <555C4A38.7030005@googlemail.com> <555D840D.1060000@googlemail.com> <555EDCB4.8040507@googlemail.com> In-Reply-To: X-PPP-Message-ID: <20150603093651.246753.15476@dehamd003.servertools24.de> X-PPP-Vhost: ladisch.de Cc: alsa-devel@alsa-project.org, nightmixes Subject: [alsa-devel] [PATCH] ALSA: usb-audio: fix missing input volume controls in MAYA44 USB(+) X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" 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 X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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)