[alsa-devel] Using sync dapm_sync in stream_event call back
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
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?
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?
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.
participants (2)
-
Babu, Ramesh
-
Mark Brown