From: Eldad Zack Subject: [FT C400,RFC 1/6] usb-audio: skip UAC2 EFFECT_UNIT Date: Sat, 3 Nov 2012 14:40:06 +0100 Message-ID: <1351950011-8915-2-git-send-email-eldad@fogrefinery.com> References: <1351950011-8915-1-git-send-email-eldad@fogrefinery.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-bk0-f51.google.com (mail-bk0-f51.google.com [209.85.214.51]) by alsa0.perex.cz (Postfix) with ESMTP id 9695726170E for ; Sat, 3 Nov 2012 14:40:23 +0100 (CET) Received: by mail-bk0-f51.google.com with SMTP id e19so1459057bku.38 for ; Sat, 03 Nov 2012 06:40:23 -0700 (PDT) In-Reply-To: <1351950011-8915-1-git-send-email-eldad@fogrefinery.com> 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: alsa-devel@alsa-project.org, Clemens Ladisch , Felix Homann , Chris Cavey Cc: Takashi Iwai , Eldad Zack List-Id: alsa-devel@alsa-project.org Current code mishandles the case where the device is a UAC2 and the bDescriptorSubtype is a UAC2 Effect Unit (0x07). It tries to parse it as a Processing Unit (which is similar to two other UAC1 units with overlapping subtypes), but since the structure is different (See: 4.7.2.10, 4.7.2.11 in UAC2 standard), the parsing is done incorrectly and prevents the device from initializing. For now, just ignore the unit. Signed-off-by: Eldad Zack --- sound/usb/mixer.c | 11 ++++++++++- 1 files changed, 10 insertions(+), 1 deletions(-) diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c index 298070e..9bbc981 100644 --- a/sound/usb/mixer.c +++ b/sound/usb/mixer.c @@ -719,8 +719,17 @@ static int check_input_term(struct mixer_build *state, int id, struct usb_audio_ return 0; } case UAC1_PROCESSING_UNIT: - case UAC1_EXTENSION_UNIT: { + case UAC1_EXTENSION_UNIT: + /* UAC2_PROCESSING_UNIT_V2 */ + /* UAC2_EFFECT_UNIT */ { struct uac_processing_unit_descriptor *d = p1; + + if (state->mixer->protocol == UAC_VERSION_2 && + hdr[2] == UAC2_EFFECT_UNIT) { + /* Differnt structure. Ignore this unit for now */ + return 0; + } + if (d->bNrInPins) { id = d->baSourceID[0]; break; /* continue to parse */ -- 1.7.8.6