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=-3.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,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 92191C433C1 for ; Tue, 23 Mar 2021 09:50:54 +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 3E79461931 for ; Tue, 23 Mar 2021 09:50:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3E79461931 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 20DC79F6; Tue, 23 Mar 2021 10:50:01 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 20DC79F6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1616493051; bh=TJqPrjn9H6Frg79OPCVBVhQlOf6EQDt3Av1+cmxEzKo=; h=Date:From:To:Subject:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=j4bHKT4hUrVWTISsdI8Oej8wb5kfcXjBkNijkYG3rFC9LU8cj802aHVvcXuTxr8SH 7Pvw8jsSwScRtXtEYianwSpQMyGOFIXhT1CELLF8QhLXHWTbH0woI3JcqAht236q8C 8nCEd19yw7hyGx4+7Yw0owdy+1NrANN0AapU2KXA= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 96AA3F80104; Tue, 23 Mar 2021 10:50:00 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id E713CF8025F; Tue, 23 Mar 2021 10:49:58 +0100 (CET) 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 76F03F80104 for ; Tue, 23 Mar 2021 10:49:50 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 76F03F80104 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 17636AD80; Tue, 23 Mar 2021 09:49:50 +0000 (UTC) Date: Tue, 23 Mar 2021 10:49:49 +0100 Message-ID: From: Takashi Iwai To: Jaroslav Kysela Subject: Re: [PATCH v4 6/6] ALSA: led control - add sysfs kcontrol LED marking layer In-Reply-To: References: <20210317172945.842280-1-perex@perex.cz> <20210317172945.842280-7-perex@perex.cz> <3820909c-29ce-9f3f-d1e6-c4611e06abe4@redhat.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: Curtis Malainey , Hans de Goede , ALSA development , Mark Brown , Dylan Reid 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 Tue, 23 Mar 2021 10:38:46 +0100, Takashi Iwai wrote: > > On Mon, 22 Mar 2021 15:16:30 +0100, > Jaroslav Kysela wrote: > > > > Dne 20. 03. 21 v 10:48 Takashi Iwai napsal(a): > > > > >> With other OS you mean e.g. Android? Android has device-specific > > >> init-scripts which can either call alsactl or directly do the > > >> echo-s. > > > > > > Also ChromeOS. I'd like to get a general consensus before moving > > > forward. > > > > Where are ChromeOS people? They could join to the discussion which is floating > > few months now. Perhaps, the gmail's spam filter does not allow them to > > communicate with us ;-) > > Also adding Dylan and Mark to Cc. > > FYI, the patch set is: > https://lore.kernel.org/alsa-devel/20210317172945.842280-1-perex@perex.cz/ ... and now back to the topic. So the primary question is whether we want the sysfs entries to allow user-space defining the mute-LED vs control binding externally. With this, the mute LED is supposed to be set up via udev rules that triggers some alsactl stuff, and the rest is handled in an extension in UCM profile. If this approach is acceptable on all platforms, we can go for it. That was the question to other platforms like Android and ChromeOS. And, now looking into the details, I have a few more questions: - The binding with SNDRV_CTL_ELEM_* bit flag is handy for some drivers but not for everything; e.g. if we want to add the binding in ASoC machine driver, an API like snd_ctl_bind_mute_led(card, elem_id, inverted); would be easier. It'd be essentially an internal call of the sysfs binding. (I haven't checked, but might this be also more straightforward conversion for HD-audio case, too?) - The binding in the kernel could (should?) be shown in the sysfs output. Currently it seems handled differently? - Specifying the numid may the code simpler in kernel side? alsactl has already the string parser. - Do we have to deal with binding with multiple controls to a single mute LED? Might a single exclusive binding make things easier? Then we don't have to create sysfs entries per card, and it'll be something like echo 1:10 > /sys/devices/virtual/sound/ctl-led/mic/bind which is equivalent with the API call above. If multiple bindings are attempted, it can simply give an error. In the driver side, it catches the unexpected binding, too. thanks, Takashi