Set Automationwatch thread priority (needs to be higher than GUI)
authorRobin Gareus <robin@gareus.org>
Tue, 29 Aug 2017 15:16:03 +0000 (17:16 +0200)
committerRobin Gareus <robin@gareus.org>
Tue, 29 Aug 2017 15:25:23 +0000 (17:25 +0200)
This fixes an issue with sparse automation touch/write when the CPU is
busy (stationary playhead, waveform rendering, or just high DSP load)

libs/ardour/automation_watch.cc

index a7a7a36eedd4f6e61e8e5d69e355ad906a79711d..c949509d091e88348cdf8bdb8801fec4e33214f3 100644 (file)
@@ -22,6 +22,7 @@
 #include <glibmm/timer.h>
 
 #include "pbd/compose.h"
+#include "pbd/pthread_utils.h"
 
 #include "ardour/automation_control.h"
 #include "ardour/automation_watch.h"
@@ -185,6 +186,7 @@ AutomationWatch::timer ()
 void
 AutomationWatch::thread ()
 {
+       pbd_set_thread_priority (pthread_self(), SCHED_FIFO, -25);
        while (_run_thread) {
                Glib::usleep ((gulong) floor (Config->get_automation_interval_msecs() * 1000));
                timer ();