8000 ring_buffer: Increase buffer size to prevent a DP module starvation by softwarecki · Pull Request #9724 · thesofproject/sof · GitHub
[go: up one dir, main page]

Skip to content

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

Merged
kv2019i merged 1 commit intothesofproject:mainfrom
softwarecki:ring_buffer_dp
Dec 16, 2024
Merged

ring_buffer: Increase buffer size to prevent a DP module starvation#9724
kv2019i merged 1 commit intothesofproject:mainfrom
softwarecki:ring_buffer_dp

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 <adrian.warecki@intel.com>
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
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

0