diff options
| author | jacqueline <me@jacqueline.id.au> | 2024-02-14 16:56:49 +1100 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2024-02-14 16:56:49 +1100 |
| commit | 4bc77f901b1597b7cbc9ab7f4e0e354a7c93ed43 (patch) | |
| tree | 247482110206db8f4c7058d912a72d50cfab117f /src/tasks/tasks.cpp | |
| parent | f772ab9f206b7356019f529cb4a98d5023962970 (diff) | |
| download | tangara-fw-4bc77f901b1597b7cbc9ab7f4e0e354a7c93ed43.tar.gz | |
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.
Diffstat (limited to 'src/tasks/tasks.cpp')
| -rw-r--r-- | src/tasks/tasks.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/tasks/tasks.cpp b/src/tasks/tasks.cpp index d53eface..aa382655 100644 --- a/src/tasks/tasks.cpp +++ b/src/tasks/tasks.cpp @@ -39,22 +39,20 @@ auto AllocateStack() -> cpp::span<StackType_t>; // usually written with embedded use cases in mind. template <> auto AllocateStack<Type::kAudioDecoder>() -> cpp::span<StackType_t> { - constexpr std::size_t size = 24 * 1024; + constexpr std::size_t size = 20 * 1024; static StackType_t sStack[size]; return {sStack, size}; } -// LVGL requires only a relatively small stack. However, it can be allocated in -// PSRAM so we give it a bit of headroom for safety. +// LVGL requires only a relatively small stack. Lua's stack is allocated +// separately. template <> auto AllocateStack<Type::kUi>() -> cpp::span<StackType_t> { - constexpr std::size_t size = 16 * 1024; + constexpr std::size_t size = 14 * 1024; static StackType_t sStack[size]; return {sStack, size}; } template <> -// PCM conversion and resampling uses a very small amount of stack. It works -// entirely with PSRAM-allocated buffers, so no real speed gain from allocating -// it internally. +// PCM conversion and resampling uses a very small amount of stack. auto AllocateStack<Type::kAudioConverter>() -> cpp::span<StackType_t> { constexpr std::size_t size = 4 * 1024; static StackType_t sStack[size]; |
