From 0eed821eb9527435c0d0b145d30f24f9c97a367b Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 21 Apr 2023 11:46:56 -0600 Subject: [PATCH] JACK: do not set the thread-init callback Because we use the non-callback API, we can call our thread init callback ourselves from ::process_thread(). In addition, the init_callback in JACK is used by every thread JACK creates, including the messagebuffer thread, and this confuses things from an Ardour POV where the callback was intended just for realtime threads. --- libs/backends/jack/jack_audiobackend.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/backends/jack/jack_audiobackend.cc b/libs/backends/jack/jack_audiobackend.cc index c1ca64e689..89070d146d 100644 --- a/libs/backends/jack/jack_audiobackend.cc +++ b/libs/backends/jack/jack_audiobackend.cc @@ -737,7 +737,9 @@ JACKAudioBackend::set_jack_callbacks () { GET_PRIVATE_JACK_POINTER (_priv_jack); - jack_set_thread_init_callback (_priv_jack, AudioEngine::thread_init_callback, 0); + /* no need to set the thread_init_callback because we use the + * non-callback API, and run the thread init callback in our own code. + */ jack_set_process_thread (_priv_jack, _process_thread, this); jack_set_sample_rate_callback (_priv_jack, _sample_rate_callback, this);