From patchwork Mon Dec 18 17:11:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 10120931 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C2A1360327 for ; Mon, 18 Dec 2017 17:11:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A824D28AE8 for ; Mon, 18 Dec 2017 17:11:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9D2AF28AF4; Mon, 18 Dec 2017 17:11:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DF5DB28AE8 for ; Mon, 18 Dec 2017 17:11:42 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 07319267545; Mon, 18 Dec 2017 18:11:40 +0100 (CET) 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 19B81267546; Mon, 18 Dec 2017 18:11:39 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id D0D86267544 for ; Mon, 18 Dec 2017 18:11:36 +0100 (CET) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id A7D57AE00; Mon, 18 Dec 2017 17:11:35 +0000 (UTC) Date: Mon, 18 Dec 2017 18:11:35 +0100 Message-ID: From: Takashi Iwai To: Jaejoong Kim In-Reply-To: References: <0f95a1cc-c438-ca4e-cc5f-d311e33a496e@gmail.com> <20171218134444.GA18133@kroah.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Cc: Mauro Santos , alsa-devel@alsa-project.org, USB list , Greg KH Subject: Re: [alsa-devel] Mixer regression with usb soundcard 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 On Mon, 18 Dec 2017 17:59:38 +0100, Jaejoong Kim wrote: > > AudioControl Interface Descriptor: > bLength 8 > bDescriptorType 36 > bDescriptorSubtype 5 (SELECTOR_UNIT) > bUnitID 11 > bNrInPins 2 > baSource( 0) 14 > baSource( 1) 5 > iSelector 0 > ^^^^^^^^^ > > >From the lsusb.txt, iSelector is '0' which means > uac_selector_unit_iSelector() return zero I think. Yes, and in that case, nameid=0, thus it should go to get_term_name(), and there must be no difference. If any difference came from the given commit, it must be nameid!=0, and yet snd_usb_copy_string_desc(namei) returns an error. In anyway, another potential fix would be the patch like below. It covers the case where an error is returned from snb_usb_copy_string_desc() and doesn't fall back to the default name resolution. thanks, Takashi --- a/sound/usb/mixer.c +++ b/sound/usb/mixer.c @@ -656,10 +656,14 @@ static int get_term_name(struct mixer_build *state, struct usb_audio_term *iterm unsigned char *name, int maxlen, int term_only) { struct iterm_name_combo *names; + int len; - if (iterm->name) - return snd_usb_copy_string_desc(state, iterm->name, + if (iterm->name) { + len = snd_usb_copy_string_desc(state, iterm->name, name, maxlen); + if (len) + return len; + } /* virtual type - not a real terminal */ if (iterm->type >> 16) {