-
Notifications
You must be signed in to change notification settings - Fork 349
kpb: KPB fixes #9885
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
Merged
lgirdwood
merged 6 commits into
thesofproject:main
from
serhiy-katsyuba-intel:kpb_fixes
Mar 12, 2025
Merged
kpb: KPB fixes #9885
lgirdwood
merged 6 commits into
thesofproject:main
from
serhiy-katsyuba-intel:kpb_fixes
Mar 12, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
period_copy_start is a timestamp measured in wall-clock cycles. It should be a 64-bit unsigned value. Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
Given: x = a + b - (a - c), reduce to: x = c + b Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
4219c87 to
dd27e68
Compare
lyakh
reviewed
Mar 11, 2025
Replace the verbose 'if-else' with simpler code using the MIN() macro. Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
The kpb->host_sink is NULL after a reset or unbind. The host could send a reset IPC while the draining task is still running, which results in a crash. Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
The draining task could run for quite a long time (e.g., a few seconds). It is implemented as an EDF scheduler task. While working, it blocks other EDF scheduler tasks: the IPC processing task and the mtrace logging task. The fix replaces the while loop in the draining task with a return SOF_TASK_STATE_RESCHEDULE, so other EDF scheduler tasks can have CPU time. Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
The previous drain interval calculation ignored the actual DSP load by LL and only worked for light LL loads (high DSP clock). The drain interval was not appropriate for slow FPGA, where LL takes half of the DSP time. This update introduces code that dynamically readjusts the drain interval and does not depend on LL load (works on low clock, FPGA). Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
dd27e68 to
32400af
Compare
kv2019i
approved these changes
Mar 11, 2025
Collaborator
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.
Looks good! And great commit messages @serhiy-katsyuba-intel , very easy to follow.
lyakh
approved these changes
Mar 12, 2025
lgirdwood
approved these changes
Mar 12, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Mainly two fixes:
Avoid long seizure of EDF scheduler thread.
The draining task could run for quite a long time (e.g., a few seconds). It is implemented as an EDF scheduler task. While working, it blocks other EDF scheduler tasks: the IPC processing task and the mtrace logging task. The fix replaces the while loop in the draining task with a return SOF_TASK_STATE_RESCHEDULE, so other EDF scheduler tasks can have CPU time.
Fix drain interval calculation
The previous drain interval calculation ignored the actual DSP load by LL and only worked for light LL loads (high DSP clock). The drain interval was not appropriate for slow FPGA, where LL takes half of the DSP time. This update introduces code that dynamically readjusts the drain interval and does not depend on LL load (works on low clock, FPGA).