* How to trigger a widget?
@ 2012-02-20 7:13 Wang, Kuirong
2012-02-20 9:07 ` Lars-Peter Clausen
0 siblings, 1 reply; 6+ messages in thread
From: Wang, Kuirong @ 2012-02-20 7:13 UTC (permalink / raw)
To: alsa-devel@alsa-project.org
As I saw many examples to use the snd_soc_dapm_enable_pin() to trigger a particular widget. But I saw the widget has to be like a speaker, mic, lineout, etc. Could I use the snd_soc_dapm_enable_pin() to trigger any type of widget I want? I tried to use it to trigger a supply widget, but I never see it works even I did snd_soc_dapm_sync() after the enable_pin. Could someone provide some inputs?
Appreciated your time.
Thanks,
Kuirong Wang
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: How to trigger a widget?
2012-02-20 7:13 How to trigger a widget? Wang, Kuirong
@ 2012-02-20 9:07 ` Lars-Peter Clausen
2012-02-21 5:09 ` Wang, Kuirong
0 siblings, 1 reply; 6+ messages in thread
From: Lars-Peter Clausen @ 2012-02-20 9:07 UTC (permalink / raw)
To: Wang, Kuirong; +Cc: alsa-devel@alsa-project.org
On 02/20/2012 08:13 AM, Wang, Kuirong wrote:
> As I saw many examples to use the snd_soc_dapm_enable_pin() to trigger a particular widget. But I saw the widget has to be like a speaker, mic, lineout, etc. Could I use the snd_soc_dapm_enable_pin() to trigger any type of widget I want? I tried to use it to trigger a supply widget, but I never see it works even I did snd_soc_dapm_sync() after the enable_pin. Could someone provide some inputs?
>
> Appreciated your time.
>
> Thanks,
>
> Kuirong Wang
Hi,
snd_soc_dapm_force_enable_pin is probably what you are looking for.
- Lars
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: How to trigger a widget?
2012-02-20 9:07 ` Lars-Peter Clausen
@ 2012-02-21 5:09 ` Wang, Kuirong
2012-02-21 21:06 ` Lars-Peter Clausen
2012-02-22 7:28 ` Peter Ujfalusi
0 siblings, 2 replies; 6+ messages in thread
From: Wang, Kuirong @ 2012-02-21 5:09 UTC (permalink / raw)
To: Lars-Peter Clausen; +Cc: alsa-devel@alsa-project.org
On 02/20/2012 1:08 AM, Lars-Peter Clausen wrote:
>
>Hi,
>
>snd_soc_dapm_force_enable_pin is probably what you are looking for.
>
>- Lars
Thanks Lars. I tried the snd_soc_dapm_force_enable_pin, it didn't make different.
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.
Thanks,
- Kuirong
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: How to trigger a widget?
2012-02-21 5:09 ` Wang, Kuirong
@ 2012-02-21 21:06 ` Lars-Peter Clausen
2012-02-22 7:28 ` Peter Ujfalusi
1 sibling, 0 replies; 6+ messages in thread
From: Lars-Peter Clausen @ 2012-02-21 21:06 UTC (permalink / raw)
To: Wang, Kuirong; +Cc: alsa-devel@alsa-project.org
On 02/21/2012 06:09 AM, Wang, Kuirong wrote:
> On 02/20/2012 1:08 AM, Lars-Peter Clausen wrote:
>>
>> Hi,
>>
>> snd_soc_dapm_force_enable_pin is probably what you are looking for.
>>
>> - Lars
>
> Thanks Lars. I tried the snd_soc_dapm_force_enable_pin, it didn't make different.
>
> 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.
>
I'm not quite sure if I understand what you want to do, but a
snd_soc_dapm_force_enable_pin followed by a snd_soc_dapm_sync should enable a
widget regardless of whether it is currently in use or not.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: How to trigger a widget?
2012-02-21 5:09 ` Wang, Kuirong
2012-02-21 21:06 ` Lars-Peter Clausen
@ 2012-02-22 7:28 ` Peter Ujfalusi
2012-02-24 4:57 ` Wang, Kuirong
1 sibling, 1 reply; 6+ messages in thread
From: Peter Ujfalusi @ 2012-02-22 7:28 UTC (permalink / raw)
To: Wang, Kuirong; +Cc: alsa-devel@alsa-project.org, Lars-Peter Clausen
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: How to trigger a widget?
2012-02-22 7:28 ` Peter Ujfalusi
@ 2012-02-24 4:57 ` Wang, Kuirong
0 siblings, 0 replies; 6+ messages in thread
From: Wang, Kuirong @ 2012-02-24 4:57 UTC (permalink / raw)
To: Peter Ujfalusi; +Cc: alsa-devel@alsa-project.org, Lars-Peter Clausen
On 02/21/2012 11:28 PM, Peter Ujfalusi wrote:
>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
Peter,
I don't want to power on this circuit related to the feature if the audio stream is not playing so if I use the kcontrol callback function to do so, it could power up even the audio stream is not playing.
I will try the way you suggested by using a switch. In the meanwhile, I will check why the enable_pin doesn't work as expected in my system.
Thanks!
Kuirong
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-02-24 4:57 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-20 7:13 How to trigger a widget? Wang, Kuirong
2012-02-20 9:07 ` Lars-Peter Clausen
2012-02-21 5:09 ` Wang, Kuirong
2012-02-21 21:06 ` Lars-Peter Clausen
2012-02-22 7:28 ` Peter Ujfalusi
2012-02-24 4:57 ` Wang, Kuirong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).