* Back-end state transition query
@ 2012-10-25 7:40 Patrick Lai
2012-10-25 17:59 ` Liam Girdwood
0 siblings, 1 reply; 3+ messages in thread
From: Patrick Lai @ 2012-10-25 7:40 UTC (permalink / raw)
To: Liam Girdwood; +Cc: alsa-devel
Hi Liam,
I am facing an issue related to how DPCM manages state of back-end
substream. Here is description of problem:
When front-end PCM substream is in paused state, back-end PCM substream
will be put in paused state as well if given front-end PCM substream is
the only client of given back-end. Based on current implementation of
DPCM, when application closes front-end PCM substream, DPCM framework
will not allow back-end enter HW_FREE state so back-end will never get
shutdown completely as well.
refer to function soc_dpcm_be_dai_hw_free(), here is the check for states
if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_PARAMS) &&
(be->dpcm[stream].state != SND_SOC_DPCM_STATE_PREPARE) &&
(be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_FREE) &&
(be->dpcm[stream].state != SND_SOC_DPCM_STATE_STOP))
continue;
Can't DPCM also allow back-end hardware being freed in STATE_PAUSED?
Even if DPCM expects trigger stop coming to update back-end state to
STATE_STOP, the following condition check will never allow back-end
enter stop state anyway
Refer to soc_dpcm_be_dai_trigger()
case SNDRV_PCM_TRIGGER_STOP:
if (be->dpcm[stream].state != SND_SOC_DPCM_STATE_START)
continue;
Can you please take a look and recommend the appropriate state
transition or it would be okay to allow PAUSED state in
soc_dpcm_be_dai_hw_free()?
Thanks
Patrick
--
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Back-end state transition query
2012-10-25 7:40 Back-end state transition query Patrick Lai
@ 2012-10-25 17:59 ` Liam Girdwood
2012-10-29 0:24 ` Patrick Lai
0 siblings, 1 reply; 3+ messages in thread
From: Liam Girdwood @ 2012-10-25 17:59 UTC (permalink / raw)
To: Patrick Lai; +Cc: alsa-devel
Hi Patrick,
On 25/10/12 08:40, Patrick Lai wrote:
> Hi Liam,
>
> I am facing an issue related to how DPCM manages state of back-end
> substream. Here is description of problem:
>
> When front-end PCM substream is in paused state, back-end PCM substream
> will be put in paused state as well if given front-end PCM substream is
> the only client of given back-end. Based on current implementation of
> DPCM, when application closes front-end PCM substream, DPCM framework
> will not allow back-end enter HW_FREE state so back-end will never get
> shutdown completely as well.
>
> refer to function soc_dpcm_be_dai_hw_free(), here is the check for states
>
> if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_PARAMS) &&
> (be->dpcm[stream].state != SND_SOC_DPCM_STATE_PREPARE) &&
> (be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_FREE) &&
> (be->dpcm[stream].state != SND_SOC_DPCM_STATE_STOP))
> continue;
>
> Can't DPCM also allow back-end hardware being freed in STATE_PAUSED?
This seems like a bug. We should hw_free() the BE here.
> Even if DPCM expects trigger stop coming to update back-end state to STATE_STOP, the following condition check will never allow back-end enter stop state anyway
>
> Refer to soc_dpcm_be_dai_trigger()
>
> case SNDRV_PCM_TRIGGER_STOP:
> if (be->dpcm[stream].state != SND_SOC_DPCM_STATE_START)
> continue;
>
> Can you please take a look and recommend the appropriate state transition or it would be okay to allow PAUSED state in soc_dpcm_be_dai_hw_free()?
It should be OK to allow the paused state in hw_free(), but I'm thinking we should probably see the trigger stop when we close the FE (although I'm not 100% certain atm of seeing the STOP as I've not traced this PAUSE -> CLOSE sequence). I assume you have a patch that allows this ?
Thanks
Liam
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Back-end state transition query
2012-10-25 17:59 ` Liam Girdwood
@ 2012-10-29 0:24 ` Patrick Lai
0 siblings, 0 replies; 3+ messages in thread
From: Patrick Lai @ 2012-10-29 0:24 UTC (permalink / raw)
To: Liam Girdwood; +Cc: alsa-devel
On 10/25/2012 10:59 AM, Liam Girdwood wrote:
Hi Liam,
> It should be OK to allow the paused state in hw_free(), but I'm thinking we should probably see the trigger stop when we close the FE (although I'm not 100% certain atm of seeing the STOP as I've not traced this PAUSE -> CLOSE sequence).
I am also surprised to see that trigger stop never comes. I can dig in
more to figure out why.
I assume you have a patch that allows this ?
Yes, I will publish to alsa-devel
Thanks
Patrick
>
> Thanks
>
> Liam
>
>
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>
--
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-10-29 0:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-25 7:40 Back-end state transition query Patrick Lai
2012-10-25 17:59 ` Liam Girdwood
2012-10-29 0:24 ` Patrick Lai
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).