Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
ec33294
Audio: Aria: All memory allocations through module API
Aug 7, 2025
ee7007d
Audio: ASRC: Memory, blob, and fast_get allocs to module API
Aug 7, 2025
fc7d8fa
Audio: Copier: All memory allocations through module API
Aug 7, 2025
fb63a7e
audio: copier: Fix resource leak from DMA sync code error handling
Sep 5, 2025
fe5f678
Audio: crossover: All memory allocations through module API
Aug 11, 2025
c1e0725
Audio: multiband_drc: Memory, blob, and fast_get allocs to module API
Aug 13, 2025
30fe243
Audio: DRC: Memory, blob, and fast_get allocs to module API
Aug 13, 2025
4346c12
Audio: FIR: Memory, blob, and fast_get allocs to module API
Aug 19, 2025
a9a218d
Audio: IIR: Memory, blob, and fast_get allocs to module API
Aug 19, 2025
4a0558b
Audio: Google ctc: Memory, blob, and fast_get allocs to module API
Aug 19, 2025
137d2e7
Audio: Google rtc: Memory, blob, and fast_get allocs to module API
Aug 19, 2025
76c6507
Audio: igo_nr: Memory, blob, and fast_get allocs to module API
Aug 19, 2025
38e1043
Math: Make mod_alloc() versions of all heap using functions
Aug 21, 2025
b1c5f53
Audio: mfcc: Memory, blob, and fast_get allocs to module API
Aug 21, 2025
8ad6f6e
cmocka: Add mocks for mod_balloc_align() and mod_alloc_align()
Aug 22, 2025
2d06c9d
cmocka: math: Test using module memory API math function
Aug 23, 2025
573e07a
Math: Remove directly heap using math functions
Aug 24, 2025
51d59c6
audio: mixer: Memory, blob, and fast_get allocs to module API
Aug 24, 2025
9da3ac2
Audio: mixin_mixout: Memory, blob, and fast_get allocs to module API
Aug 24, 2025
d3f4de0
Audio: Mux: Memory, blob, and fast_get allocs to module API
Aug 24, 2025
0d8130c
Audio: NXP: Memory, blob, and fast_get allocs to module API
Aug 25, 2025
63527e7
Audio: RTNR: Memory, blob, and fast_get allocs to module API
Aug 25, 2025
91f317e
Audio: Selector: Memory, blob, and fast_get allocs to module API
Aug 25, 2025
f6e4caf
Audio: TDFB: Memory, blob, and fast_get allocs to module API
Aug 25, 2025
810fdec
Audio: Template_comp: Memory, blob, and fast_get allocs to module API
Aug 25, 2025
3f76270
modules: tensorflow: Memory, blob, and fast_get allocs to module API
Aug 25, 2025
0cf6f48
Audio: up_down_mixer: Memory, blob, and fast_get allocs to module API
Aug 25, 2025
269db0a
audio: volume: Memory, blob, and fast_get allocs to module API
Aug 25, 2025
47081fe
Math: auditory: Add mod_psy_free_mel_filterbank()
Aug 26, 2025
8f30198
cmocka: math: auditiory: Fix memory leaks
Aug 26, 2025
b334929
cmocka: math: fft: Fix memory leaks
Aug 26, 2025
bbb22ef
cmocka: math: matrix: Fix memory leaks
Aug 26, 2025
8d3cb4a
Math: DCT: Add mod_dct_free_16()
Aug 26, 2025
1f229a5
cmocka: math: dct: Fix memory leaks
Aug 26, 2025
ee1a910
cmocka: module_adapter_test: Fix memory freeing error
Aug 26, 2025
7a331e6
cmocka: volume: Fix memory leaks
Aug 26, 2025
8b87136
cmocka: mux_copy: Fix memory leaks
Aug 26, 2025
01baab9
cmocka: demux_copy: Fix memory leaks
Aug 26, 2025
f31234f
cmocka: pipeline: Fix memory leaks
Aug 26, 2025
fce2c50
src/audio/module_adapter/module/generic.c: HACK: use rballoc() for mo…
Oct 20, 2025
c449fe3
modules: Apparently asking 0 alignment is dangerous, use ptr size
Oct 23, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions src/audio/aria/aria.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include <sof/audio/pipeline.h>
#include <rtos/panic.h>
#include <sof/ipc/msg.h>
#include <rtos/alloc.h>
#include <rtos/cache.h>
#include <rtos/init.h>
#include <sof/lib/notifier.h>
Expand Down Expand Up @@ -126,7 +125,7 @@ static int aria_init(struct processing_module *mod)
list_init(&dev->bsource_list);
list_init(&dev->bsink_list);

