Tweak sched priorities use given and 4 levels below.
This commit is contained in:
parent
f37ad624f6
commit
7ce43739e8
|
@ -1155,8 +1155,20 @@ int
|
|||
AudioEngine::client_real_time_priority ()
|
||||
{
|
||||
if (!_backend) {
|
||||
assert (0);
|
||||
return PBD_RT_PRI_PROC;
|
||||
}
|
||||
if (!_backend->is_realtime ()) {
|
||||
/* this is only an issue with the Dummy backend.
|
||||
* - with JACK, we require rt permissions.
|
||||
* - with ALSA/Pulseaudio this can only happen if rt permissions
|
||||
* are n/a. Other atempts to get rt will fail likewise.
|
||||
*
|
||||
* perhaps:
|
||||
* TODO: use is_realtime () ? PBD_SCHED_FIFO : PBD_SCHED_OTHER
|
||||
*/
|
||||
return PBD_RT_PRI_PROC; // XXX
|
||||
}
|
||||
|
||||
return _backend->client_real_time_priority();
|
||||
}
|
||||
|
|
|
@ -189,7 +189,7 @@ AutomationWatch::timer ()
|
|||
void
|
||||
AutomationWatch::thread ()
|
||||
{
|
||||
pbd_set_thread_priority (pthread_self(), PBD_SCHED_FIFO, AudioEngine::instance()->client_real_time_priority() - 3);
|
||||
pbd_set_thread_priority (pthread_self(), PBD_SCHED_FIFO, AudioEngine::instance()->client_real_time_priority() - 2);
|
||||
pthread_set_name ("AutomationWatch");
|
||||
while (_run_thread) {
|
||||
Glib::usleep ((gulong) floor (Config->get_automation_interval_msecs() * 1000));
|
||||
|
|
|
@ -158,7 +158,7 @@ Convolution::restart ()
|
|||
}
|
||||
|
||||
if (rv == 0) {
|
||||
rv = _convproc.start_process (pbd_absolute_rt_priority (PBD_SCHED_FIFO, AudioEngine::instance ()->client_real_time_priority () - 2), PBD_SCHED_FIFO);
|
||||
rv = _convproc.start_process (pbd_absolute_rt_priority (PBD_SCHED_FIFO, AudioEngine::instance ()->client_real_time_priority () - 1), PBD_SCHED_FIFO);
|
||||
}
|
||||
|
||||
assert (rv == 0); // bail out in debug builds
|
||||
|
|
|
@ -698,7 +698,7 @@ ARDOUR::init_post_engine (uint32_t start_cnt)
|
|||
}
|
||||
}
|
||||
|
||||
BaseUI::set_thread_priority (pbd_absolute_rt_priority (PBD_SCHED_FIFO, AudioEngine::instance()->client_real_time_priority () - 3));
|
||||
BaseUI::set_thread_priority (pbd_absolute_rt_priority (PBD_SCHED_FIFO, AudioEngine::instance()->client_real_time_priority () - 2));
|
||||
|
||||
TransportMasterManager::instance ().restart ();
|
||||
}
|
||||
|
|
|
@ -545,7 +545,7 @@ LV2Plugin::init(const void* c_plugin, samplecnt_t rate)
|
|||
static const int32_t _min_block_length = 1; // may happen during split-cycles
|
||||
static const int32_t _max_block_length = 8192; // max possible (with all engines and during export)
|
||||
static const int32_t rt_policy = PBD_SCHED_FIFO;
|
||||
static const int32_t rt_priority = pbd_absolute_rt_priority (PBD_SCHED_FIFO, AudioEngine::instance()->client_real_time_priority () - 2);
|
||||
static const int32_t rt_priority = pbd_absolute_rt_priority (PBD_SCHED_FIFO, AudioEngine::instance()->client_real_time_priority () - 1);
|
||||
/* Consider updating max-block-size whenever the buffersize changes.
|
||||
* It requires re-instantiating the plugin (which is a non-realtime operation),
|
||||
* so it should be done lightly and only for plugins that require it.
|
||||
|
|
|
@ -321,6 +321,7 @@ pbd_absolute_rt_priority (int policy, int priority)
|
|||
const int p_max = sched_get_priority_max (policy); // Linux: 99
|
||||
|
||||
if (priority == 0) {
|
||||
assert (0);
|
||||
priority = (p_min + p_max) / 2;
|
||||
} else if (priority > 0) {
|
||||
/* value relative to minium */
|
||||
|
|
Loading…
Reference in New Issue
Block a user