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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 87F20C636CD for ; Wed, 1 Feb 2023 14:41:49 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 0F3D014E; Wed, 1 Feb 2023 15:40:57 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 0F3D014E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1675262507; bh=sboV0d3KE4vS2A5TchEIgrmXUWTsjgtgxd83VvnKuyk=; h=Date:From:To:Subject:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=jjuNUnIzPSWMPuOib4JQVx5R0z4ChrVCleaOq6VY6+BSs8ku+AhMc8mJ6DrpEiMdl oX1GOnkiG3TrryEhDwm46nf2TT2SP22aJINvk6gdtsG86VgiCf3Xhvj9e5pjfWa8Hb mhFjn+/7Yn7G8Q1CoHpVviXXMFefs/TQs57cpWJQ= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id A5959F80423; Wed, 1 Feb 2023 15:40:56 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id D3B7EF80423; Wed, 1 Feb 2023 15:40:54 +0100 (CET) Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 4E298F80155 for ; Wed, 1 Feb 2023 15:40:48 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 4E298F80155 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=VuYCO/hy; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=uOFchL3Y Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 6C5771F74C; Wed, 1 Feb 2023 14:40:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1675262448; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=dbkAWc1GcMQCXbhZyx9K0C0Lot9OFTHCrFsoR2YlIVA=; b=VuYCO/hye1t4+wVVvz23a3x1J+nULW6pEvtawntwhRgA8mWloU56n50KSJ4GnuGZ+FT/Jp MHgv1miyfvXs03GoF+dGqmgT481ISiouWmbVbcwTVxkPpjaCE9otelq5kZ59ruZz0vof8K VtJ4iA+Qvz9rk+UG91EhcyRRDQ//ms8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1675262448; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=dbkAWc1GcMQCXbhZyx9K0C0Lot9OFTHCrFsoR2YlIVA=; b=uOFchL3YOFAodSL7shIcTf4KuKV2ZBuFLwgzDciFjcOQD8tmI+mtmcNz30dSmftGLYmb2N kSnPEXiHGbxxaoCw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 627361348C; Wed, 1 Feb 2023 14:40:48 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id o8yjF/B52mOIewAAMHmgww (envelope-from ); Wed, 01 Feb 2023 14:40:48 +0000 Date: Wed, 01 Feb 2023 15:40:48 +0100 Message-ID: <87ilglwirz.wl-tiwai@suse.de> From: Takashi Iwai To: Jaroslav Kysela Subject: Re: [PATCH] ALSA: hda: Fix the control element identification for multiple codecs In-Reply-To: <20230131094215.3545993-1-perex@perex.cz> References: <20230131094215.3545993-1-perex@perex.cz> User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/27.2 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 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: , Cc: ALSA development Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On Tue, 31 Jan 2023 10:42:15 +0100, Jaroslav Kysela wrote: > > Some motherboards have multiple HDA codecs connected to the serial bus. > The current code may create multiple mixer controls with the almost > identical identification. > > The current code use id.device field from the control element structure > to store the codec address to avoid such clashes for multiple codecs. > Unfortunately, the user space do not handle this correctly. For mixer > controls, only name and index are used for the identifiers. > > This patch fixes this problem to compose the index using the codec > address as an offset in case, when the control already exists. It is > really unlikely that one codec will create 10 similar controls. > > This patch adds new kernel module parameter 'ctl_dev_id' to allow > select the old behaviour, too. The CONFIG_SND_HDA_CTL_DEV_ID Kconfig > option sets the default value. > > BugLink: https://github.com/alsa-project/alsa-lib/issues/294 > BugLink: https://github.com/alsa-project/alsa-lib/issues/205 > Fixes: 54d174031576 ("[ALSA] hda-codec - Fix connection list parsing") > Fixes: 1afe206ab699 ("ALSA: hda - Try to find an empty control index when it's occupied") > Signed-off-by: Jaroslav Kysela > > -- > > rfc..v1: > - added CONFIG_SND_HDA_CTL_DEV_ID Kconfig option Looks almost fine. One thing would be to just make it a single option instead of array. This behavior should be consistent on the whole system, not specific to a certain chip, after all, and the array option is error-prone. thanks, Takashi