cd = rzalloc(SOF_MEM_FLAG_USER, sizeof(*cd));
cd = mod_zalloc(mod, sizeof(*cd));
if (!cd) {
return -ENOMEM;
}
Expand All @@ -145,10 +144,9 @@ static int aria_init(struct processing_module *mod)
}
mod_data->private = cd;

buf = rballoc(SOF_MEM_FLAG_USER, req_mem);
buf = mod_balloc(mod, req_mem);

if (!buf) {
rfree(cd);
comp_err(dev, "allocation failed for size %d", req_mem);
return -ENOMEM;
}
Expand All @@ -158,10 +156,6 @@ static int aria_init(struct processing_module *mod)

static int aria_free(struct processing_module *mod)
{
struct aria_data *cd = module_get_private_data(mod);

rfree(cd->data_addr);
rfree(cd);
return 0;
}

Expand Down
47 changes: 19 additions & 28 deletions src/audio/asrc/asrc.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include <sof/audio/ipc-config.h>
#include <rtos/panic.h>
#include <sof/ipc/msg.h>
#include <rtos/alloc.h>
#include <rtos/init.h>
#include <sof/lib/uuid.h>
#include <sof/math/numbers.h>
Expand Down Expand Up @@ -217,7 +216,7 @@ static int asrc_init(struct processing_module *mod)
return -EINVAL;
}

cd = rzalloc(SOF_MEM_FLAG_USER, sizeof(*cd));
cd = mod_alloc(mod, sizeof(*cd));
if (!cd)
return -ENOMEM;

Expand All @@ -242,7 +241,7 @@ static int asrc_init(struct processing_module *mod)
return 0;
}

static int asrc_initialize_buffers(struct asrc_farrow *src_obj)
static int asrc_initialize_buffers(struct processing_module *mod, struct asrc_farrow *src_obj)
{
int32_t *buf_32;
int16_t *buf_16;
Expand All @@ -261,7 +260,7 @@ static int asrc_initialize_buffers(struct asrc_farrow *src_obj)
buffer_size = src_obj->buffer_length * sizeof(int32_t);

for (ch = 0; ch < src_obj->num_channels; ch++) {
buf_32 = rzalloc(SOF_MEM_FLAG_USER, buffer_size);
buf_32 = mod_zalloc(mod, buffer_size);

if (!buf_32)
return -ENOMEM;
Expand All @@ -272,7 +271,7 @@ static int asrc_initialize_buffers(struct asrc_farrow *src_obj)
buffer_size = src_obj->buffer_length * sizeof(int16_t);

for (ch = 0; ch < src_obj->num_channels; ch++) {
buf_16 = rzalloc(SOF_MEM_FLAG_USER, buffer_size);
buf_16 = mod_zalloc(mod, buffer_size);

if (!buf_16)
return -ENOMEM;
Expand All @@ -284,7 +283,7 @@ static int asrc_initialize_buffers(struct asrc_farrow *src_obj)
return 0;
}

static void asrc_release_buffers(struct asrc_farrow *src_obj)
static void asrc_release_buffers(struct processing_module *mod, struct asrc_farrow *src_obj)
{
int32_t *buf_32;
int16_t *buf_16;
Expand All @@ -299,7 +298,7 @@ static void asrc_release_buffers(struct asrc_farrow *src_obj)

if (buf_32) {
src_obj->ring_buffers32[ch] = NULL;
rfree(buf_32);
mod_free(mod, buf_32);
}
}
else
Expand All @@ -308,23 +307,17 @@ static void asrc_release_buffers(struct asrc_farrow *src_obj)

if (buf_16) {
src_obj->ring_buffers16[ch] = NULL;
rfree(buf_16);
mod_free(mod, buf_16);
}
}
}

