[alsa-devel] [PATCH] ALSA: hda/jack - Also add jack kctls for Conexant codecs

Takashi Iwai tiwai at suse.de
Thu Dec 22 14:55:57 CET 2011


At Thu, 22 Dec 2011 12:21:55 +0000,
Mark Brown wrote:
> 
> On Wed, Dec 21, 2011 at 03:42:17PM +0100, Takashi Iwai wrote:
> 
> > Well, the kctl-jack part itself can't break anything right now since
> > it's used only in HD-audio.  If others will use, this will be a pure
> > addition, so it won't break except for possibly different ctl numids.
> 
> A pure addition can still cause problems as we roll out the same
> interface into other drivers, for example if there's assumptions that
> aren't generally true.

In later future, yes.  But I was talking about 3.3 kernel.

> > +void snd_kctl_jack_report(struct snd_card *card,
> > +			  struct snd_kcontrol *kctl, bool status)
> > +{
> > +	if (kctl->private_value == status)
> > +		return;
> > +	kctl->private_value = status;
> > +	snd_ctl_notify(card, SNDRV_CTL_EVENT_MASK_VALUE, &kctl->id);
> > +}
> > +EXPORT_SYMBOL_GPL(snd_kctl_jack_report);
> 
> So, this looks good in so far as it goes but obviously there's no
> semantics being defined here for the controls or their names.  That's
> more the bit that worries me as we'll get applications starting to use
> the new interface and they should have something consistent to work
> with.

Right.  We'll need a closer look back with the realistic use-cases.

> I'm guessing that as this is just a simple boolean each jack will have a
> series of controls like "Headset Jack Headphone" and "Headset Jack
> Microphone" or whatever and userspace should match them all together in
> the same way that it does for Volume and Switch controls?

My current assumption is so, too.  OTOH, if a single jack must provide
several values inevitably, it may take an integer or an enum, in
theory.  But I think (and hope) this wouldn't happen.

>  That sounds
> like it'll work well, we just need to define some strings for standard
> jacks and conections.

Yeah.  Unfortunately this standardization isn't always trivial,
especially when multiple jacks are present with the same type...

My idea is to give some association between this jack kctl and another
kctl, in a simple way like TLV.  But it's likely a new year's dream.


thanks,

Takashi


More information about the Alsa-devel mailing list