From: Takashi Iwai <tiwai@suse.de>
To: "Jie, Yang" <yang.jie@intel.com>
Cc: Liam Girdwood <liam.r.girdwood@linux.intel.com>,
Tanu Kaskinen <tanu.kaskinen@linux.intel.com>,
"broonie@kernel.org" <broonie@kernel.org>,
"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
"Girdwood, Liam R" <liam.r.girdwood@intel.com>
Subject: Re: [PATCH v3 1/2] ALSA: jack: create jack kcontrols for every jack input device
Date: Wed, 25 Mar 2015 07:13:06 +0100 [thread overview]
Message-ID: <s5hoanhhafh.wl-tiwai@suse.de> (raw)
In-Reply-To: <E7B1D079BA13FB44A978CC8F69C7D6A901BDD602@SHSMSX101.ccr.corp.intel.com>
At Wed, 25 Mar 2015 04:11:28 +0000,
Jie, Yang wrote:
>
> > -----Original Message-----
> > From: Takashi Iwai [mailto:tiwai@suse.de]
> > Sent: Monday, March 23, 2015 7:57 PM
> > To: Tanu Kaskinen
> > Cc: Jie, Yang; broonie@kernel.org; alsa-devel@alsa-project.org; Girdwood,
> > Liam R; Liam Girdwood
> > Subject: Re: [PATCH v3 1/2] ALSA: jack: create jack kcontrols for every jack
> > input device
> >
> > At Mon, 23 Mar 2015 12:08:17 +0200,
> > Tanu Kaskinen wrote:
> > >
> > > On Sat, 2015-03-21 at 02:22 +0000, Jie, Yang wrote:
> > > > > As you'll find through the whole output, many calls are combined
> > > > > with
> > > > > SND_JACK_BTN_* bits. And think again how this will result with your
> > patch.
> > > > > A call like
> > > > >
> > > > > snd_soc_card_jack_new(card, "Headphone",
> > > > > SND_JACK_HEADPHONE | SND_JACK_BTN_0 |
> > SND_JACK_BTN_1, ...)
> > > > >
> > > > > would give three kctls, all "Headphone Jack" with indices 0, 1 and 2.
> > > > > How user-space knows what is for what?
> > > > [Keyon] yes, this is an issue I was thinking about, we need
> > > > discussing and conclusion about that, including comments from user-
> > space, here adding Tanu.
> > > > Here I am thinking about
> > > > 1. do we really need kctls for buttons(SND_JACK_BTN_n)? if no, that
> > > > is simplest, we can filter out them at this kctl creating stage.
> > > > 2. if yes, then we need an name regenerator here, to generate
> > > > understandable (for user-space) kctl names for buttons.
> > >
> > > >From PulseAudio point of view, you must make sure that "Headphone
> > Jack"
> > > with index 0 doesn't refer to a button, because the assumption is that
> > > "Headphone Jack" at index 0 refers to a jack and not a button (indexes
> > > other than 0 are currently ignored). Other than that, PulseAudio
> > > doesn't currently care, because there's no support for buttons.
> > >
> > > When thinking about how to implement button support in PulseAudio, the
> > > first question is that are kcontrols a realiable interface for getting
> > > button events? What happens when the button is pressed? Does one
> > press
> > > cause only one on->off or off->on state transition, or is the state "on"
> > > only for the duration of the press? If the former, then kcontrols
> > > should be fine, but if the latter, is it guaranteed that the
> > > application sees the event? If the button press is a short one,
> > > causing a quick
> > > off->on->off transition, is it possible that the application gets a
> > > notification of a mixer change, but when the application then inspects
> > > the mixer state, the button state is already "off", so the application
> > > doesn't get enough information about what happened?
> >
> > It's a good point. The notification via kctl can't follow the complete state
> > changes since it's nothing but a notification telling "something changed". So,
> > events like buttons that need the complete state change history, the current
> > implementation isn't appropriate.
> > For things like jacks, we usually care only about the final state, and the state
> > change is much less frequent, so kctl notification works well.
> [Keyon] Agree that we don't need create kctl for button(just leave it to input
> event notification/handler), then I can update patch to filter out them at kctl
> creating stage, which may make life easier IMO. :)
>
> BTW, Takashi, according to what Tanu mentioned, kctls indexes other than 0
> are currently ignored by PA, so creating and exporting kctls with non-zero
> indices for the same name in HD-Audio Jack before, seems no use for upper
> layer?
No "big" use. Who knows.
But I don't mind to convert the usage of index number in hda_jack.c to
a unique string instead so that the name can be used for both input
and kctl jacks.
Takashi
next prev parent reply other threads:[~2015-03-25 6:13 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-20 15:39 [PATCH v3 0/2] ALSA: jack: Refactoring for jack kctls Jie Yang
2015-03-20 15:39 ` [PATCH v3 1/2] ALSA: jack: create jack kcontrols for every jack input device Jie Yang
2015-03-20 16:17 ` Takashi Iwai
2015-03-21 2:22 ` Jie, Yang
2015-03-21 7:46 ` Takashi Iwai
2015-03-23 10:08 ` Tanu Kaskinen
2015-03-23 11:57 ` Takashi Iwai
2015-03-23 14:57 ` Mark Brown
2015-03-25 4:11 ` Jie, Yang
2015-03-25 5:27 ` Raymond Yau
2015-03-25 6:13 ` Takashi Iwai [this message]
2015-03-20 15:39 ` [PATCH v3 2/2] ALSA: hda - Remove jack kctls Jie Yang
2015-03-20 16:21 ` Takashi Iwai
2015-03-21 0:23 ` Jie, Yang
2015-03-23 9:18 ` [PATCH v3 0/2] ALSA: jack: Refactoring for " David Henningsson
2015-03-23 15:00 ` Mark Brown
2015-03-23 15:09 ` Takashi Iwai
2015-03-23 16:35 ` Mark Brown
2015-03-23 16:38 ` Takashi Iwai
2015-03-23 16:52 ` Mark Brown
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=s5hoanhhafh.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=liam.r.girdwood@intel.com \
--cc=liam.r.girdwood@linux.intel.com \
--cc=tanu.kaskinen@linux.intel.com \
--cc=yang.jie@intel.com \
/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