[alsa-devel] DPCM: skip DAPM_STREAM_STOP event to BE, if still used by other FE

Kai Chieh Chuang kaichieh.chuang at mediatek.com
Sun Jun 5 08:58:59 CEST 2016


> If this isn't happening that seems like a bug, I'm a bit surprised
> nobody else ran into it?  Shouldn't the counts of stream events that
> happen be symmetric (ie, we get as many stops as starts), or are we
> possibly missing some from things being switched in and out or
something?

This idea is same as the DPCM BE state control, in

int dpcm_be_dai_hw_free(..)
{
......
                /* do not free hw if this BE is used by other FE */
                if (be->dpcm[stream].users > 1)
                        continue;

and

int dpcm_be_dai_shutdown(...)
{
....
                if (--be->dpcm[stream].users != 0)
                        continue;

The BE receiving SND_SOC_DAPM_STREAM_STOP event, while still used by a
FE who is in STREAM_START state. The DAPM will just inactive BE related
widget/dai without checking. This just doesn't seems right.

And the last FE using the BE calls in to dpcm_fe_dai_shutdown(), will
run the process normally.


Actually, i trace the log, when one of the FE sent stop event to "still
in use BE", the BE power state will not be changed. Until the system
goes into
SNDRV_CTL_POWER_D3cold, the BE will be shutdown (i did set the
ignore_suspend=1). I didn't check why the BE is not turned off at the
point when receiving the stop event.

I'm also curious why no one seems to have the same issue. Probably there
is not much DPCM architecture system yet on the Linux?



More information about the Alsa-devel mailing list