Skip to content

Commit

Permalink
iadk: module_adapter: Fix return code for IADK proc
Browse files Browse the repository at this point in the history
IADK processing module interface uses uint32_t return code
while cSOF is using int type. This patch checks return value
from processing() method and returns -ENODATA in case of
failure.

Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com>
  • Loading branch information
jxstelter committed Dec 21, 2023
1 parent 5a50d49 commit 2849ba6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
19 changes: 13 additions & 6 deletions src/audio/module_adapter/iadk/iadk_module_adapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ int IadkModuleAdapter::IadkModuleAdapter_Prepare(void)
return 0;
}

uint32_t IadkModuleAdapter::IadkModuleAdapter_Process(struct sof_source **sources,
int num_of_sources,
struct sof_sink **sinks,
int num_of_sinks)
int IadkModuleAdapter::IadkModuleAdapter_Process(struct sof_source **sources,
int num_of_sources,
struct sof_sink **sinks,
int num_of_sinks)
{
uint32_t ret = 0;
int ret = 0;

if ((num_of_sources > 0) && (num_of_sinks > 0)) {
intel_adsp::InputStreamBuffer input_stream_buffers[INPUT_PIN_COUNT];
Expand Down Expand Up @@ -80,7 +80,14 @@ uint32_t IadkModuleAdapter::IadkModuleAdapter_Process(struct sof_source **source
new (&output_stream_buffers[i]) intel_adsp::OutputStreamBuffer(osb_data);
}

ret = processing_module_.Process(input_stream_buffers, output_stream_buffers);
uint32_t iadk_ret =
processing_module_.Process(input_stream_buffers, output_stream_buffers);

/* IADK modules returns uint32_t return code. Convert to failure if Process
* not successful.
*/
if (iadk_ret != 0)
ret = -ENODATA;

for (int i = 0; i < num_of_sources; i++) {
source_release_data(sources[i], input_stream_buffers[i].size);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ namespace dsp_fw
* samples provided by the codec_adapter and produce/output the processed
* ones back to codec_adapter.
*/
uint32_t IadkModuleAdapter_Process(struct sof_source **sources,
int num_of_sources,
struct sof_sink **sinks,
int num_of_sinks);
int IadkModuleAdapter_Process(struct sof_source **sources,
int num_of_sources,
struct sof_sink **sinks,
int num_of_sinks);

/**
* Module specific apply config procedure, called by codec_adapter every time
Expand Down

0 comments on commit 2849ba6

Please sign in to comment.