Skip to content

audio: asrc: fix runtime params validation#10803

Open
wjablon1 wants to merge 1 commit into
thesofproject:mainfrom
wjablon1:asrc_rate_val_fix
Open

audio: asrc: fix runtime params validation#10803
wjablon1 wants to merge 1 commit into
thesofproject:mainfrom
wjablon1:asrc_rate_val_fix

Conversation

@wjablon1
Copy link
Copy Markdown
Contributor

IPC4 params do not provide a PCM sampling rate that is dynamically selected based on the mode (PULL/PUSH). Instead, the received params contain only a copy of the source rate already stored in ipc4_asrc_module_cfg. As a result, mode-dependent validation can trigger a bogus error. Fix this by splitting params validation into IPC protocol-specific functions.

Copy link
Copy Markdown
Contributor

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 pull request fixes incorrect runtime PCM rate validation in the ASRC module by making stream-parameter validation IPC-protocol specific, avoiding bogus errors for IPC4 where the runtime params rate is not mode-dependent (PULL/PUSH) in the same way as IPC3.

Changes:

  • Split ASRC stream params verification into asrc_verify_stream_params() with IPC3/IPC4-specific implementations.
  • Update ASRC params handling to call the new verification function and keep buffer parameter verification (comp_verify_params) in asrc.c.
  • Add the new verification function prototype to the ASRC public header.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/audio/asrc/asrc.h Adds the asrc_verify_stream_params() declaration used by the common ASRC params path.
src/audio/asrc/asrc.c Replaces the old monolithic verification with IPC-specific verification + comp_verify_params().
src/audio/asrc/asrc_ipc4.c Implements IPC4 verification as a no-op to avoid mode-dependent false failures.
src/audio/asrc/asrc_ipc3.c Moves the mode-dependent PCM rate validation logic into the IPC3-specific implementation.

Copy link
Copy Markdown
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.

IPC4 params do not provide a PCM sampling rate that is dynamically
selected based on the mode (PULL/PUSH). Instead, the received params
contain only a copy of the source rate already stored in
ipc4_asrc_module_cfg. As a result, mode-dependent validation can trigger
a bogus error. Fix this by splitting params validation into
IPC protocol-specific functions.

Signed-off-by: Wojciech Jablonski <wojciech.jablonski@intel.com>
@wjablon1 wjablon1 force-pushed the asrc_rate_val_fix branch from ccad2ba to fc757b0 Compare May 25, 2026 12:59
@wjablon1
Copy link
Copy Markdown
Contributor Author

@kv2019i IPC3 builds fixed, thanks

@wjablon1 wjablon1 requested a review from kv2019i May 25, 2026 13:21
Comment on lines +84 to +86
*/
ARG_UNUSED(mod);
ARG_UNUSED(params);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

6 participants