-
Notifications
You must be signed in to change notification settings - Fork 349
zephyr: audio: host: Fix "no bytes to copy" log supressing #10068
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
Conversation
Display the number of previously skipped log entries before displaying a new entry about no bytes to copy. Restart nobytes_last_logged after displaying the number of skipped messages. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
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.
Pull Request Overview
This PR fixes log suppression for no-bytes events in the Zephyr audio host by displaying the number of skipped events and associated byte count before logging a new no-bytes event.
- Recalculates the reset condition for skipped events using the elapsed time since the last log.
- Updates the log message format and reorders the logic for resetting and incrementing the skipped counter.
|
|
||
| if (!dma_copy_bytes) { | ||
| if (delta > SOF_MIN_NO_BYTES_INTERVAL_MS) { | ||
| if (!hd->n_skipped || reset_skipped) { |
Copilot
AI
Jun 24, 2025
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.
[nitpick] Consider restructuring the incrementation of hd->n_skipped by moving the increment into an else clause. This would clarify that the increment is intended only when no logging occurs, improving readability.
|
Thanks @softwarecki this is super useful. I wonder if we can make it generic under a function named |
|
@softwarecki how realistic is actually the kpb test? If this is a practically feasible flow, then we probably shouldn't complain about "no bytes" every millisecond? And after your changes even with 2 messages per millisecond. The output does potentially look nicer, but I'm wondering whether in realistic scenarios it really would increase logging output a lot? |
lgirdwood
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.
Zephyr may have plans for rate limited logging... might be worth inquiring, but this is good now.
|
@lyak: The goal of this PR is to improve the mechanism of skipping log messages. Since they look nicer, it means the goal has been achieved. :) The way kpb works (host is starved until a keyword is detected, which causes the log to be spammed with "no bytes" entries) is beyond my interest at the moment. |
Display the number of previously skipped log entries before displaying a new entry about no bytes to copy. Restart nobytes_last_logged after displaying the number of skipped messages.
Log before change:
after:
The above fragments are from the kpb test. When draining the history buffer, the host copy function is called twice per period. Once by the pipeline and once by the draining task.