Skip to content

Commit

Permalink
Tools: Testbench: Fix load of mixin/mixout
Browse files Browse the repository at this point in the history
The registration of mixin and mixout components is added to
tb_setup(). In topology parsing the function tb_new_mixer()
need to be updated to append the component UUID after base
configuration.

Signed-off-by: Seppo Ingalsuo <[email protected]>
  • Loading branch information
singalsu committed Oct 15, 2024
1 parent d792a08 commit 0d2656a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 2 additions & 0 deletions tools/testbench/include/testbench/topology_ipc4.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
*/
#define TB_IPC4_MAX_MSG_SIZE (MAILBOX_DSPBOX_SIZE + sizeof(struct ipc4_module_large_config))

#define TB_MIXIN_MODULE_ID 0x2
#define TB_MIXOUT_MODULE_ID 0x3
#define TB_PGA_MODULE_ID 0x6
#define TB_SRC_MODULE_ID 0x7
#define TB_ASRC_MODULE_ID 0x8
Expand Down
11 changes: 8 additions & 3 deletions tools/testbench/topology_ipc4.c
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ static int tb_new_mixer(struct testbench_prm *tp)
return -ENOMEM;

comp_info->instance_id = tp->instance_ids[SND_SOC_TPLG_DAPM_MIXER]++;
comp_info->ipc_size = sizeof(struct ipc4_base_module_cfg);
comp_info->ipc_size = sizeof(struct ipc4_base_module_cfg) + sizeof(struct sof_uuid);
comp_info->ipc_payload = calloc(comp_info->ipc_size, 1);
if (!comp_info->ipc_payload)
return -ENOMEM;
Expand All @@ -646,12 +646,17 @@ static int tb_new_mixer(struct testbench_prm *tp)
}

if (strstr(comp_info->name, "mixin")) {
comp_info->module_id = 0x2;
comp_info->module_id = TB_MIXIN_MODULE_ID;
tb_setup_widget_ipc_msg(comp_info);
} else {
comp_info->module_id = 0x3;
comp_info->module_id = TB_MIXOUT_MODULE_ID;
tb_setup_widget_ipc_msg(comp_info);
}

/* copy uuid to the end of the payload */
memcpy(comp_info->ipc_payload + sizeof(struct ipc4_base_module_cfg), &comp_info->uuid,
sizeof(struct sof_uuid));

out:
free(tplg_ctl);
return ret;
Expand Down
2 changes: 2 additions & 0 deletions tools/testbench/utils_ipc4.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ int tb_setup(struct sof *sof, struct testbench_prm *tp)
sys_comp_module_google_rtc_audio_processing_interface_init();
sys_comp_module_igo_nr_interface_init();
sys_comp_module_mfcc_interface_init();
sys_comp_module_mixin_interface_init();
sys_comp_module_mixout_interface_init();
sys_comp_module_multiband_drc_interface_init();
sys_comp_module_mux_interface_init();
sys_comp_module_rtnr_interface_init();
Expand Down

0 comments on commit 0d2656a

Please sign in to comment.