From 6b30b2c43bf71bab46c13b2476d1fc41a21c7ff2 Mon Sep 17 00:00:00 2001 From: Ben Nicholson Date: Fri, 2 Oct 2026 19:49:42 +1000 Subject: [PATCH] spotify: Tremor (Vorbis) allocations in PSRAM (bell patch 0003) Co-Authored-By: Claude Opus 5.5 --- .../patches/bell/0003-tremor-psram.patch | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 components/spotify/patches/bell/0003-tremor-psram.patch diff --git a/components/spotify/patches/bell/0003-tremor-psram.patch b/components/spotify/patches/bell/0003-tremor-psram.patch new file mode 100644 index 0000000..861ac9c --- /dev/null +++ b/components/spotify/patches/bell/0003-tremor-psram.patch @@ -0,0 +1,24 @@ +diff --git a/external/tremor/os_types.h b/external/tremor/os_types.h +index 8d444d6..857f340 100644 +--- a/external/tremor/os_types.h ++++ b/external/tremor/os_types.h +@@ -27,10 +27,19 @@ + + /* make it easy on the folks that want to compile the libs with a + different malloc than stdlib */ ++#ifdef ESP_PLATFORM ++/* decoder state and codebooks in PSRAM: keeps internal RAM free */ ++#include "esp_heap_caps.h" ++#define _ogg_malloc(s) heap_caps_malloc((s), MALLOC_CAP_SPIRAM) ++#define _ogg_calloc(n, s) heap_caps_calloc((n), (s), MALLOC_CAP_SPIRAM) ++#define _ogg_realloc(p, s) heap_caps_realloc((p), (s), MALLOC_CAP_SPIRAM) ++#define _ogg_free free ++#else + #define _ogg_malloc malloc + #define _ogg_calloc calloc + #define _ogg_realloc realloc + #define _ogg_free free ++#endif + + #ifdef _WIN32 +