[alsa-devel] [PATCH 1/2 v2] ALSA: Add snd_ctl_update() to dynamically update a control

Raymond Yau superquad.vortex2 at gmail.com
Wed Mar 16 01:56:36 CET 2011


2011/3/15 Takashi Iwai <tiwai at suse.de>

> At Tue, 15 Mar 2011 15:17:58 +0100,
> Clemens Ladisch wrote:
> >
> > > +   up_write(&card->controls_rwsem);
> > > +   ret = snd_ctl_add(card, kcontrol);
> >
> > Doing this outside the semaphore doesn't look good.
>
> Using an internal function without semaphore would be preferred, yes.
>
> > I wonder whether snd_ctl_add() is the right function to use, because it
> > will assign a different numid event if the control didn't change.
>
> Hm, actually the function can compare whether it's really changed or
> not.  If any change, it makes really sense to assign a different
> numid.
>
>
>

does it mean that the driver can update "Input Source" controls for those
HDA codec on a motherboard with 3 audio jacks at rear panel ?

i.e. remove/add "Rear Mic" and "Line in" from/to "Input Source" when user
switch "channel_mode" between 2 and 6 or  switch"smart51" on/off


More information about the Alsa-devel mailing list