All of lore.kernel.org
 help / color / mirror / Atom feed
* Using sync dapm_sync in stream_event call back
@ 2012-11-07  9:53 Babu, Ramesh
  2012-11-07 14:47 ` Mark Brown
  0 siblings, 1 reply; 4+ messages in thread
From: Babu, Ramesh @ 2012-11-07  9:53 UTC (permalink / raw)
  To: alsa-devel@alsa-project.org; +Cc: Mark Brown, Liam Girdwood

Hi

In my machine driver, I need to disable a widget in stream_event call back.
I realized that I cannot invoke dapm_sync() inside the stream_event, because it causes recursive lock.

How can I disable a pin (widget) inside stream_event call back?

Thanks
Ramesh

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Using sync dapm_sync in stream_event call back
  2012-11-07  9:53 Using sync dapm_sync in stream_event call back Babu, Ramesh
@ 2012-11-07 14:47 ` Mark Brown
  2012-11-08  4:28   ` Babu, Ramesh
  0 siblings, 1 reply; 4+ messages in thread
From: Mark Brown @ 2012-11-07 14:47 UTC (permalink / raw)
  To: Babu, Ramesh; +Cc: alsa-devel@alsa-project.org, Liam Girdwood


[-- Attachment #1.1: Type: text/plain, Size: 444 bytes --]

On Wed, Nov 07, 2012 at 09:53:14AM +0000, Babu, Ramesh wrote:

> In my machine driver, I need to disable a widget in stream_event call back.
> I realized that I cannot invoke dapm_sync() inside the stream_event, because it causes recursive lock.

> How can I disable a pin (widget) inside stream_event call back?

This doesn't sound like something that really makes sense within the
model DAPM has.  What are you actually trying to accomplish?

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Using sync dapm_sync in stream_event call back
  2012-11-07 14:47 ` Mark Brown
@ 2012-11-08  4:28   ` Babu, Ramesh
  2012-11-09 13:26     ` Mark Brown
  0 siblings, 1 reply; 4+ messages in thread
From: Babu, Ramesh @ 2012-11-08  4:28 UTC (permalink / raw)
  To: Mark Brown; +Cc: alsa-devel@alsa-project.org, Liam Girdwood

>> In my machine driver, I need to disable a widget in stream_event call back.
>> I realized that I cannot invoke dapm_sync() inside the stream_event, because it
>causes recursive lock.
>
>> How can I disable a pin (widget) inside stream_event call back?
>
>This doesn't sound like something that really makes sense within the model
>DAPM has.  What are you actually trying to accomplish?

App is re-routing the audio within codec by changing mixer settings (for a same stream/device).
When app changes a MUX mixer settings, temporarily DAPM path gets broken and shut downs BIAS/CLOCK.
I was planning to use a Virtual Widget which I enable in my open and disable it during stream_event(STREAM_STOP).
This is to make sure BIAS/CLOCK will never shut down, as long as stream is active.
I'm not sure if this is correct way to do it. Any inputs?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Using sync dapm_sync in stream_event call back
  2012-11-08  4:28   ` Babu, Ramesh
@ 2012-11-09 13:26     ` Mark Brown
  0 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2012-11-09 13:26 UTC (permalink / raw)
  To: Babu, Ramesh; +Cc: alsa-devel@alsa-project.org, Liam Girdwood


[-- Attachment #1.1: Type: text/plain, Size: 1686 bytes --]

On Thu, Nov 08, 2012 at 04:28:43AM +0000, Babu, Ramesh wrote:

Fix your mailer to word wrap within paragraphs, not doing this makes
your messages extremely hard to read.  I've reflowed your text for
legibility.

> App is re-routing the audio within codec by changing mixer settings
> (for a same stream/device).  When app changes a MUX mixer settings,
> temporarily DAPM path gets broken and shut downs BIAS/CLOCK.  I was
> planning to use a Virtual Widget which I enable in my open and disable
> it during stream_event(STREAM_STOP).  This is to make sure BIAS/CLOCK
> will never shut down, as long as stream is active.  I'm not sure if
> this is correct way to do it. Any inputs?

Open coding this at the driver level is not particularly sensible, there
is nothing driver specific about this as the same issue will apply to
any device.  It seems like a useful feature to add but should be at the
subsystem level.  Off the top of my head the simplest approach is likely
to be to add another timeout similar to the pop timer which we use to
keep supplies and biases running a little longer after their users have
been powered down.

I would at some point like to get something in the userspace API that
allows atomic updates of many controls (freeze the device, update the
controls and then unfreeze as one) which would also cover this but is
much more work.

If you are going to do this as a local hack this isn't a good way to do
it.  You should be driving the state transitions from the application
level so enabling your virtual widget before you do anything, doing your
changes and then disabling it when you're done.  This will cover a wider
range of use cases much more robustly.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-11-09 13:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-07  9:53 Using sync dapm_sync in stream_event call back Babu, Ramesh
2012-11-07 14:47 ` Mark Brown
2012-11-08  4:28   ` Babu, Ramesh
2012-11-09 13:26     ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.