Repository navigation
Convert copier to use the module interface - #7890
Conversation
0e3f502 to
35fbe85
Compare
69de002 to
187b02d
Compare
54f27cd to
ab2291e
Compare
Add the bind/unbind ops that can be optionally implemented by modules to perform module-specific actions when other modules are bound/unbound from them. These are particularly useful for modules such as the mixers, smart_amp, copier that can have multiple input/output pins. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Introduce a new struct module_endpoint_ops which contains all the ops that are relevant for endpoint devices (host copier and DAI copier) and add a new field for setting the endpoint_ops. These will be needed when the copier component is converted to use the module adapter interface. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
|
SOFCI TEST |
There was a problem hiding this comment.
if I understand correctly, this call to buffer_set_params() is now practically dropped, was it not needed?
There was a problem hiding this comment.
it isnt dropped, it is handled by ipc4_update_buffer_format() now
Add the dai endpoint ops to the module adapter in preparation for converting the copier module to use the module interface. Also, modify the module_adapter ops to handle the HOST/DAI components are a special case. In the case of module_adapter_prepare(), there's no need to compute the period_bytes for the HOST/DAI because these are computed by the copier module prepare op. In the case of copy, HOST/DAI components are handled separately as well as these components deal with the DMA buffers. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
The state check is redundant as the state will always be >= MODULE_INITIALIZED if the module exists. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
For IPC4, the component device state machine is handled by the comp_set_state() calls in the module adapter ops already. So, the module state checks are redundant. But, keep the state checks for IPC3 so as to not break the existing codec implementations for IPC3. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Define the module interface ops and the endpoint ops for the copier module to convert it to use the module interface. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
It will be needed by other modules. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Update the pipeline params based on the base config. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
It will be needed by other modules as well. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Fix the function name in the comment. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
The input stream params may not be updated by the source module. So update the stream params from the config. Also, update the source/sink ibuffer formats based on the base config audio format. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Use the helper functions to update the stream params and the source/sink buffer formats. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
| buffer_release(sink_c); | ||
|
|
||
| return ret; | ||
| sourceb = list_first_item(&dev->bsource_list, struct comp_buffer, sink_list); |
There was a problem hiding this comment.
previous code only have sink buffer update, does not have source buffer update, just want to avoid some parameter missing caused issues? do we need add source update to each module?
There was a problem hiding this comment.
for the volume component, the source buffer and sink buffer formats are exactly the same. So yes we should update both buffers. And should we do it for each module individually? Probably not, something we should work on unifying for all modules in IPC4 in a follow up PR
There was a problem hiding this comment.
so, any audio processing module, like iir, fir they also need assume source and sink buffer have same format, right?
lyakh
left a comment
There was a problem hiding this comment.
minor comments / questions only
| if (ret < 0) | ||
| return ret; | ||
|
|
||
| comp_info(dev, "copier_prepare()"); |
There was a problem hiding this comment.
I changed to info on purpose @lyakh mainly because prepare is a one time thing and it is useful to see which components are done getting pepared during trigger
|
|
||
| #if CONFIG_IPC_MAJOR_4 | ||
| ipc4_base_module_cfg_to_stream_params(&mod->priv.cfg.base_cfg, params); | ||
| ipc4_base_module_cfg_to_stream_params(&mod->priv.cfg.base_cfg, mod->stream_params); |
There was a problem hiding this comment.
for my understanding: why is this needed? Is this fixing a bug?
There was a problem hiding this comment.
Yes, now that the copier is not using the comp_driver, its params wont get called until prepare. So the params will not propagated if we wont do this and components that do not use the module adapter yet will fail
There was a problem hiding this comment.
does that mean that that before this commit copier.c is broken, which breaks bisection? Should this commit be merged with 6bcaf89 which comes before it?
| /* update the source/sink buffer formats. Sink rate will be modified below */ | ||
| ipc4_update_buffer_format(source_c, &cd->ipc_config.base.audio_fmt); | ||
| ipc4_update_buffer_format(sink_c, &cd->ipc_config.base.audio_fmt); | ||
| #endif |
There was a problem hiding this comment.
same here - what's the effect of these changes?
There was a problem hiding this comment.
same explanation, copier doesnt set the source/sink buffer until prepare. So asrc_params( will fail without it
|
SOFCI TEST |
|
@ranj063 pls merge after CAVS CI finishes, I've restarted it as it was pending for 1 day. |
@lgirdwood even though it shows as pending, if you click on the link, you can see the results. I have notified @fredoh9 @marc-hb about the problem |
Includes patches from #7740