From 8d3ad35e87939f2c1481b1cb7b382a7a6f45a4a5 Mon Sep 17 00:00:00 2001 From: Andy Ross Date: Tue, 12 Dec 2023 09:44:41 -0800 Subject: [PATCH] DP scheduler: Silence benign warnings SOF emits a flood of seemingly needless warnings when using the DP scheduler. As I'm reading it, every time a DAI endpoint is faced with an empty stream at copy time, it will warn. But that's routine if the data is inbound from an asynchronous DP component that will complete next cycle instead. This seems to be sensitive to pipeline cycle time, and particularly has trouble with Google AEC which emits data in 10ms chunks vs. the 1ms LL scheduling cadence. The upshot is that the deluge of warnings (it's a LOT of logging) end up breaking the stream themselves after a second or two by inducing glitches in data that is otherwise moving correctly. Silence them. Signed-off-by: Andy Ross --- src/audio/dai-zephyr.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/audio/dai-zephyr.c b/src/audio/dai-zephyr.c index 569bb37f1566..aa650f2e6d87 100644 --- a/src/audio/dai-zephyr.c +++ b/src/audio/dai-zephyr.c @@ -1286,8 +1286,9 @@ int dai_zephyr_multi_endpoint_copy(struct dai_data **dd, struct comp_dev *dev, /* return if nothing to copy */ if (!frames) { +#ifndef CONFIG_ZEPHYR_DP_SCHEDULER comp_warn(dev, "dai_zephyr_multi_endpoint_copy(): nothing to copy"); - +#endif 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) { @@ -1461,6 +1462,7 @@ int dai_common_copy(struct dai_data *dd, struct comp_dev *dev, pcm_converter_fun dev->direction, copy_bytes); /* Check possibility of glitch occurrence */ +#ifndef CONFIG_ZEPHYR_DP_SCHEDULER if (dev->direction == SOF_IPC_STREAM_PLAYBACK && copy_bytes + avail_bytes < dd->period_bytes) comp_warn(dev, "dai_common_copy(): Copy_bytes %d + avail bytes %d < period bytes %d, possible glitch", @@ -1469,10 +1471,13 @@ int dai_common_copy(struct dai_data *dd, struct comp_dev *dev, pcm_converter_fun copy_bytes + free_bytes < dd->period_bytes) comp_warn(dev, "dai_common_copy(): Copy_bytes %d + free bytes %d < period bytes %d, possible glitch", copy_bytes, free_bytes, dd->period_bytes); +#endif /* return if nothing to copy */ if (!copy_bytes) { +#ifndef CONFIG_ZEPHYR_DP_SCHEDULER comp_warn(dev, "dai_zephyr_copy(): nothing to copy"); +#endif dma_reload(dd->chan->dma->z_dev, dd->chan->index, 0, 0, 0); return 0; }