Thred priorities on no-PREEMPT_RT (Ubunutu)
This commit is contained in:
+2
-26
@@ -34,6 +34,7 @@
|
||||
#include "RtInversionGuard.hpp"
|
||||
#include "PiPedalException.hpp"
|
||||
#include "DummyAudioDriver.hpp"
|
||||
#include "SchedulerPriority.hpp"
|
||||
|
||||
#include "CpuUse.hpp"
|
||||
|
||||
@@ -1565,32 +1566,7 @@ namespace pipedal
|
||||
SetThreadName("alsaDriver");
|
||||
try
|
||||
{
|
||||
#if defined(__WIN32)
|
||||
// bump thread prioriy two levels to
|
||||
// ensure that the service thread doesn't
|
||||
// get bogged down by UIwork. Doesn't have to be realtime, but it
|
||||
// MUST run at higher priority than UI threads.
|
||||
xxx; // TO DO.
|
||||
#elif defined(__linux__)
|
||||
int min = sched_get_priority_min(SCHED_RR);
|
||||
int max = sched_get_priority_max(SCHED_RR);
|
||||
|
||||
struct sched_param param;
|
||||
memset(¶m, 0, sizeof(param));
|
||||
param.sched_priority = RT_THREAD_PRIORITY;
|
||||
|
||||
int result = sched_setscheduler(0, SCHED_RR, ¶m);
|
||||
if (result == 0)
|
||||
{
|
||||
Lv2Log::debug("Service thread priority successfully boosted.");
|
||||
}
|
||||
else
|
||||
{
|
||||
Lv2Log::error(SS("Failed to set ALSA AudioThread priority. (" << strerror(result) << ")"));
|
||||
}
|
||||
#else
|
||||
xxx; // TODO!
|
||||
#endif
|
||||
SetThreadPriority(SchedulerPriority::RealtimeAudio);
|
||||
|
||||
bool ok = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user