[alsa-devel] Back-end state transition query

Patrick Lai plai at codeaurora.org
Thu Oct 25 09:40:34 CEST 2012

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))

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()

      if (be->dpcm[stream].state != SND_SOC_DPCM_STATE_START)

Can you please take a look and recommend the appropriate state 
transition or it would be okay to allow PAUSED state in 


Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

More information about the Alsa-devel mailing list