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=-13.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 E7A73C433ED for ; Wed, 7 Apr 2021 08:23:17 +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 16F92611EE for ; Wed, 7 Apr 2021 08:23:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 16F92611EE 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 AA13A166D; Wed, 7 Apr 2021 10:22:23 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz AA13A166D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1617783793; bh=6sDRpNlQbJZGMEVCdSAzQ6Hyew/lgjbyyliiEA1K6v4=; h=Date:From:To:Subject:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=O9Mr0c2cYwY1iuVdi7a5lNhUDUWKgCxuKztzGE3HmF4xc1U7G4sDBFbcCBa1TRYqp PdQIDPbGxPSeSUn+7HH3snvip19r/cFF1D+z7/2xf0aXzg3Wlh4yOOKw3jXeOwiFQB Aj2ZtziqBqzeZciADY3XUv9zWvmFtyEYj39noJ+Y= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 3847FF80168; Wed, 7 Apr 2021 10:22:23 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 380D9F8016A; Wed, 7 Apr 2021 10:22:21 +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 D3849F80162 for ; Wed, 7 Apr 2021 10:22:14 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz D3849F80162 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 E4765AFAA; Wed, 7 Apr 2021 08:22:08 +0000 (UTC) Date: Wed, 07 Apr 2021 10:22:08 +0200 Message-ID: From: Takashi Iwai To: Jonas Holmberg Subject: Re: [PATCH] ALSA: aloop: Fix initialization of controls In-Reply-To: <20210407075428.2666787-1-jonashg@axis.com> References: <20210407075428.2666787-1-jonashg@axis.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 Wed, 07 Apr 2021 09:54:28 +0200, Jonas Holmberg wrote: > > Add a control to the card before copying the id so that the numid field > is initialized in the copy. Otherwise the numid field of active_id, > format_id, rate_id and channels_id will be the same (0) and > snd_ctl_notify() will not queue the events properly. > > Signed-off-by: Jonas Holmberg Applied now (with Cc to stable). thanks, Takashi > --- > sound/drivers/aloop.c | 11 ++++++++--- > 1 file changed, 8 insertions(+), 3 deletions(-) > > diff --git a/sound/drivers/aloop.c b/sound/drivers/aloop.c > index 52637180af33..80b814b9922a 100644 > --- a/sound/drivers/aloop.c > +++ b/sound/drivers/aloop.c > @@ -1571,6 +1571,14 @@ static int loopback_mixer_new(struct loopback *loopback, int notify) > return -ENOMEM; > kctl->id.device = dev; > kctl->id.subdevice = substr; > + > + /* Add the control before copying the id so that > + * the numid field of the id is set in the copy. > + */ > + err = snd_ctl_add(card, kctl); > + if (err < 0) > + return err; > + > switch (idx) { > case ACTIVE_IDX: > setup->active_id = kctl->id; > @@ -1587,9 +1595,6 @@ static int loopback_mixer_new(struct loopback *loopback, int notify) > default: > break; > } > - err = snd_ctl_add(card, kctl); > - if (err < 0) > - return err; > } > } > } > -- > 2.26.3 >