From aa239bcc05827ed873ae52795f289c7e2fe2e436 Mon Sep 17 00:00:00 2001 From: Trevor Wu Date: Wed, 25 Oct 2023 16:24:13 +0800 Subject: [PATCH 1/2] audio: module adapter: fix redefinition problem When I was using xtensa to build mt8188 platform, I encountered an error: 'redefinition of i'. To fix the problem, I removed the declaration in the for loop. Signed-off-by: Trevor Wu --- src/audio/module_adapter/module_adapter.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/audio/module_adapter/module_adapter.c b/src/audio/module_adapter/module_adapter.c index e7e4619ad840..a1f18cd034b4 100644 --- a/src/audio/module_adapter/module_adapter.c +++ b/src/audio/module_adapter/module_adapter.c @@ -1450,9 +1450,9 @@ int module_adapter_reset(struct comp_dev *dev) #endif /* CONFIG_ZEPHYR_DP_SCHEDULER */ if (IS_PROCESSING_MODE_SINK_SOURCE(mod)) { /* for both LL and DP processing */ - for (int i = 0; i < mod->num_of_sources; i++) + for (i = 0; i < mod->num_of_sources; i++) mod->sources[i] = NULL; - for (int i = 0; i < mod->num_of_sinks; i++) + for (i = 0; i < mod->num_of_sinks; i++) mod->sinks[i] = NULL; mod->num_of_sinks = 0; mod->num_of_sources = 0; From 2959e43f68e669146dc265b628f80e0503a9bd91 Mon Sep 17 00:00:00 2001 From: Trevor Wu Date: Wed, 25 Oct 2023 16:57:06 +0800 Subject: [PATCH 2/2] platform: mtk: fix memory allocation problem Because the size of struct comp_buffer has increased, the current heap layout for the basic use case is not enough. Some use cases are experiencing out of memory issues, c0 memory src/lib/alloc.c:765 ERROR failed to alloc 0x180 bytes zone 0x4 caps 0x1 flags 0x0 To fix this issue, we increase the number of 512-byte heap blocks to 32. Signed-off-by: Trevor Wu --- src/platform/mt8186/include/platform/lib/memory.h | 2 +- src/platform/mt8188/include/platform/lib/memory.h | 2 +- src/platform/mt8195/include/platform/lib/memory.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/platform/mt8186/include/platform/lib/memory.h b/src/platform/mt8186/include/platform/lib/memory.h index c3532b103cda..65148c9c348d 100644 --- a/src/platform/mt8186/include/platform/lib/memory.h +++ b/src/platform/mt8186/include/platform/lib/memory.h @@ -115,7 +115,7 @@ #define HEAP_RT_COUNT64 32 #define HEAP_RT_COUNT128 32 #define HEAP_RT_COUNT256 32 -#define HEAP_RT_COUNT512 4 +#define HEAP_RT_COUNT512 32 #define HEAP_RT_COUNT1024 4 #define HEAP_RT_COUNT2048 2 #define HEAP_RT_COUNT4096 2 diff --git a/src/platform/mt8188/include/platform/lib/memory.h b/src/platform/mt8188/include/platform/lib/memory.h index c3532b103cda..65148c9c348d 100644 --- a/src/platform/mt8188/include/platform/lib/memory.h +++ b/src/platform/mt8188/include/platform/lib/memory.h @@ -115,7 +115,7 @@ #define HEAP_RT_COUNT64 32 #define HEAP_RT_COUNT128 32 #define HEAP_RT_COUNT256 32 -#define HEAP_RT_COUNT512 4 +#define HEAP_RT_COUNT512 32 #define HEAP_RT_COUNT1024 4 #define HEAP_RT_COUNT2048 2 #define HEAP_RT_COUNT4096 2 diff --git a/src/platform/mt8195/include/platform/lib/memory.h b/src/platform/mt8195/include/platform/lib/memory.h index 33e0e1e74f1a..47bb91202bfb 100644 --- a/src/platform/mt8195/include/platform/lib/memory.h +++ b/src/platform/mt8195/include/platform/lib/memory.h @@ -103,7 +103,7 @@ #define HEAP_RT_COUNT64 32 #define HEAP_RT_COUNT128 32 #define HEAP_RT_COUNT256 32 -#define HEAP_RT_COUNT512 4 +#define HEAP_RT_COUNT512 32 #define HEAP_RT_COUNT1024 4 #define HEAP_RT_COUNT2048 2 #define HEAP_RT_COUNT4096 2