summaryrefslogtreecommitdiff
path: root/src/audio/audio_task.cpp
diff options
context:
space:
mode:
authorjacqueline <me@jacqueline.id.au>2023-08-08 13:47:08 +1000
committerjacqueline <me@jacqueline.id.au>2023-08-08 13:47:08 +1000
commit93ccf11fc506b95221ce0c5eddaed9e0e6c8b3b5 (patch)
treefa70d13bf2df49f9601ceaca166ef31c3f034b69 /src/audio/audio_task.cpp
parent6c99f9f2fee0928987fe944c8ed29878064df87a (diff)
downloadtangara-fw-93ccf11fc506b95221ce0c5eddaed9e0e6c8b3b5.tar.gz
Investigate and improve core pinning for resampler
Diffstat (limited to 'src/audio/audio_task.cpp')
-rw-r--r--src/audio/audio_task.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/audio/audio_task.cpp b/src/audio/audio_task.cpp
index 7c038730..75b44594 100644
--- a/src/audio/audio_task.cpp
+++ b/src/audio/audio_task.cpp
@@ -109,7 +109,10 @@ auto Timer::bytes_to_samples(uint32_t bytes) -> uint32_t {
auto AudioTask::Start(IAudioSource* source, IAudioSink* sink) -> AudioTask* {
AudioTask* task = new AudioTask(source, sink);
- tasks::StartPersistent<tasks::Type::kAudio>([=]() { task->Main(); });
+ // Pin to CORE1 because codecs should be fixed point anyway, and being on
+ // the opposite core to the mixer maximises throughput in the worst case
+ // (some heavy codec like opus + resampling for bluetooth).
+ tasks::StartPersistent<tasks::Type::kAudio>(1, [=]() { task->Main(); });
return task;
}