Add API to query backend realtime thread priority
authorRobin Gareus <robin@gareus.org>
Wed, 10 Oct 2018 23:36:10 +0000 (01:36 +0200)
committerRobin Gareus <robin@gareus.org>
Thu, 11 Oct 2018 13:29:40 +0000 (15:29 +0200)
libs/ardour/ardour/audioengine.h
libs/backends/jack/jack_audiobackend.cc
libs/backends/jack/jack_audiobackend.h

index 6e7cdf74969f02caa2952bbdf8cd6cfc9ff2a0a4..4548ad7391b13252a8ca204bede8ead0cfd18a7a 100644 (file)
@@ -106,6 +106,17 @@ class LIBARDOUR_API AudioEngine : public PortManager, public SessionHandlePtr
        bool           in_process_thread ();
        uint32_t       process_thread_count ();
 
+       /* internal backends
+        * -20 : main thread
+        * -21 : additional I/O threads e.g. MIDI
+        * -22 : client/process threads
+        *
+        * search for
+        * - pbd_realtime_pthread_create
+        * - pbd_set_thread_priority
+        */
+       virtual int    client_real_time_priority () { return -22; }
+
        int            backend_reset_requested();
        void           request_backend_reset();
        void           request_device_list_update();
index 616964c3f24f866cf6456e0d2d3101764ee6bd44..4258b9c23a8a0a29929aa452c393f1efe8df680c 100644 (file)
@@ -926,6 +926,13 @@ JACKAudioBackend::process_thread_count ()
        return _jack_threads.size();
 }
 
+int
+JACKAudioBackend::client_real_time_priority ()
+{
+       GET_PRIVATE_JACK_POINTER_RET (_priv_jack, 0);
+       return jack_client_real_time_priority (_priv_jack);
+}
+
 void*
 JACKAudioBackend::_start_process_thread (void* arg)
 {
index 7d6d1bd9773171aaa44197efd97fb9ae13b4960f..e14396ea24e21273b9f2c239f07c1955b587d019 100644 (file)
@@ -110,6 +110,7 @@ class JACKAudioBackend : public AudioBackend {
     int join_process_threads ();
     bool in_process_thread ();
     uint32_t process_thread_count ();
+               int client_real_time_priority ();
 
     void transport_start ();
     void transport_stop ();