Module api conversion of google ctc, google rtc, and igo nr modules#10292
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR converts three audio processing modules (Google CTC, Google RTC, and IGO NR) from component-based API to module-based API. The conversion involves updating memory allocation functions and error handling patterns to use module-specific APIs.
- Updated memory allocation from
rzalloc/rballoctomod_zalloc/mod_balloc - Replaced
comp_data_blob_handler_newwithmod_data_blob_handler_new - Simplified error handling by removing manual cleanup and early returns
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/audio/igo_nr/igo_nr.c | Converted IGO NR module to use module API with simplified error handling |
| src/audio/google/google_rtc_audio_processing.c | Updated Google RTC module to use module allocation functions |
| src/audio/google/google_ctc_audio_processing.c | Converted Google CTC module with updated allocation and simplified cleanup |
Comments suppressed due to low confidence (2)
src/audio/google/google_rtc_audio_processing.c:1
- The variable 'cd' is used without being declared or retrieved from the module. Missing declaration:
struct comp_data *cd = module_get_private_data(mod);
// SPDX-License-Identifier: BSD-3-Clause
src/audio/google/google_ctc_audio_processing.c:1
- The variable 'cd' is used without being declared or retrieved from the module. Missing declaration:
struct comp_data *cd = module_get_private_data(mod);
// SPDX-License-Identifier: BSD-3-Clause
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
SOFCI TEST |
kv2019i
left a comment
There was a problem hiding this comment.
Looks good. A mention that mod_free_all() call was recently added in commit 86a5460 (i.e. why the free calls are now redundant) would help reviewers understand the background, but I guess most people looking at this PR will know about it anyways.
There is now quite a few commit messages in multiple PRs needing this update. I wonder if Copilot would be able to add it, not to screw-up anything while at it. |
58d0c51 to
bbea445
Compare
|
no data in some CI so rerun. |
|
SOFCI TEST |
| if (!cd->input) { | ||
| comp_err(dev, "Failed to allocate input buffer"); | ||
| ctc_free(mod); | ||
| return -ENOMEM; |
Allocate all memory, blob handlers, and fast_get() buffers through module API mod_alloc() and friends. The change does not touch the google_ctc_audio_processing.h API or its mock implementation, that still uses rballoc() and rfree(). Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Allocated data blob handler should be freed too. 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. The change does not touch the google_rtc_audio_processing.h API or its mock implementation, that still uses rballoc() and rfree(). 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>
bbea445 to
eb182ac
Compare
|
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. |
No description provided.