Skip to content
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

ring_buffer: Increase buffer size to prevent a DP module starvation #9724

Merged
merged 1 commit into from
Dec 16, 2024

Conversation

softwarecki
Copy link
Collaborator

Increase buffer size to 3 times max_ibs_obs to prevent starving a DP module that process different block sizes in different periods (44.1 kHz case). The full description has been added as a comment in the source code.

Increase buffer size to 3 times max_ibs_obs to prevent starving a DP
module that process different block sizes in different periods
(44.1 kHz case).

Signed-off-by: Adrian Warecki <[email protected]>
Copy link
Contributor

@tmleman tmleman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
Nice description btw.

* in the output signal. To resolve this situation and allow the module to process
* correctly, it is necessary to allocate a buffer three times larger than max_ibs_obs.
*/
ring_buffer->data_buffer_size = 3 * max_ibs_obs;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was left wondering should this be configurable given this corner case is only hit with specific pipelines (like the SRC case given as example). OTOH, the default should be safe, so I think this PR makes sense at this point and optimization (if needed) can come later.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kv2019i My proposition was that the module should declare if it needs any data retention between cycles. It would also make possible using a shared memory space as a buffer - a module always consume 100% data if no retention is needed, leaving a buffer empty ==> memory may be used for other purposes.

@kv2019i kv2019i merged commit dae8b0b into thesofproject:main Dec 16, 2024
44 of 47 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants