Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ ModuleInitialSettingsConcrete::ModuleInitialSettingsConcrete(DwordArray const &c
const size_t computed_msg_size =
sizeof(CompoundCfg) -
/* CompoundCfg already contains one InputPinFormat and
* one InputPinFormat
* one OutputPinFormat
Comment thread
abonislawski marked this conversation as resolved.
*/
(sizeof(InputPinFormat) + sizeof(OutputPinFormat)) +
unvalidated_compound_cfg->cfg_ext.nb_input_pins*sizeof(InputPinFormat) +
unvalidated_compound_cfg->cfg_ext.nb_output_pins*sizeof(InputPinFormat);
unvalidated_compound_cfg->cfg_ext.nb_output_pins*sizeof(OutputPinFormat);

/* check size consistency */
if (ipc_msg_size != computed_msg_size) {
Expand Down
11 changes: 9 additions & 2 deletions src/audio/module_adapter/iadk/system_agent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,13 @@ int SystemAgent::CheckIn(ProcessingModuleFactoryInterface& module_factory,
void *obfuscated_parent_ppl,
void **obfuscated_modinst_p)
{
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;

ProcessingModulePrerequisites prerequisites;
module_factory.GetPrerequisites(prerequisites);
Expand All @@ -104,13 +107,17 @@ int SystemAgent::CheckIn(ProcessingModuleFactoryInterface& module_factory,
(prerequisites.input_pins_count > INPUT_PIN_COUNT) ||
(prerequisites.output_pins_count < 1) ||
(prerequisites.output_pins_count > OUTPUT_PIN_COUNT))
return -1;
return -EINVAL;

/* Deduce BaseModuleCfgExt if it was not part of the INIT_INSTANCE IPC message */
settings.DeduceBaseModuleCfgExt(prerequisites.input_pins_count,
prerequisites.output_pins_count);

module_factory.Create(*this, module_placeholder, ModuleInitialSettings(settings), pins_info);
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.


IadkModuleAdapter& module_adapter = *reinterpret_cast<IadkModuleAdapter*>(module_handle_);
*obfuscated_modinst_p = &module_adapter;
reinterpret_cast<intel_adsp::ProcessingModuleInterface*>(module_placeholder)->Init();
Expand Down
Loading