From 3506304677a8f03f068342018d0b3dfe5238f2d4 Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Mon, 5 Feb 2024 16:57:00 +0200 Subject: [PATCH 1/2] audio: dai-zephyr: Fix config option string for reversed trigger The correct config to use for ifdef for reversing the stop trigger order is CONFIG_COMP_DAI_STOP_TRIGGER_ORDER_REVERSE Fixes: a6a80ec97aac ("dai-zephyr: Fix the ordering of DAI and DMA triggers") Signed-off-by: Peter Ujfalusi --- src/audio/dai-zephyr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/audio/dai-zephyr.c b/src/audio/dai-zephyr.c index ca5488c07231..5ea7869ca396 100644 --- a/src/audio/dai-zephyr.c +++ b/src/audio/dai-zephyr.c @@ -1108,7 +1108,7 @@ static int dai_comp_trigger_internal(struct dai_data *dd, struct comp_dev *dev, * drain the FIFO in order to stop the channel * as soon as possible. */ -#if CONFIG_COMP_DAI_TRIGGER_ORDER_REVERSE +#if CONFIG_COMP_DAI_STOP_TRIGGER_ORDER_REVERSE ret = dma_stop(dd->chan->dma->z_dev, dd->chan->index); dai_trigger_op(dd->dai, cmd, dev->direction); #else @@ -1122,7 +1122,7 @@ static int dai_comp_trigger_internal(struct dai_data *dd, struct comp_dev *dev, break; case COMP_TRIGGER_PAUSE: comp_dbg(dev, "dai_comp_trigger_internal(), PAUSE"); -#if CONFIG_COMP_DAI_TRIGGER_ORDER_REVERSE +#if CONFIG_COMP_DAI_STOP_TRIGGER_ORDER_REVERSE ret = dma_suspend(dd->chan->dma->z_dev, dd->chan->index); dai_trigger_op(dd->dai, cmd, dev->direction); #else From 83fb77c074b53cbce0117e74124e7d8f4af5e864 Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Mon, 5 Feb 2024 16:58:39 +0200 Subject: [PATCH 2/2] board: intel_adsp_ace15_mtpm: Drop CONFIG_DMA_DW_SUSPEND_DRAIN The purpose of CONFIG_DMA_DW_SUSPEND_DRAIN is to empty the FIFO before disabling the channel by draining it. Since the peripheral is disabled before the DMA (CONFIG_COMP_DAI_STOP_TRIGGER_ORDER_REVERSE is not selected), the DMA will not be able to do that causing drain timeout. The stop is used in two cases: Stream stop: the content of the FIFO does not matter as we stop the stream. Pause/resume: On pause the DMA is suspended (DW_CFGL_SUSPEND bit set) On resume the DMA is stopped, re-configured and then started again instead of resuming The peripheral is started after the DMA stop and start. Leftover audio data might cause audio glitch on resume, it is probably better to disable the draining. Note: if we want to have draining enabled we need to select the CONFIG_COMP_DAI_STOP_TRIGGER_ORDER_REVERSE at the same time to force the DMA to be stopped before the DAI. Signed-off-by: Peter Ujfalusi --- app/boards/intel_adsp_ace15_mtpm.conf | 1 - 1 file changed, 1 deletion(-) diff --git a/app/boards/intel_adsp_ace15_mtpm.conf b/app/boards/intel_adsp_ace15_mtpm.conf index d48f91e0a654..1f0ce26121f3 100644 --- a/app/boards/intel_adsp_ace15_mtpm.conf +++ b/app/boards/intel_adsp_ace15_mtpm.conf @@ -36,7 +36,6 @@ CONFIG_ZEPHYR_DP_SCHEDULER=y CONFIG_DMA=y CONFIG_DMA_INTEL_ADSP_GPDMA=y CONFIG_DMA_DW_LLI_POOL_SIZE=50 -CONFIG_DMA_DW_SUSPEND_DRAIN=y CONFIG_INTEL_MODULES=y CONFIG_LIBRARY_MANAGER=y CONFIG_LIBRARY_AUTH_SUPPORT=y