Skip to content

Module api conversion of mixer, mixin mixout, and mux modules - #10294

Merged
lgirdwood merged 3 commits into
thesofproject:mainfrom
jsarha:module_api_mixer_mixin-mixout_mux
Nov 3, 2025
Merged

Module api conversion of mixer, mixin mixout, and mux modules#10294
lgirdwood merged 3 commits into
thesofproject:mainfrom
jsarha:module_api_mixer_mixin-mixout_mux

Conversation

@jsarha

Copy link
Copy Markdown
Contributor

No description provided.

CopilotAI review requested due to automatic review settings October 10, 2025 10:10

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

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.

FileDescription
src/audio/mux/mux.cConverted to module API allocation, simplified error handling by removing cleanup paths
src/audio/mixin_mixout/mixin_mixout.cUpdated memory allocation to use module API for both mixin and mixout components
src/audio/mixer/mixer.cSwitched 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.

Comment threadsrc/audio/mux/mux.c Outdated
Comment threadsrc/audio/mux/mux.c Outdated
@jsarha
jsarhaforce-pushed the module_api_mixer_mixin-mixout_mux branch from fad5221 to e999fdeCompareOctober 21, 2025 21:40
@lgirdwood

Copy link
Copy Markdown
Member

SOFCI TEST

@lgirdwood

Copy link
Copy Markdown
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
jsarhaforce-pushed the module_api_mixer_mixin-mixout_mux branch from e999fde to 13f248fCompareOctober 31, 2025 14:43
@jsarha

Copy link
Copy Markdown
ContributorAuthor

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.

Comment threadsrc/audio/mux/mux.c
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
Copy Markdown
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
Copy Markdown
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:mainNov 3, 2025
40 of 42 checks passed
Sign up for freeto 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.

7 participants

@jsarha@lgirdwood@lyakh@singalsu@kv2019i@softwarecki