From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C61F6C433E1 for ; Mon, 17 Aug 2020 06:33:39 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2AD5820716 for ; Mon, 17 Aug 2020 06:33:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="PGLTGRDG" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2AD5820716 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id A70EB83E; Mon, 17 Aug 2020 08:32:47 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz A70EB83E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1597646017; bh=JFKVwJizHkGyX6jWYhHUSLd5a6Q0ou+Urn9HhqNChzM=; h=Date:From:To:Subject:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=PGLTGRDGbRv4Rz8idH9QkYNSSCusdKd8LmhuvV5Fpy9S1GabMyprxdytCRCAbGZ7Y akScOejswmQamB0eTcPC7A7DmyCoBtVeBNCy1xXwIdkhdFGw8wkCWwe/dejg2Js32z +94JRcUKfL68C3ffGrQFNw4uFzCnYMAachMbR4YY= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 2EAF2F80216; Mon, 17 Aug 2020 08:32:47 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 4F251F80218; Mon, 17 Aug 2020 08:32:44 +0200 (CEST) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id D395AF800D3 for ; Mon, 17 Aug 2020 08:32:33 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz D395AF800D3 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 79FEFAE37; Mon, 17 Aug 2020 06:32:57 +0000 (UTC) Date: Mon, 17 Aug 2020 08:32:32 +0200 Message-ID: From: Takashi Iwai To: tom.ty89@gmail.com Subject: Re: [ALSA patch] [PATCH] ALSA: usb-audio: ignore broken processing/extension unit In-Reply-To: <5f39a502.1c69fb81.e7174.8615@mx.google.com> References: <5f39a502.1c69fb81.e7174.8615@mx.google.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") Content-Type: text/plain; charset=US-ASCII Cc: alsa-devel@alsa-project.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" On Sun, 16 Aug 2020 23:28:11 +0200, tom.ty89@gmail.com wrote: > > From: Tom Yan > > Some devices have broken extension unit where getting current value doesn't work. Attempt that once when creating mixer control for it. If it fails, just ignore it, so that it won't cripple the device entirely (and/or make the error floods). Could you give your Signed-off-by line? It's mandatory for merging to the upstream. thanks, Takashi > --- > sound/usb/mixer.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c > index eab0fd4fd7c3..e0b7174c1043 100644 > --- a/sound/usb/mixer.c > +++ b/sound/usb/mixer.c > @@ -2367,7 +2367,7 @@ static int build_audio_procunit(struct mixer_build *state, int unitid, > int num_ins; > struct usb_mixer_elem_info *cval; > struct snd_kcontrol *kctl; > - int i, err, nameid, type, len; > + int i, err, nameid, type, len, val; > const struct procunit_info *info; > const struct procunit_value_info *valinfo; > const struct usbmix_name_map *map; > @@ -2470,6 +2470,12 @@ static int build_audio_procunit(struct mixer_build *state, int unitid, > break; > } > > + err = get_cur_ctl_value(cval, cval->control << 8, &val); > + if (err < 0) { > + usb_mixer_elem_info_free(cval); > + return -EINVAL; > + } > + > kctl = snd_ctl_new1(&mixer_procunit_ctl, cval); > if (!kctl) { > usb_mixer_elem_info_free(cval); > -- > 2.28.0 > > _______________________________________________ > Patch mailing list > Patch@alsa-project.org > https://mailman.alsa-project.org/mailman/listinfo/patch >