-
Notifications
You must be signed in to change notification settings - Fork 349
audio: module_adapter: Remove use of comp_verify_params for IPC4 #10244
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
Conversation
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.
Pull Request Overview
This PR removes the use of comp_verify_params for IPC4 in the module adapter component and reorganizes parameter handling to avoid unnecessary operations. Since IPC4 doesn't use buffer flags, the component parameter updates based on these flags are eliminated.
- Removed
comp_verify_paramscalls from module adapter functions for IPC4 - Moved buffer parameter setting to the component connection phase in
ipc_comp_connect - Added component period frames setting during module initialization
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/ipc/ipc4/helper.c | Added buffer parameter setting during component connection for module adapters |
| src/audio/module_adapter/module_adapter.c | Removed comp_verify_params calls and added period frames setting during initialization |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
cfbe8c8 to
14ad55b
Compare
kv2019i
left a comment
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.
One comment about IPC3, otherwise looks good.
14ad55b to
e891b75
Compare
softwarecki
left a comment
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.
Thanks for taking the time to clean this up. It's very confusing when a function whose name suggests it's for verification is actually responsible for setting buffer parameters.
|
@softwarecki who can help me with the QB failures? looks like NVL failed all the tests? |
|
Fails with 1 test. MTL |
e891b75 to
5af4b1e
Compare
5af4b1e to
7ab8fd7
Compare
4f9b3ff to
a5de9c0
Compare
a5de9c0 to
b5032d5
Compare
| struct module_config *dst = &mod->priv.cfg; | ||
| struct sof_ipc_stream_params params; | ||
| struct comp_buffer *buffer; | ||
| int sink_queue_id = bind_data->ipc4_data->extension.r.dst_queue; |
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.
From the buffer's perspective, the sink is the source for the module. The adapter module looks at the buffer from the module's perspective, so it's the source for the module. To avoid discussion about the proper name, I suggest sticking with dst as it appears in the ipc4 structure.
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.
thanks, done
| mod->stream_copy_single_to_single = !module_adapter_multi_sink_source_prepare(dev); | ||
|
|
||
| return 0; | ||
| return module_update_source_buffer_params(mod, bind_data); |
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.
Wouldn't it be better to call module_update_source_buffer_params before calling the module's bind function? It will allow module_bind to use already configured buffer parameters and allow change some parameter if it decides
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.
yeah I suppose that makes sense. Although going by today's logic that shouldnt happen because the buffer params arent updated until pipeline_prepare. But I think doing it before module_bind would make sense to make it more useful in the future.
| rfree(mod->stream_params); | ||
|
|
||
| mod->stream_params = rzalloc(SOF_MEM_FLAG_USER, | ||
| mod->stream_params = rzalloc(SOF_MEM_FLAG_USER | SOF_MEM_FLAG_COHERENT, |
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.
As I understand it, the module's bind function is called from the same core that the module is assigned to. Therefore, there's no need for this structure to be coherent.
Since this is the only place where this structure can be modified, I suggest marking the stream_params field as const and only perform a cache writeback in case someone from another core wants to look here.
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.
fixed.
b5032d5 to
a29aff0
Compare
… params This will be used for converting the input/output audio formats in the base config extension to the stream params format. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
a29aff0 to
6a50158
Compare
|
SOFCI TEST |
comp_verify_params does 3 things, update comp params based on buffer flags, then set buffer params based on comp params and then finally set the component period frames based on buffer frames. In the case of IPC4, buffer flags are unused, so there's no need to update comp params based on these flags. So, move the setting of buffer params during the modules binding call where the buffers are allocated. Finally, set the component period frames based on the module's params and the device period frames during module init Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
6a50158 to
23bf8d5
Compare
comp_verify_params does 3 things, update comp params based on buffer flags, then set buffer params based on comp params and then finally set the component period frames based on buffer frames. In the case of IPC4, buffer flags are unused, so there's no need to update comp params based on these flags. So, move the setting of buffer params during the modules binding call where the buffers are allocated. Finally, set the component period frames based on the module's params during module init.