From 485e9adfce01b9b4e21dae927fb3b7ed3d5fc83d Mon Sep 17 00:00:00 2001 From: jacqueline Date: Fri, 25 Aug 2023 15:58:54 +1000 Subject: Performance tweaks for smoother tunes - Pin the decoder task to APP_CORE to reduce context switches - Increase sample buffer sizes --- src/audio/audio_decoder.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/audio/audio_decoder.cpp') diff --git a/src/audio/audio_decoder.cpp b/src/audio/audio_decoder.cpp index 03f81124..f9f76387 100644 --- a/src/audio/audio_decoder.cpp +++ b/src/audio/audio_decoder.cpp @@ -46,7 +46,7 @@ namespace audio { static const char* kTag = "audio_dec"; -static constexpr std::size_t kCodecBufferLength = 240 * 4; +static constexpr std::size_t kCodecBufferLength = 240 * 4 * 4; Timer::Timer(const codecs::ICodec::OutputFormat& format) : current_seconds_(0), @@ -79,7 +79,7 @@ auto Timer::AddSamples(std::size_t samples) -> void { auto Decoder::Start(std::shared_ptr source, std::shared_ptr sink) -> Decoder* { Decoder* task = new Decoder(source, sink); - tasks::StartPersistent([=]() { task->Main(); }); + tasks::StartPersistent(1, [=]() { task->Main(); }); return task; } -- cgit v1.2.3