Skip to content

Commit

Permalink
ASoC: qdsp6: q6apm-dai: unprepare stream if its already prepared
Browse files Browse the repository at this point in the history
commit 6548c88 upstream.

prepare callback can be called multiple times, so unprepare the stream
if its already prepared.

Without this DSP is not happy to setting the params on a already
prepared graph.

Fixes: 9b4fe0f ("ASoC: qdsp6: audioreach: add q6apm-dai support")
Reported-by: Srinivasa Rao Mandadapu <quic_srivasam@quicinc.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20220610144818.511797-1-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Srinivas-Kandagatla authored and gregkh committed Aug 25, 2022
1 parent 08c6c65 commit 5a6221c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sound/soc/qcom/qdsp6/q6apm-dai.c
Expand Up @@ -153,6 +153,12 @@ static int q6apm_dai_prepare(struct snd_soc_component *component,
q6apm_unmap_memory_regions(prtd->graph, substream->stream);
}

if (prtd->state) {
/* clear the previous setup if any */
q6apm_graph_stop(prtd->graph);
q6apm_unmap_memory_regions(prtd->graph, substream->stream);
}

prtd->pcm_count = snd_pcm_lib_period_bytes(substream);
prtd->pos = 0;
/* rate and channels are sent to audio driver */
Expand Down

0 comments on commit 5a6221c

Please sign in to comment.