[alsa-devel] How to trigger a widget?

Peter Ujfalusi peter.ujfalusi at ti.com
Wed Feb 22 08:28:01 CET 2012


Hi,

On 02/21/2012 07:09 AM, Wang, Kuirong wrote:
> I have kcontrol to enable a function of codec on fly.  With or
> without the function, it cannot impact the established audio routing.
> So I created widget as a supply, as long as the audio path is
> established, this supply widget is triggered. The supply widget has a
> callback event function.  The kcontrol control has an event callback
> function as well which calls the enable/disable pin to trigger the
> widget callback event, so this particular function can be enabled or
> disabled.

Would not it be simpler if you just enable/disable the feature in the
kcontrol's set callback?

Another way I would go is this:

                  |-> (off) ---------|
[Feature switch] -|                  |-> [next widget]
                  |-> (on) -> [PGA] -|

In the PGA you turn on/off the feature. If the switch changes it will
not affect other items in the path, it will only make the PGA to turn
on/off.

-- 
Péter


More information about the Alsa-devel mailing list