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: Add to IPC4 version UUID based components load, apply initial byte control, etc. #9542

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 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
17 changes: 16 additions & 1 deletion tools/testbench/include/testbench/topology_ipc4.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,20 @@
#include "testbench/utils.h"

#define TB_IPC4_MAX_TPLG_OBJECT_SIZE 4096
#define TB_IPC4_MAX_MSG_SIZE 384

/* See module_set_large_config() where message fragment is
* MAILBOX_DSPBOX_SIZE. The add of header size (8) is because
* testbench and plugin have the set large config header in
* same memory as the payload.
*/
#define TB_IPC4_MAX_MSG_SIZE (MAILBOX_DSPBOX_SIZE + sizeof(struct ipc4_module_large_config))

#define TB_PROCESS_MODULE_ID 0x95
#define TB_PGA_MODULE_ID 0x6
#define TB_FILE_OUT_AIF_MODULE_ID 0x9a
#define TB_FILE_IN_AIF_MODULE_ID 0x9b
#define TB_FILE_OUT_DAI_MODULE_ID 0x9c
#define TB_FILE_IN_DAI_MODULE_ID 0x9d

int tb_delete_pipeline(struct testbench_prm *tp, struct tplg_pipeline_info *pipe_info);
int tb_free_all_pipelines(struct testbench_prm *tp);
Expand All @@ -24,6 +37,8 @@ int tb_new_dai_in_out(struct testbench_prm *tp, int dir);
int tb_new_pga(struct testbench_prm *tp);
int tb_new_process(struct testbench_prm *tp);
int tb_pipelines_set_state(struct testbench_prm *tp, int state, int dir);
int tb_send_bytes_data(struct tb_mq_desc *ipc_tx, struct tb_mq_desc *ipc_rx,
uint32_t module_id, uint32_t instance_id, struct sof_abi_hdr *abi);
int tb_set_reset_state(struct testbench_prm *tp);
int tb_set_running_state(struct testbench_prm *tp);
int tb_set_up_pipeline(struct testbench_prm *tp, struct tplg_pipeline_info *pipe_info);
Expand Down
25 changes: 25 additions & 0 deletions tools/testbench/include/testbench/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ struct file_comp_lookup {
#define TB_NAME_SIZE 256
#define TB_MAX_CONFIG_COUNT 2
#define TB_MAX_CONFIG_NAME_SIZE 64
#define TB_MAX_VOLUME_SIZE 120
#define TB_MAX_DATA_SIZE 512
#define TB_MAX_CTLS 16

struct tb_mq_desc {
char queue_name[TB_NAME_SIZE];
Expand All @@ -52,6 +55,27 @@ struct tb_config {
int channels;
unsigned long format;
};

struct tb_ctl {
Copy link
Member

Choose a reason for hiding this comment

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

Can we include the ABI header rather than duplicate ? I guess this comes from ALSA asoc.h ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm not sure, this struct is a direct copy from SOF plugin. If we change, we should change both to be able to merge the sources later to a common library like tplg_parser. What do you think @ranj063 ?

unsigned int module_id;
unsigned int instance_id;
unsigned int type;
unsigned int volume_table[TB_MAX_VOLUME_SIZE];
unsigned int index;
char data[TB_MAX_DATA_SIZE];
union {
struct snd_soc_tplg_mixer_control mixer_ctl;
struct snd_soc_tplg_enum_control enum_ctl;
struct snd_soc_tplg_bytes_control bytes_ctl;
};
};

struct tb_glb_state {
char magic[8]; /* SOF_MAGIC */
uint32_t num_ctls; /* number of ctls */
size_t size; /* size of this structure in bytes */
struct tb_ctl *ctl;
};
#endif

/*
Expand Down Expand Up @@ -114,6 +138,7 @@ struct testbench_prm {
struct tb_config config[TB_MAX_CONFIG_COUNT];
int num_configs;
size_t period_size;
struct tb_glb_state glb_ctx;
#endif
};

Expand Down
Loading