Skip to content

Conversation

@jsarha
Copy link
Contributor

@jsarha jsarha commented Oct 10, 2025

No description provided.

Copilot AI review requested due to automatic review settings October 10, 2025 10:10
Copy link

Copilot AI left a 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 modernizes the memory management approach for mixer, mixin_mixout, and mux audio modules by converting them to use the module API for allocation and deallocation. This simplifies the code by removing manual memory management responsibilities from the components.

  • Replaced manual memory allocation (rzalloc) with module-managed allocation (mod_zalloc)
  • Eliminated manual cleanup code in free functions since module API handles deallocation automatically
  • Updated data blob handler creation to use module API (mod_data_blob_handler_new)

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/audio/mux/mux.c Converted to module API allocation, simplified error handling by removing cleanup paths
src/audio/mixin_mixout/mixin_mixout.c Updated memory allocation to use module API for both mixin and mixout components
src/audio/mixer/mixer.c Switched to module-managed memory allocation and removed manual cleanup

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@jsarha jsarha force-pushed the module_api_mixer_mixin-mixout_mux branch from fad5221 to e999fde Compare October 21, 2025 21:40
@lgirdwood
Copy link
Member

SOFCI TEST

@lgirdwood
Copy link
Member

rerun CI as no data or not run on several duts

Jyri Sarha added 3 commits October 31, 2025 16:39
Allocate all memory, blob handlers, and fast_get() buffers through
module API mod_alloc() and friends.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Allocate all memory, blob handlers, and fast_get() buffers through
module API mod_alloc() and friends.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Allocate all memory, blob handlers, and fast_get() buffers through
module API mod_alloc() and friends.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
@jsarha jsarha force-pushed the module_api_mixer_mixin-mixout_mux branch from e999fde to 13f248f Compare October 31, 2025 14:43
@jsarha
Copy link
Contributor Author

jsarha commented Oct 31, 2025

These new versions of module conversions use module API to allocate the resources, but the code still has all the resource freeing code in place.

cd->model_handler = mod_data_blob_handler_new(mod);
if (!cd->model_handler) {
comp_err(dev, "comp_data_blob_handler_new() failed.");
comp_err(dev, "mod_data_blob_handler_new() failed.");
Copy link
Collaborator

Choose a reason for hiding this comment

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

module data blob handler creation failed.

Copy link
Collaborator

Choose a reason for hiding this comment

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

we remove function names from prints, that refer to the function where the print is called, because that's already printed automatically. But I think it's ok to refer to other functions in prints like in this case - it refers to the function that has failed, not to the one, that's calling the print.

@lgirdwood lgirdwood merged commit 058993c into thesofproject:main Nov 3, 2025
40 of 42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants