From 56a6d0d3e03c560218399fd88474f3e50c6ed38b Mon Sep 17 00:00:00 2001 From: Serhiy Katsyuba Date: Tue, 19 Sep 2023 11:56:00 +0200 Subject: [PATCH] dai-zephyr: Do not skip dma_reload() when sink if full If sink is full and so no bytes were copied, reload DMA anyway as otherwise xrun may happen if reload is skipped for a long time. Signed-off-by: Serhiy Katsyuba --- src/audio/dai-zephyr.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/audio/dai-zephyr.c b/src/audio/dai-zephyr.c index d983b8699..33d0f3922 100644 --- a/src/audio/dai-zephyr.c +++ b/src/audio/dai-zephyr.c @@ -1287,6 +1287,15 @@ int dai_zephyr_multi_endpoint_copy(struct dai_data **dd, struct comp_dev *dev, /* return if nothing to copy */ if (!frames) { comp_warn(dev, "dai_zephyr_multi_endpoint_copy(): nothing to copy"); + + for (i = 0; i < num_endpoints; i++) { + ret = dma_reload(dd[i]->chan->dma->z_dev, dd[i]->chan->index, 0, 0, 0); + if (ret < 0) { + dai_report_xrun(dd[i], dev, 0); + return ret; + } + } + return 0; }