From dc9316d5e5f287965693c9f2c78e809f86894ef3 Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Thu, 28 Mar 2024 15:29:02 +0200 Subject: [PATCH] audio: dai-zephyr: Do not reset the DMA buffer cursor for HD-DMA on TRIGGER_RELEASE During DMA stop/config/start the read/write pointer of HD-DMA is not reset unlike other DMAs (GPDMA, DMAC). Only call the audio_stream_reset() if the link is not serviced by HD-DMA. Link: https://github.com/thesofproject/sof/issues/8986 Fixes: 9831a9ded770 ("audio: dai-zephyr: reset DMA buffer cursors on TRIGGER_RELEASE") Signed-off-by: Peter Ujfalusi --- src/audio/dai-zephyr.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/audio/dai-zephyr.c b/src/audio/dai-zephyr.c index 0f0d0f43e085..6fe221e4d1f8 100644 --- a/src/audio/dai-zephyr.c +++ b/src/audio/dai-zephyr.c @@ -1141,8 +1141,12 @@ static int dai_comp_trigger_internal(struct dai_data *dd, struct comp_dev *dev, * leading to the DMA copying stale data due to * dma_status() stopping dai_common_copy() from * updating the data. + * + * Only applies to non HD-DMA links as HD-DMA read/write pointer + * is not reset during stop/config/start */ - audio_stream_reset(&dd->dma_buffer->stream); + if (!(dd->dai->dma_caps & DMA_CAP_HDA)) + audio_stream_reset(&dd->dma_buffer->stream); /* only start the DAI if we are not XRUN handling */ if (dd->xrun == 0) {