Skip to content

Commit 11cb387

Browse files
committed
!fixup ASoC: SOF: Add support for IPC4 compressed
only call pcm_ops->hw_free if the stream is prepared during compr_free() Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
1 parent 7656e1f commit 11cb387

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

sound/soc/sof/ipc4-compress.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,17 @@ static int sof_ipc4_compr_stream_free(struct snd_sof_dev *sdev,
105105
int ret = 0;
106106
int err = 0;
107107

108-
if (spcm->prepared[dir])
108+
if (spcm->prepared[dir]) {
109+
pcm_ops->trigger(sdev->component, NULL, spcm,
110+
SNDRV_PCM_TRIGGER_STOP, dir);
111+
109112
snd_sof_compr_platform_trigger(sdev, cstream,
110113
SNDRV_PCM_TRIGGER_STOP);
111114

112-
err = pcm_ops->hw_free(sdev->component, NULL, spcm, dir);
113-
if (err < 0)
114-
spcm_err(spcm, dir, "pcm_ops->hw_free failed %d\n", ret);
115+
err = pcm_ops->hw_free(sdev->component, NULL, spcm, dir);
116+
if (err < 0)
117+
spcm_err(spcm, dir, "pcm_ops->hw_free failed %d\n", ret);
118+
}
115119

116120
spcm->prepared[dir] = false;
117121
spcm->pending_stop[dir] = false;

0 commit comments

Comments
 (0)