-
Notifications
You must be signed in to change notification settings - Fork 349
module_adapter: Count sinks/sources during bind #10240
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 moves the counting of sink and source connections from the prepare phase to the bind phase in the module adapter. The change counts sinks and sources as they are connected during the bind operation instead of iterating through connected buffers during the prepare phase.
- Remove sink/source counting code from the prepare phase
- Add increment counters during bind operations for both sinks and sources
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/audio/module_adapter/module_adapter.c | Removes the code that counts sources and sinks during prepare phase |
| src/audio/module_adapter/module/generic.c | Adds increment operations for sink/source counters during bind operations |
Comments suppressed due to low confidence (1)
src/audio/module_adapter/module/generic.c:766
- The unbind function increments counters during bind but doesn't decrement them during unbind. This will cause incorrect counts when components are unbound and rebound. Add
mod->num_of_sinks--andmod->num_of_sources--in the respective unbind cases.
int module_unbind(struct processing_module *mod, struct bind_info *unbind_data)
{
int ret;
const struct module_interface *const ops = mod->dev->drv->adapter_ops;
switch (unbind_data->bind_type) {
case COMP_BIND_TYPE_SINK:
ret = sink_unbind(unbind_data->sink);
break;
case COMP_BIND_TYPE_SOURCE:
ret = source_unbind(unbind_data->source);
break;
default:
ret = -EINVAL;
}
if (ret)
return ret;
if (ops->unbind)
ret = ops->unbind(mod, unbind_data);
return ret;
}
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
In preparation for preparing modules during the bind phase instead of pipeline trigger, move the code to count of the sinks/sources as and when they are bound/unbound. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
5d6cabf to
99e9fc2
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.
Do I understand correctly that modules are ultimately to be initialized during binding instead of triggering the pipeline?
@softwarecki yes, thats the intention. |
@dbaluta Im good with the revert. I will start working on a better separation between IPC3 and IPC4 before I make invasive changes wrt pipeline prepare for IPC4. |
Thanks @ranj063 . Let sync and ping me to test each change before merging. Unfortunately we only are able to see our CI results just after the PR is merged. |
In preparation for preparing modules during the bind phase instead of pipeline trigger, move the code to count of the sinks/sources as and when they are connected.