From a41950960660ca4b086be653648f6b5c701a57eb Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Fri, 23 Aug 2024 12:08:15 +0300 Subject: [PATCH] src: dai-zephyr: Print out the src/sink frames along with 'nothing to copy' The 'nothing to copy' without context does not help in debugging, print out the number of frames on src and sink side to give some context. Signed-off-by: Peter Ujfalusi --- src/audio/dai-zephyr.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/audio/dai-zephyr.c b/src/audio/dai-zephyr.c index 4f7e3d3828e9..aea7a64d1031 100644 --- a/src/audio/dai-zephyr.c +++ b/src/audio/dai-zephyr.c @@ -1464,7 +1464,8 @@ int dai_zephyr_multi_endpoint_copy(struct dai_data **dd, struct comp_dev *dev, /* return if nothing to copy */ if (!frames) { #if CONFIG_DAI_VERBOSE_GLITCH_WARNINGS - comp_warn(dev, "nothing to copy"); + comp_warn(dev, "nothing to copy, src_frames: %u, sink_frames: %u", + src_frames, sink_frames); #endif for (i = 0; i < num_endpoints; i++) { @@ -1550,7 +1551,7 @@ int dai_common_copy(struct dai_data *dd, struct comp_dev *dev, pcm_converter_fun uint32_t free_bytes; uint32_t copy_bytes; uint32_t src_frames; - uint32_t sink_frames; + uint32_t sink_frames = 0; uint32_t frames = UINT32_MAX; int ret; @@ -1678,7 +1679,8 @@ int dai_common_copy(struct dai_data *dd, struct comp_dev *dev, pcm_converter_fun /* return if nothing to copy */ if (!copy_bytes) { #if CONFIG_DAI_VERBOSE_GLITCH_WARNINGS - comp_warn(dev, "nothing to copy); + comp_warn(dev, "nothing to copy, src_frames: %u, sink_frames: %u", + src_frames, sink_frames); #endif dma_reload(dd->chan->dma->z_dev, dd->chan->index, 0, 0, 0); return 0;