Skip to content

Conversation

@singalsu
Copy link
Collaborator

@singalsu singalsu commented Aug 12, 2025

This patch fixes the issue in nocodec topologies with 48 kHz to 11.025 kHz capture.

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>
@singalsu singalsu force-pushed the src_capture_increase_ibs branch from aa684e4 to 7fa6ad1 Compare August 12, 2025 17:19
@singalsu singalsu marked this pull request as ready for review August 13, 2025 07:56
Copilot AI review requested due to automatic review settings August 13, 2025 07:57
Copy link

Copilot AI left a 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
Copy link

Copilot AI Aug 13, 2025

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.

Suggested change
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.

Copilot uses AI. Check for mistakes.
@singalsu singalsu requested review from kv2019i and lgirdwood August 13, 2025 07:58
Copy link
Member

@lgirdwood lgirdwood left a 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

Copy link
Collaborator

@kv2019i kv2019i left a comment

Choose a reason for hiding this comment

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

Great find @singalsu !

@kv2019i kv2019i merged commit d90b2ad into thesofproject:main Aug 14, 2025
37 of 45 checks passed
@dbaluta
Copy link
Collaborator

dbaluta commented Sep 3, 2025

@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.

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