-
Notifications
You must be signed in to change notification settings - Fork 349
Tools: Topology: SRC: Increase 48 kHz capture source buffer size #10162
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
This patch fixes the issue in nocodec topologies with 48 kHz to 11.025 kHz capture. The root cause for the glitches is overrun of the capture DAI sink buffer. The currently used fractions in SRC in the particular conversion consume data in blocks of 80 frames. Depending on copy() run the consumption is 80 frames or zero frames. the normal 96 frames (2 * 48) buffer cannot fit all data from DAI when the previous SRC copy has not consumed enough data. The increase of ibs from default value of 384 to 512 results to DAI buffer of 128 frames for S32_LE stereo data at 48 kHz. It seems to be sufficiently large for the input buffer irregularity to produce clean captured audio. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
aa684e4 to
7fa6ad1
Compare
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 patch addresses a buffer size issue in 48 kHz to 11.025 kHz capture scenarios for nocodec topologies by adding an input buffer size configuration.
- Adds input buffer size (ibs) parameter to the 48 kHz SRC format configuration
- Sets buffer size to 512 bytes to resolve capture issues at specific sample rate conversions
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| { | ||
| in_rate 48000 | ||
| in_bit_depth 32 | ||
| in_valid_bit_depth 32 |
Copilot
AI
Aug 13, 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.
The ibs parameter lacks documentation explaining why 512 bytes was chosen as the buffer size or how this value relates to the sample rate conversion requirements.
| in_valid_bit_depth 32 | |
| in_valid_bit_depth 32 | |
| # ibs (input buffer size) set to 512 bytes. | |
| # 512 bytes is a commonly used buffer size in audio processing, providing a balance between latency and CPU efficiency. | |
| # For 32-bit samples at 48kHz, this allows for efficient block processing and aligns with typical hardware period sizes. |
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.
@dbaluta fyi - you may need similar for topology1
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.
Great find @singalsu !
|
@lgirdwood @singalsu I understand this change but I cannot actually point the root cause. Why would using a different API for allocation would break this. I'm trying the same change on tplg1 but I might not get it correctly as the EQ is still failing for me. I want to better understand the root cause. |
This patch fixes the issue in nocodec topologies with 48 kHz to 11.025 kHz capture.