-
Notifications
You must be signed in to change notification settings - Fork 313
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
Tools: Testbench: Add to IPC4 version UUID based components load, apply initial byte control, etc. #9542
Conversation
@@ -52,6 +55,27 @@ struct tb_config { | |||
int channels; | |||
unsigned long format; | |||
}; | |||
|
|||
struct tb_ctl { |
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, so we can do this in parallel with plugin when we ship it.
|
||
/* src component private data */ | ||
struct ipc4_config_src { | ||
struct ipc4_base_module_cfg base; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we have size at the start ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not the struct for config blobs. I only moved this structure to be separate from large src_common.h that caused a build problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, but this is an IPC header, so this should be for host/module configuration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not clear to me what you are suggesting to do. Should these IPC headers be somewhere else or use some more consistent directory locations and naming?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lgirdwood Ping, can you help me fix this. I don't think this PR has any other opens left.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, we can address this later as I see this structure is used as header for module data in other modules.
|
||
/* src component private data */ | ||
struct ipc4_config_src { | ||
struct ipc4_base_module_cfg base; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not the struct for config blobs. I only moved this structure to be separate from large src_common.h that caused a build problem.
@@ -52,6 +55,27 @@ struct tb_config { | |||
int channels; | |||
unsigned long format; | |||
}; | |||
|
|||
struct tb_ctl { |
There was a problem hiding this comment.
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 ?
VOLUME_FWL); | ||
|
||
return linear_gain; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ranj063 These volume tables math functions would be a good start for a common utils library. Maybe there could be a place in tplg_parser?
afdf2fa
to
7cd25e1
Compare
I added to controls parsing commit capability to split a long bytes control blob to several IPC messages if it is large. It's useful for FIR and TDFB blobs. |
7cd25e1
to
40280c9
Compare
* sof_ipc4_prepare_process_module(). | ||
*/ | ||
memcpy(&pin_format->audio_fmt, &base_cfg->audio_fmt, | ||
sizeof(pin_format->audio_fmt)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: After talking with @ranj063 I now understand resolving this properly need another prepare() pipelines walk step that does not yet exist in testbench and plugin. I'm proposing to keep this as-is for now and wait for development in plugin where things are more constrained by multiple processes. This workaround works for most components where first pin format for input and output is the same.
SOFCI TEST |
@@ -68,6 +68,13 @@ static const struct sof_topology_token ipc4_out_audio_format_tokens[] = { | |||
offsetof(struct sof_ipc4_pin_format, buffer_size)}, | |||
}; | |||
|
|||
static const struct sof_topology_token ipc4_comp_pin_tokens[] = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ranj063 Should I keep this patch here or make a separate PR if you need it? It might take long to get this testbench PR approved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A handful of style/readability improvements (see inline), but really nothing to stop merging.
tools/testbench/topology_ipc4.c
Outdated
@@ -643,18 +646,19 @@ int tb_new_dai_in_out(struct testbench_prm *tp, int dir) | |||
struct tplg_context *ctx = &tp->tplg; | |||
struct tplg_comp_info *comp_info = ctx->current_comp_info; | |||
struct ipc4_file_module_cfg *file; | |||
struct sof_uuid file_uuid = {.a = 0xbfc7488c, .b = 0x75aa, .c = 0x4ce8, | |||
.d = { 0x9d, 0xbe, 0xd8, 0xda, 0x08, 0xa6, 0x98, 0xc2 }}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given this doesn't look super nice and is repeated many times in testbench code, would be nice to at least define this in one place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, moved to file.h.
tools/testbench/topology_ipc4.c
Outdated
int i, j; | ||
int pin_format_offset = 0; | ||
|
||
if (pin_type == 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find these make it harder to read, can you add a enum for 0/1?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, done!
tools/testbench/topology_ipc4.c
Outdated
base_cfg_ext->nb_input_pins = pins->num_input_pins; | ||
base_cfg_ext->nb_output_pins = pins->num_output_pins; | ||
tb_set_pin_formats(comp_info, base_cfg, base_cfg_ext, 0); | ||
tb_set_pin_formats(comp_info, base_cfg, base_cfg_ext, 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here readable enum/defines for 0/1 would help to understand what this code does easier.
40280c9
to
aa9bc6c
Compare
This patch copies similar change from SOF plugin. The load of host copier, DAI copier, PGA, and process components are updated to use UUID that is appended to end of IPC4 base module configuration and other component specific init IPC. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This adds parse of controls and set of byte control to components after initialize. Control types mixer, switch, enum are parsed but not yet applied to components. The code is copied and adapted from SOF plugin. As addition the bytes control is split to several messages if the IPC message size limit is reached. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
If kept in src_common.h the inclusion to tplg_parser would create need to include even more headers from SOF. The simple src_ipc.h contains the only needed SRC IPC4 definition. The __SOF_AUDIO_SRC_SRC_H__ is updated to match header name and the ending #endif is moved file end where it should be. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This replaces for IPC4 testbench the previous non-working version that was a copy of IPC3 version. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This replaces for IPC4 testbench the previous non-working version that was a copy of IPC3 version. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
The examples need to convert the testbench out.raw to wav format, not the converted input for testbench. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch adds to the parser the capability to parse the tokens and place the found values to pins_info member in tplg_comp_info struct. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
The input and output pins count and format for each pin is added into the "struct ipc4_base_module_cfg_ext" that is placed after "struct ipc4_base_module_cfg" and before test bench and plugin specific UUID. This allows to load components those use the extended configuration. Since there is no harm to apply it to every process type component it done simply for all. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
aa9bc6c
to
cb5946e
Compare
I updated commit "Tools: Testbench: Add support for parsing controls from topology " to fix xt-testbench build by moving all struct definitions in tb_kcontrol_cb_new() to begin of function. |
@@ -52,6 +55,27 @@ struct tb_config { | |||
int channels; | |||
unsigned long format; | |||
}; | |||
|
|||
struct tb_ctl { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, so we can do this in parallel with plugin when we ship it.
|
||
/* src component private data */ | ||
struct ipc4_config_src { | ||
struct ipc4_base_module_cfg base; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, we can address this later as I see this structure is used as header for module data in other modules.
@lgirdwood good to merge |
To build and run IPC4 topologies, this needs PRs #9551 (already merged #9536, #9538). #9501 is needed if the topology is not containing blobs for byte controls (usually they do).