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 D9E69C38142 for ; Tue, 31 Jan 2023 08:43:16 +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 1FD8EE79; Tue, 31 Jan 2023 09:42:24 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 1FD8EE79 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1675154594; bh=Pl1T/cKheKdr8IKPdNwYvfgQ4bj/gBweVuiywijjsKw=; h=Date:From:To:Subject:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=I/ENZq80D5V0p8y3KCZKjnksxjQVta7QjtmDPETfEOB8dvrpoE9mR97iu0d7zzfnC Xh0zhNvaNe71J3mK3JXu/paRpD1qv3L4XyIqMLEAUI/phsnRwOrLcXgxCd4D1CKqSg kAqDctmqoiva0cfrWEDjK++kxM0IAgYKT8kbOZlc= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 40C44F80245; Tue, 31 Jan 2023 09:42:23 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 959F6F804C2; Tue, 31 Jan 2023 09:42:21 +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 13F47F80169 for ; Tue, 31 Jan 2023 09:42:17 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 13F47F80169 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=bAZZ3DT6; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=Ijb/M36D 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 43C112044A; Tue, 31 Jan 2023 08:42:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1675154537; 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=6IzR7OIYzC8EYOZdG4b7A56eKO0AXznAEjTYVO2Q9r8=; b=bAZZ3DT6egOxwAJx+GkZJBuuI94wJD2Ijgd9fscIUOQZFwaTD1l14y817bgd1Z0Z8qzAtW NM4jfDtO6JNAGxnScUVL6ToBGMGMPIZBeXr3rOlpZxBknx/9AnXhmDwxF19ILUfBGGkYQv wPPPm2/2QGVQSxVTbkhA2B07SgDzUj8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1675154537; 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=6IzR7OIYzC8EYOZdG4b7A56eKO0AXznAEjTYVO2Q9r8=; b=Ijb/M36DVaIAU1p6ftT1NLQ/sxPS2yDx8VEcikwG1tlrVhcpjQLkePsMdnl2rqmtfPmL75 qxML3w30xB7YX1DA== 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 2BDE213585; Tue, 31 Jan 2023 08:42:17 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id qPEECmnU2GODHQAAMHmgww (envelope-from ); Tue, 31 Jan 2023 08:42:17 +0000 Date: Tue, 31 Jan 2023 09:42:16 +0100 Message-ID: <87mt5zp02f.wl-tiwai@suse.de> From: Takashi Iwai To: Jaroslav Kysela Subject: Re: [PATCH] [RFC] ALSA: hda: Fix the control element identification for multiple codecs In-Reply-To: <20230130082118.3267980-1-perex@perex.cz> References: <20230130082118.3267980-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 Mon, 30 Jan 2023 09:21:18 +0100, Jaroslav Kysela wrote: > > [This is a RFC for the discussion] > > 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. > > 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 > > -- > > Discussion: > > There are several possibilities to handle the old behaviour - a kernel > module parameter (proposed), a kernel configuration option or drop > the old behaviour completely. Dropping is likely no-go, as we don't even know whether it really breaks or is safe, I suppose. The module option sounds like a feasible workaround, maybe with the default behavior defined by kconfig. And we can put some message for the old behavior to mention it'll be deprecated, for example. Then after some time, we can really drop the old behavior, too. One more question is which driver provides the option. Does this problem happen with SOF HDA driver, too? thanks, Takashi