Skip to content

IADK: fix module configuration sizing and error handling - #11118

Open
abonislawski wants to merge 4 commits into
thesofproject:mainfrom
abonislawski:iadk_sa_minor_fixes
Open

IADK: fix module configuration sizing and error handling#11118
abonislawski wants to merge 4 commits into
thesofproject:mainfrom
abonislawski:iadk_sa_minor_fixes

Conversation

@abonislawski

Copy link
Copy Markdown
Member
  • Correct the IADK compound configuration size calculation to use OutputPinFormat for output pins.
  • Reject unparsable module configuration messages during SystemAgent::CheckIn.
  • Propagate module factory creation failures instead of continuing with an invalid module instance.

Reject malformed initialization data before deriving the extended module configuration.

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
Stop module initialization when the external factory reports a creation error.

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
Copilot AI lite review requested due to automatic review settings August 25, 2026 06:32

Copilot AI left a comment

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.

Pull request overview

This PR tightens robustness of the IADK module instantiation path by validating module configuration IPC payloads before use, correctly sizing compound configuration blobs, and ensuring module factory failures do not lead to using an invalid module instance.

Changes:

  • Fix compound INIT_INSTANCE size calculation by using OutputPinFormat sizing for output pins.
  • Reject unparsable module configuration messages during SystemAgent::CheckIn.
  • Stop proceeding after module factory creation failures (return error instead of continuing initialization).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/audio/module_adapter/iadk/system_agent.cpp Adds config parse validation and checks factory creation result before continuing module initialization.
src/audio/module_adapter/iadk/module_initial_settings_concrete.cpp Corrects compound configuration size computation for output pin formats.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +90 to +96
ErrorCode::Type error;
IoPinsInfo pins_info;
const dsp_fw::DwordArray& cfg_ipc_msg =
*reinterpret_cast<const dsp_fw::DwordArray*>(obfuscated_mod_cfg);
ModuleInitialSettingsConcrete settings(cfg_ipc_msg);
if (!settings.IsParsable())
return -EINVAL;

@lgirdwood lgirdwood left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just one open, otherwise LGTM

error = module_factory.Create(*this, module_placeholder, ModuleInitialSettings(settings),
pins_info);
if (error != ErrorCode::NO_ERROR)
return -EINVAL;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should we return the actual error or an IPC4 error code here if its called via IPC i.e. on module new ?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@abonislawski in fact line 110 above seems wrong - it returns -1 while lines 96 and this one return errno codes, so line 110 happens to return -EPERM which is supposedly not what was intended there

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@lgirdwood we should return a regular errno here, not an IPC4 status because CheckIn() is below the IPC boundary and it will be not propagated to the host.
@lyakh yes, this should be einval too, commit added.

error = module_factory.Create(*this, module_placeholder, ModuleInitialSettings(settings),
pins_info);
if (error != ErrorCode::NO_ERROR)
return -EINVAL;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@abonislawski in fact line 110 above seems wrong - it returns -1 while lines 96 and this one return errno codes, so line 110 happens to return -EPERM which is supposedly not what was intended there

Comment thread src/audio/module_adapter/iadk/module_initial_settings_concrete.cpp
Use the matching output pin type when validating compound configuration sizes.

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
Return -EINVAL instead  when module prerequisites
specify an unsupported number of input or output pins.

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
@kv2019i

kv2019i commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

@abonislawski Ready to merge one requried checks are passing. We can ignore the testbench failure, it will be fixed by #11128

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.

5 participants