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.

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

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.

2 participants