summaryrefslogtreecommitdiff
path: root/src/audio/audio_decoder.cpp
diff options
context:
space:
mode:
authorjacqueline <me@jacqueline.id.au>2023-08-25 15:58:54 +1000
committerjacqueline <me@jacqueline.id.au>2023-08-25 15:58:54 +1000
commit485e9adfce01b9b4e21dae927fb3b7ed3d5fc83d (patch)
treeb6382f69a829bdc4214d41182cbb401a0c2d69b9 /src/audio/audio_decoder.cpp
parent795f26873742eaad7ce53084052d988a0fd542f8 (diff)
downloadtangara-fw-485e9adfce01b9b4e21dae927fb3b7ed3d5fc83d.tar.gz
Performance tweaks for smoother tunes
- Pin the decoder task to APP_CORE to reduce context switches - Increase sample buffer sizes
Diffstat (limited to 'src/audio/audio_decoder.cpp')
-rw-r--r--src/audio/audio_decoder.cpp4
1 files changed, 2 insertions, 2 deletions
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<IAudioSource> source,
std::shared_ptr<SampleConverter> sink) -> Decoder* {
Decoder* task = new Decoder(source, sink);
- tasks::StartPersistent<tasks::Type::kAudio>([=]() { task->Main(); });
+ tasks::StartPersistent<tasks::Type::kAudio>(1, [=]() { task->Main(); });
return task;
}