Skip to content

Commit 8f2e5c6

Browse files
Srinivas-Kandagatlabroonie
authored andcommitted
ASoC: qdsp6: q6apm-dai: only stop graphs that are started
Its possible that the sound card is just opened and closed without actually playing stream, ex: if the audio file itself is missing. Even in such cases we do call stop on graphs that are not yet started. DSP can throw errors in such cases, so add a check to see if the graph was started before stopping it. Fixes: 9b4fe0f ("ASoC: qdsp6: audioreach: add q6apm-dai support") Signed-off-by: Srinivas Kandagatla <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent bd2347f commit 8f2e5c6

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

sound/soc/qcom/qdsp6/q6apm-dai.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,8 +308,11 @@ static int q6apm_dai_close(struct snd_soc_component *component,
308308
struct snd_pcm_runtime *runtime = substream->runtime;
309309
struct q6apm_dai_rtd *prtd = runtime->private_data;
310310

311-
q6apm_graph_stop(prtd->graph);
312-
q6apm_unmap_memory_regions(prtd->graph, substream->stream);
311+
if (prtd->state) { /* only stop graph that is started */
312+
q6apm_graph_stop(prtd->graph);
313+
q6apm_unmap_memory_regions(prtd->graph, substream->stream);
314+
}
315+
313316
q6apm_graph_close(prtd->graph);
314317
prtd->graph = NULL;
315318
kfree(prtd);

0 commit comments

Comments
 (0)