diff --git a/src/ossia/audio/alsa_protocol.hpp b/src/ossia/audio/alsa_protocol.hpp index 307fe5ddcab..1a7cb1aeab8 100644 --- a/src/ossia/audio/alsa_protocol.hpp +++ b/src/ossia/audio/alsa_protocol.hpp @@ -517,7 +517,12 @@ class alsa_engine final : public audio_engine } private: - void init_thread() { ossia::set_thread_name("ossia audio 0"); } + void init_thread() + { + ossia::set_thread_name("ossia audio 0"); + ossia::set_thread_pinned(thread_type::Audio, 0); + } + void clear_buffers() { ossia::fill(this->m_temp_buffer, 0.f); diff --git a/src/ossia/audio/dummy_protocol.hpp b/src/ossia/audio/dummy_protocol.hpp index 9918fdf54bd..6405adf9abd 100644 --- a/src/ossia/audio/dummy_protocol.hpp +++ b/src/ossia/audio/dummy_protocol.hpp @@ -33,6 +33,7 @@ class dummy_engine final : public audio_engine m_runThread = std::thread{[this, us_per_buffer] { ossia::set_thread_name("ossia audio 0"); + ossia::set_thread_pinned(thread_type::Audio, 0); using clk = std::chrono::high_resolution_clock; diff --git a/src/ossia/audio/jack_protocol.hpp b/src/ossia/audio/jack_protocol.hpp index 32a99958d04..c2b597aafb8 100644 --- a/src/ossia/audio/jack_protocol.hpp +++ b/src/ossia/audio/jack_protocol.hpp @@ -266,6 +266,7 @@ class jack_engine final : public audio_engine { static const thread_local auto _ = [] { ossia::set_thread_name("ossia audio 0"); + ossia::set_thread_pinned(thread_type::Audio, 0); return 0; }(); diff --git a/src/ossia/audio/pipewire_protocol.hpp b/src/ossia/audio/pipewire_protocol.hpp index a761e316702..e228a3fc42c 100644 --- a/src/ossia/audio/pipewire_protocol.hpp +++ b/src/ossia/audio/pipewire_protocol.hpp @@ -774,6 +774,7 @@ class pipewire_audio_protocol : public audio_engine { static const thread_local auto _ = [] { ossia::set_thread_name("ossia audio 0"); + ossia::set_thread_pinned(thread_type::Audio, 0); return 0; }(); diff --git a/src/ossia/audio/portaudio_protocol.hpp b/src/ossia/audio/portaudio_protocol.hpp index 25c6821a01c..8cd2445b83f 100644 --- a/src/ossia/audio/portaudio_protocol.hpp +++ b/src/ossia/audio/portaudio_protocol.hpp @@ -189,6 +189,7 @@ class portaudio_engine final : public audio_engine { static const thread_local auto _ = [] { ossia::set_thread_name("ossia audio 0"); + ossia::set_thread_pinned(thread_type::Audio, 0); return 0; }(); diff --git a/src/ossia/audio/sdl_protocol.hpp b/src/ossia/audio/sdl_protocol.hpp index bd60a807151..92ad17d7317 100644 --- a/src/ossia/audio/sdl_protocol.hpp +++ b/src/ossia/audio/sdl_protocol.hpp @@ -64,6 +64,7 @@ class sdl_protocol final : public audio_engine { static const thread_local auto _ = [] { ossia::set_thread_name("ossia audio 0"); + ossia::set_thread_pinned(thread_type::Audio, 0); return 0; }();