DPCM: skip DAPM_STREAM_STOP event to BE, if still used by other FE
Quoted 4 lines
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 intoSNDRV_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?
A message that is not in the archive (sent off-list or not yet received): 1466749294.16718.1.camel@mtkswgap22
Quoted 1 line · KaiChieh Chuang
Is there any comment on this?
Please don't send content free pings and please allow a reasonable time for review. People get busy, go on holiday, attend conferences and so on so unless there is some reason for urgency (like critical bug fixes) please allow at least a couple of weeks for review. Sending content free pings just adds to the mail volume (if they are seen at all) and if something has gone wrong you'll have to resend the patches anyway.
Quoted 3 lines · Kai Chieh Chuang
The BE receiving
SND_SOC_DAPM_STREAM_STOPevent, while still used by a FE who is inSTREAM_STARTstate. The DAPM will just inactive BE related widget/dai without checking. This just doesn't seems right.
Why not? The backend is still active and running, why would it expect to be stopped unless it's supposed to actually stop?
Quoted 2 lines
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
Sure, until all the users stop using it it should stay running. What would you expect it to do?
A message that is not in the archive (sent off-list or not yet received): 1467599214.21156.2.camel@mtkswgap22
Quoted 7 lines · KaiChieh Chuang
Quoted 5 lines · Mark Brown
Quoted 3 lines · Kai Chieh Chuang
The BE receiving
SND_SOC_DAPM_STREAM_STOPevent, while still used by a FE who is inSTREAM_STARTstate. The DAPM will just inactive BE related widget/dai without checking. This just doesn't seems right.
Quoted 8 lines
Quoted 2 lines
Why not? The backend is still active and running, why would it expect to be stopped unless it's supposed to actually stop?
Yes, I don't expect it to stop.
But at this situation, the BE change to stateSTREAM_STOPwhile still used by a FE inSTREAM_STARTstate.Shouldn't the BE stay in the
STREAM_STARTstate?
Yes, but that sounded like the situation you were describing? It's really hard to follow what you're trying to say here, perhaps just send the fix you're proposing?