Skip to content

Commit

Permalink
DP scheduler: Silence benign warnings
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
andyross committed Dec 13, 2023
1 parent 6026501 commit 6bfaf14
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/audio/dai-zephyr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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",
Expand All @@ -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;
}
Expand Down

0 comments on commit 6bfaf14

Please sign in to comment.