From f772ab9f206b7356019f529cb4a98d5023962970 Mon Sep 17 00:00:00 2001 From: jacqueline Date: Wed, 14 Feb 2024 13:28:05 +1100 Subject: put the big opus alloc back into spiram it's not clear to me that it helps *that* much, since the ogg allocs are in internal ram anyway, and the memory pressure is just a bit much --- lib/opusfile/include/custom_support.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/opusfile/include/custom_support.h') diff --git a/lib/opusfile/include/custom_support.h b/lib/opusfile/include/custom_support.h index d99cc5e2..a5748989 100644 --- a/lib/opusfile/include/custom_support.h +++ b/lib/opusfile/include/custom_support.h @@ -8,7 +8,7 @@ static OPUS_INLINE void *opus_alloc (size_t size) { - return heap_caps_malloc(size, MALLOC_CAP_8BIT | MALLOC_CAP_INTERNAL); + return heap_caps_malloc(size, MALLOC_CAP_SPIRAM); } static OPUS_INLINE void opus_free (void *ptr) -- cgit v1.2.3 From 4bc77f901b1597b7cbc9ab7f4e0e354a7c93ed43 Mon Sep 17 00:00:00 2001 From: jacqueline Date: Wed, 14 Feb 2024 16:56:49 +1100 Subject: Tweak opus build flags and allocs This gets us to ~40% of one core cpu usage during playback. Good enough for a while I reckon! Paid for the internal ram usage by reclaiming some stack size headroom. --- lib/opusfile/include/custom_support.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'lib/opusfile/include/custom_support.h') diff --git a/lib/opusfile/include/custom_support.h b/lib/opusfile/include/custom_support.h index a5748989..60cab623 100644 --- a/lib/opusfile/include/custom_support.h +++ b/lib/opusfile/include/custom_support.h @@ -6,12 +6,10 @@ #define OVERRIDE_OPUS_ALLOC #define OVERRIDE_OPUS_FREE -static OPUS_INLINE void *opus_alloc (size_t size) -{ - return heap_caps_malloc(size, MALLOC_CAP_SPIRAM); +static OPUS_INLINE void* opus_alloc(size_t size) { + return heap_caps_malloc(size, MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT); } -static OPUS_INLINE void opus_free (void *ptr) -{ - heap_caps_free(ptr); +static OPUS_INLINE void opus_free(void* ptr) { + heap_caps_free(ptr); } -- cgit v1.2.3