diff options
author | Robin Gareus <robin@gareus.org> | 2017-08-05 01:27:41 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2017-08-05 01:28:11 +0200 |
commit | 2d60a69c2d3e1efa8fa4e5bdff151f1923f1aec7 (patch) | |
tree | bcc116ae4786ac3ba04bf909d9cc7c99ecd70746 /libs/surfaces/tranzport/init.cc | |
parent | 8374e23014f2254c7de23cf6f0e09e7dabd5303f (diff) |
Consolidate ctrl surface code
Diffstat (limited to 'libs/surfaces/tranzport/init.cc')
-rw-r--r-- | libs/surfaces/tranzport/init.cc | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/libs/surfaces/tranzport/init.cc b/libs/surfaces/tranzport/init.cc index 1e284b5831..96ff493c0e 100644 --- a/libs/surfaces/tranzport/init.cc +++ b/libs/surfaces/tranzport/init.cc @@ -43,16 +43,12 @@ TranzportControlProtocol::~TranzportControlProtocol () int TranzportControlProtocol::rtpriority_set(int priority) { - struct sched_param rtparam; - int err; char *a = (char*) alloca(4096*2); a[0] = 'a'; a[4096] = 'b'; - memset (&rtparam, 0, sizeof (rtparam)); - rtparam.sched_priority = priority; /* XXX should be relative to audio (JACK) thread */ // Note - try SCHED_RR with a low limit // - we don't care if we can't write everything this ms // and it will help if we lose the device - if ((err = pthread_setschedparam (pthread_self(), SCHED_FIFO, &rtparam)) != 0) { - PBD::info << string_compose (_("%1: thread not running with realtime scheduling (%2)"), name(), strerror (errno)) << endmsg; + if (set_thread_priority (SCHED_FIFO, priority)) { + PBD::info << string_compose (_("%1: thread not running with realtime scheduling."), name(), strerror (errno)) << endmsg; return 1; } return 0; |