-
Notifications
You must be signed in to change notification settings - Fork 349
Improve logs on xruns #7736
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve logs on xruns #7736
Conversation
We can skip two code blocks that are completely useless when the number of samples is exactly zero, and return earlier. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
A 'nothing to copy' log is not really useful without additional information on when this problem occurred, i.e. if this is on a 1ms tick or after a longer time. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
This is helpful to see when 'dma_copy_bytes' is zero, e.g. [00:01:10.446,761] <inf> host_comp: host_get_copy_bytes_normal: comp:1 0x40002 no bytes to copy, hd->total_data_processed 49664 available samples: 192, free_samples: 0 Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
kv2019i
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure about the first change. The glitch warnings have been useful.
| copy_bytes + free_bytes < dd->period_bytes) | ||
| comp_warn(dev, "dai_zephyr_copy(): Copy_bytes %d + free bytes %d < period bytes %d, possible glitch", | ||
| copy_bytes, free_bytes, dd->period_bytes); | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, we do skip the glitch detection as well. This has no functional impact, but will affect debugging as the buffer avail/free state is not printed out when we do run out.
| /* return if nothing to copy */ | ||
| if (!samples) { | ||
| comp_warn(dev, "dai_zephyr_copy(): nothing to copy"); | ||
| comp_warn(dev, "dai_zephyr_copy(): nothing to copy, dd->total_data_processed %llu", dd->total_data_processed); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Welcome addition. Might be good to add also data on the sink/src_samples status, providing hints whether we are not copying because of pipeline not providing/consuming data, or because of the DAI side. But can be done in later PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on the contrary, I would suggest add less characters as possible, if there is an error here, we already get the information, we can add more information personally in local build, add too much debug related code will eventually make 1.9MB exhausted, then have to split out modules as loadable modules, then maybe more bugs will come.
|
@plbossart Build error on host fuzzer |
|
I can't recall what this 1+ yr old PR was about, closing |
Add the 'total_data_processed' to the logs to get a better sense of when xruns happen with no space to copy to/from dma buffers, e.g.
The first log is probably ok, this means the DMA has not started yet, but the second one shows the flows are broken with the DMA stuck for a while