Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tools: Testbench: Fixes to load aria, mixin and mixout components #9580

Merged
merged 3 commits into from
Oct 17, 2024
Merged
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
1 change: 1 addition & 0 deletions src/arch/host/configs/library_defconfig
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
CONFIG_COMP_ARIA=y
CONFIG_COMP_ASRC=y
CONFIG_COMP_CROSSOVER=y
CONFIG_COMP_DCBLOCK=y
Expand Down
2 changes: 1 addition & 1 deletion src/audio/aria/aria.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ static inline void aria_process_data(struct processing_module *mod,
cd->data_ptr = cir_buf_wrap(cd->data_ptr + sample_size, cd->data_addr, cd->data_end);
}

int aria_init(struct processing_module *mod)
static int aria_init(struct processing_module *mod)
{
struct comp_dev *dev = mod->dev;
struct module_data *mod_data = &mod->priv;
Expand Down
4 changes: 2 additions & 2 deletions src/audio/aria/aria_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ inline void aria_algo_calc_gain(struct aria_data *cd, size_t gain_idx,
cd->gains[gain_idx] = (int32_t)(gain >> (att + 1));
}

void aria_algo_get_data(struct processing_module *mod,
struct audio_stream *sink, int frames)
static void aria_algo_get_data(struct processing_module *mod,
struct audio_stream *sink, int frames)
{
struct aria_data *cd = module_get_private_data(mod);
int32_t step, in_sample;
Expand Down
12 changes: 6 additions & 6 deletions src/audio/aria/aria_hifi3.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ inline void aria_algo_calc_gain(struct aria_data *cd, size_t gain_idx,
cd->gains[gain_idx] = (int32_t)(gain >> (att + 1));
}

void aria_algo_get_data_odd_channel(struct processing_module *mod,
struct audio_stream *sink,
int frames)
static void aria_algo_get_data_odd_channel(struct processing_module *mod,
struct audio_stream *sink,
int frames)
{
struct aria_data *cd = module_get_private_data(mod);
size_t i, m, n, ch;
Expand Down Expand Up @@ -118,9 +118,9 @@ void aria_algo_get_data_odd_channel(struct processing_module *mod,
cd->gain_state = INDEX_TAB[cd->gain_state + 1];
}

void aria_algo_get_data_even_channel(struct processing_module *mod,
struct audio_stream *sink,
int frames)
static void aria_algo_get_data_even_channel(struct processing_module *mod,
struct audio_stream *sink,
int frames)
{
struct aria_data *cd = module_get_private_data(mod);
size_t i, m, n, ch;
Expand Down
12 changes: 6 additions & 6 deletions src/audio/aria/aria_hifi5.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ inline void aria_algo_calc_gain(struct aria_data *cd, size_t gain_idx,
cd->gains[gain_idx] = (int32_t)(gain >> (att + 1));
}

void aria_algo_get_data_odd_channel(struct processing_module *mod,
struct audio_stream *sink,
int frames)
static void aria_algo_get_data_odd_channel(struct processing_module *mod,
struct audio_stream *sink,
int frames)
{
struct aria_data *cd = module_get_private_data(mod);
size_t i, n, ch;
Expand Down Expand Up @@ -125,9 +125,9 @@ void aria_algo_get_data_odd_channel(struct processing_module *mod,
cd->gain_state = index_tab[cd->gain_state + 1];
}

void aria_algo_get_data_even_channel(struct processing_module *mod,
struct audio_stream *sink,
int frames)
static void aria_algo_get_data_even_channel(struct processing_module *mod,
struct audio_stream *sink,
int frames)
{
struct aria_data *cd = module_get_private_data(mod);
size_t i, m, n, ch;
Expand Down
1 change: 1 addition & 0 deletions src/include/sof/audio/component.h
Original file line number Diff line number Diff line change
Expand Up @@ -803,6 +803,7 @@ void sys_comp_host_init(void);
void sys_comp_kpb_init(void);
void sys_comp_selector_init(void);

void sys_comp_module_aria_interface_init(void);
void sys_comp_module_copier_interface_init(void);
void sys_comp_module_crossover_interface_init(void);
void sys_comp_module_dcblock_interface_init(void);
Expand Down
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
3 changes: 3 additions & 0 deletions tools/testbench/utils_ipc4.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ int tb_setup(struct sof *sof, struct testbench_prm *tp)
sys_comp_init(sof);

/* Module adapter components */
sys_comp_module_aria_interface_init();
sys_comp_module_crossover_interface_init();
sys_comp_module_dcblock_interface_init();
sys_comp_module_demux_interface_init();
Expand All @@ -54,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
Loading