Skip to content

Commit 24c0264

Browse files
committed
ASoC: soc-compress: Stop running dpcm on free
If the last trigger that the compr device received is a DRAIN then the DPCM is left in running state (no stop trigger is sent). Before we execute the free we need to send a STOP trigger to make sure that both BE and FE is in expected state and prepared for closing. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
1 parent bc8f6ba commit 24c0264

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

sound/soc/soc-compress.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,16 @@ static int soc_compr_free_fe(struct snd_compr_stream *cstream)
207207
struct snd_soc_dpcm *dpcm;
208208
int stream = cstream->direction; /* SND_COMPRESS_xxx is same as SNDRV_PCM_STREAM_xxx */
209209

210+
/*
211+
* The core will not send a STOP trigger on free if the device is in
212+
* DRAIN state, but we need to stop BE and FE before we can proceed to
213+
* free the stream.
214+
* Run the a STOP trigger if the DPCM state is START (DRAIN is not
215+
* changing the DPCM state).
216+
*/
217+
if (fe->dpcm[stream].state == SND_SOC_DPCM_STATE_START)
218+
cstream->ops->trigger(cstream, SNDRV_PCM_TRIGGER_STOP);
219+
210220
snd_soc_card_mutex_lock(fe->card);
211221

212222
snd_soc_dpcm_mutex_lock(fe);

0 commit comments

Comments
 (0)