[alsa-devel] [PATCH v2 1/2] ALSA: jack: create jack kcontrols for every jack input device

Takashi Iwai tiwai at suse.de
Fri Mar 20 13:26:39 CET 2015


At Fri, 20 Mar 2015 12:22:10 +0000,
Jie, Yang wrote:
> 
> > > +}
> > > +
> > > +static int snd_jack_new_kctl(struct snd_card *card, struct snd_jack
> > > +*jack, int type) {
> > > +	struct snd_kcontrol *kctl;
> > > +	struct snd_jack_kctl *jack_kctl;
> > > +	int i, err, index, state = 0 /* use 0 for default state ?? */;
> > > +
> > > +	INIT_LIST_HEAD(&jack->kctl_list);
> > > +	for (i = 0; i < fls(SND_JACK_BTN_0); i++) {
> > > +		int testbit = 1 << i;
> > > +		if (type & testbit) {
> > 
> > With this implementation, you'll get multiple boolean kctls for a headset.  I
> > thought we agreed with creating a single boolean for headset?
> [Keyon] We agreed with creating multiple kctls for combo jack, e.g. headset.
> Furthermore, e.g., imagine that type = SND_JACK_HEADSET  | SND_JACK_BTN_0,
> we will create 3 kctls for the jack, when BTN_0 is pressed, we will report to
> the 3rd kctl.

Hm, I don't remember that I agreed with multiple kctls...

The multiple kctls have a significant drawback (multiple event calls
for a single headset) and its behavior is incompatible with the
current code (both the name change and the behavior change).  That is,
your patch will very likely break the existing applications.


Takashi


More information about the Alsa-devel mailing list