static int asrc_free(struct processing_module *mod)
{
struct comp_data *cd = module_get_private_data(mod);
struct comp_dev *dev = mod->dev;

comp_dbg(dev, "asrc_free()");

rfree(cd->buf);
asrc_release_buffers(cd->asrc_obj);
asrc_free_polyphase_filter(cd->asrc_obj);
rfree(cd->asrc_obj);
rfree(cd);
return 0;
}

Expand Down Expand Up @@ -614,8 +607,7 @@ static int asrc_prepare(struct processing_module *mod,
cd->buf_size = (cd->source_frames_max + cd->sink_frames_max) *
frame_bytes;

cd->buf = rzalloc(SOF_MEM_FLAG_USER,
cd->buf_size);
cd->buf = mod_zalloc(mod, cd->buf_size);
if (!cd->buf) {
cd->buf_size = 0;
comp_err(dev, "asrc_prepare(), allocation fail for size %d",
Expand All @@ -632,16 +624,15 @@ static int asrc_prepare(struct processing_module *mod,

/* Get required size and allocate memory for ASRC */
sample_bits = sample_bytes * 8;
ret = asrc_get_required_size(dev, &cd->asrc_size,
ret = asrc_get_required_size(mod, &cd->asrc_size,
audio_stream_get_channels(&sourceb->stream),
sample_bits);
if (ret) {
comp_err(dev, "asrc_prepare(), get_required_size_bytes failed");
goto err_free_buf;
}

cd->asrc_obj = rzalloc(SOF_MEM_FLAG_USER,
cd->asrc_size);
cd->asrc_obj = mod_zalloc(mod, cd->asrc_size);
if (!cd->asrc_obj) {
comp_err(dev, "asrc_prepare(), allocation fail for size %d",
cd->asrc_size);
Expand All @@ -659,7 +650,7 @@ static int asrc_prepare(struct processing_module *mod,
fs_sec = cd->source_rate;
}

ret = asrc_initialise(dev, cd->asrc_obj, audio_stream_get_channels(&sourceb->stream),
ret = asrc_initialise(mod, cd->asrc_obj, audio_stream_get_channels(&sourceb->stream),
fs_prim, fs_sec,
ASRC_IOF_INTERLEAVED, ASRC_IOF_INTERLEAVED,
ASRC_BM_LINEAR, cd->frames, sample_bits,
Expand All @@ -670,7 +661,7 @@ static int asrc_prepare(struct processing_module *mod,
}

/* Allocate ring buffers */
ret = asrc_initialize_buffers(cd->asrc_obj);
ret = asrc_initialize_buffers(mod, cd->asrc_obj);

/* check for errors */
if (ret) {
Expand Down Expand Up @@ -698,12 +689,12 @@ static int asrc_prepare(struct processing_module *mod,
return 0;

err_free_asrc:
asrc_release_buffers(cd->asrc_obj);
rfree(cd->asrc_obj);
asrc_release_buffers(mod, cd->asrc_obj);
mod_free(mod, cd->asrc_obj);
cd->asrc_obj = NULL;

err_free_buf:
rfree(cd->buf);
mod_free(mod, cd->buf);
cd->buf = NULL;

err:
Expand Down Expand Up @@ -865,10 +856,10 @@ static int asrc_reset(struct processing_module *mod)
asrc_dai_stop_timestamp(cd);

/* Free the allocations those were done in prepare() */
asrc_release_buffers(cd->asrc_obj);
asrc_free_polyphase_filter(cd->asrc_obj);
rfree(cd->asrc_obj);
rfree(cd->buf);
asrc_release_buffers(mod, cd->asrc_obj);
asrc_free_polyphase_filter(mod, cd->asrc_obj);
mod_free(mod, cd->asrc_obj);
mod_free(mod, cd->buf);
cd->asrc_obj = NULL;
cd->buf = NULL;

Expand Down
Loading
Loading