alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Hans de Goede <hdegoede@redhat.com>
Cc: Oder Chiou <oder_chiou@realtek.com>,
	alsa-devel@alsa-project.org, Takashi Iwai <tiwai@suse.de>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Bard Liao <bard.liao@intel.com>
Subject: Re: [RFC 2/2] ASoC: rt5670: Add LED trigger support
Date: Mon, 1 Mar 2021 20:43:13 +0000	[thread overview]
Message-ID: <20210301204313.GK4628@sirena.org.uk> (raw)
In-Reply-To: <54c5fd8e-1835-b9c3-d5fd-5cb363eab32c@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 2541 bytes --]

On Mon, Mar 01, 2021 at 08:49:34PM +0100, Hans de Goede wrote:
> On 3/1/21 8:15 PM, Mark Brown wrote:

> > Off the top of my head something like writing a control name into a
> > sysfs file might work, it doesn't scale if you need to use multiple
> > controls as rt5640 does though.

> Currently ALSA/UCM does not use sysfs files for anything, so this
> feels very inconsistent with how all the rest of this currently works.

Yes, you'd really want to add string controls in ALSA.

> > drivers make a list of all output stage mutes and then use that to build
> > a standard global mute control which functions similarly to this one and
> > could be force wired to the LED trigger input, seems like a big hammer
> > but it'd be reasonably consistent.

>         /* Speaker Output Volume */
>         SOC_DOUBLE("Speaker Channel Switch", RT5640_SPK_VOL,
>                 RT5640_VOL_L_SFT, RT5640_VOL_R_SFT, 1, 1),
>         SOC_DOUBLE_TLV("Speaker Playback Volume", RT5640_SPK_VOL,
>                 RT5640_L_VOL_SFT, RT5640_R_VOL_SFT, 39, 1, out_vol_tlv),

> Where userspace expect "Speaker Channel Switch" to be named
> "Speaker Playback Switch" (aligning it with the vol-control name)
> instead.

This isn't great but be aware that the control names stuff breaks down
very, very easily in the presence of general hardware - things like
multiple general purpose outputs can cause problems.

In any case a big hammer virtual control which mapped straight onto the
LED would sidestep some of that, though it does assume there are useful
mute controls in all the paths which may or may not be the case.

> And we cannot just rename this since the control names are
> used in UCM profiles and if a UCM profile refers to a non-existing
> control it won't work.

I thought UCM already had support for remapping control names?  It was
certainly something discussed very early on - a mechanism to allow the
UCM file to say "treat control X as name Y in this use case", where the
X used for Y might vary between use cases.

> I do know that we need to much more careful going forward to make sure
> that control names match the conventions expected by userspace.

That in general won't scale well, ideally we'd be exposing the routing
graph to userspace and annotating the non-DAPM controls onto that
routing graph so that userspace can figure out where everything sits -
that'd make several things a lot easier.  It does require somoene with
the time and enthusiasm to define a new ABI though which isn't something
you should hold your breath for.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2021-03-01 20:45 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-15 14:24 [RFC 0/2] ASoC: rt5670: Add LED trigger support Hans de Goede
2021-02-15 14:24 ` [RFC 1/2] ASoC: Add new SOC_DOUBLE*_ACCESS() macros Hans de Goede
2021-02-15 14:24 ` [RFC 2/2] ASoC: rt5670: Add LED trigger support Hans de Goede
2021-02-23 13:45   ` Mark Brown
2021-02-23 13:59     ` Hans de Goede
2021-02-23 14:09       ` Mark Brown
2021-02-23 14:21         ` Takashi Iwai
2021-02-23 16:14           ` Jaroslav Kysela
2021-02-23 16:20             ` Takashi Iwai
2021-02-23 20:56               ` Jaroslav Kysela
2021-02-24  7:12                 ` Takashi Iwai
2021-02-24  8:14                   ` Jaroslav Kysela
2021-02-24  8:52                     ` Takashi Iwai
2021-02-24  9:27                       ` Jaroslav Kysela
2021-02-24  9:38                         ` Takashi Iwai
2021-02-24  9:49                           ` Jaroslav Kysela
2021-02-24 10:33                             ` Takashi Iwai
2021-02-24 10:56                               ` Jaroslav Kysela
2021-02-24 11:43                                 ` Takashi Iwai
2021-02-24 12:08                                   ` Jaroslav Kysela
2021-02-24 12:42                                     ` Takashi Iwai
2021-02-24 17:57                                       ` Jaroslav Kysela
2021-02-25 11:00                                         ` Takashi Iwai
2021-02-25 18:09                                           ` Jaroslav Kysela
2021-02-26  8:41                                             ` Takashi Iwai
2021-02-26  9:22                                               ` Jaroslav Kysela
2021-02-23 17:07             ` Hans de Goede
2021-02-23 17:20             ` Mark Brown
2021-02-23 19:03               ` Hans de Goede
2021-02-24 12:59                 ` Mark Brown
2021-02-24 19:14                   ` Hans de Goede
2021-02-24 19:36                     ` Mark Brown
2021-02-24 20:09                       ` Hans de Goede
2021-02-25 14:59                         ` Mark Brown
2021-02-25 18:45                           ` Hans de Goede
2021-03-01 13:23                             ` Mark Brown
2021-03-01 13:39                               ` Hans de Goede
2021-03-01 19:15                                 ` Mark Brown
2021-03-01 19:49                                   ` Hans de Goede
2021-03-01 20:43                                     ` Mark Brown [this message]
2021-03-01 21:26                                       ` Hans de Goede
2021-03-02 12:41                                         ` Mark Brown
2021-03-02 21:14                                         ` Jaroslav Kysela
2021-03-04 19:39                                           ` Hans de Goede
2021-03-05 13:02                                             ` Jaroslav Kysela
2021-03-07 13:51                                               ` Hans de Goede

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210301204313.GK4628@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=bard.liao@intel.com \
    --cc=hdegoede@redhat.com \
    --cc=lgirdwood@gmail.com \
    --cc=oder_chiou@realtek.com \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).