mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-10 08:36:32 +01:00
ALSA rt-thread priority fixes
This commit is contained in:
parent
b68d2e25b2
commit
c452cd9be2
3 changed files with 12 additions and 10 deletions
|
|
@ -491,7 +491,7 @@ AlsaAudioBackend::_start (bool for_latency_measurement)
|
||||||
_run = true;
|
_run = true;
|
||||||
_port_change_flag = false;
|
_port_change_flag = false;
|
||||||
|
|
||||||
if (_realtime_pthread_create (SCHED_FIFO, -20,
|
if (_realtime_pthread_create (SCHED_FIFO, -20, 100000,
|
||||||
&_main_thread, pthread_process, this))
|
&_main_thread, pthread_process, this))
|
||||||
{
|
{
|
||||||
if (pthread_create (&_main_thread, NULL, pthread_process, this))
|
if (pthread_create (&_main_thread, NULL, pthread_process, this))
|
||||||
|
|
@ -620,16 +620,19 @@ AlsaAudioBackend::create_process_thread (boost::function<void()> func)
|
||||||
pthread_attr_t attr;
|
pthread_attr_t attr;
|
||||||
size_t stacksize = 100000;
|
size_t stacksize = 100000;
|
||||||
|
|
||||||
pthread_attr_init (&attr);
|
|
||||||
pthread_attr_setstacksize (&attr, stacksize);
|
|
||||||
ThreadData* td = new ThreadData (this, func, stacksize);
|
ThreadData* td = new ThreadData (this, func, stacksize);
|
||||||
|
|
||||||
|
if (_realtime_pthread_create (SCHED_FIFO, -21, stacksize,
|
||||||
|
&thread_id, alsa_process_thread, td)) {
|
||||||
|
pthread_attr_init (&attr);
|
||||||
|
pthread_attr_setstacksize (&attr, stacksize);
|
||||||
if (pthread_create (&thread_id, &attr, alsa_process_thread, td)) {
|
if (pthread_create (&thread_id, &attr, alsa_process_thread, td)) {
|
||||||
PBD::error << _("AudioEngine: cannot create process thread.") << endmsg;
|
PBD::error << _("AudioEngine: cannot create process thread.") << endmsg;
|
||||||
pthread_attr_destroy (&attr);
|
pthread_attr_destroy (&attr);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
pthread_attr_destroy (&attr);
|
pthread_attr_destroy (&attr);
|
||||||
|
}
|
||||||
|
|
||||||
_threads.push_back (thread_id);
|
_threads.push_back (thread_id);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
|
|
@ -134,7 +134,7 @@ static void * pthread_process (void *arg)
|
||||||
int
|
int
|
||||||
AlsaRawMidiIO::start ()
|
AlsaRawMidiIO::start ()
|
||||||
{
|
{
|
||||||
if (_realtime_pthread_create (SCHED_FIFO, -19,
|
if (_realtime_pthread_create (SCHED_FIFO, -21, 100000,
|
||||||
&_main_thread, pthread_process, this))
|
&_main_thread, pthread_process, this))
|
||||||
{
|
{
|
||||||
if (pthread_create (&_main_thread, NULL, pthread_process, this)) {
|
if (pthread_create (&_main_thread, NULL, pthread_process, this)) {
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
static int
|
static int
|
||||||
_realtime_pthread_create (
|
_realtime_pthread_create (
|
||||||
int policy, int priority,
|
const int policy, int priority, const size_t stacksize,
|
||||||
pthread_t *thread,
|
pthread_t *thread,
|
||||||
void *(*start_routine) (void *),
|
void *(*start_routine) (void *),
|
||||||
void *arg)
|
void *arg)
|
||||||
|
|
@ -33,7 +33,6 @@ _realtime_pthread_create (
|
||||||
|
|
||||||
pthread_attr_t attr;
|
pthread_attr_t attr;
|
||||||
struct sched_param parm;
|
struct sched_param parm;
|
||||||
const size_t stacksize = 100000;
|
|
||||||
|
|
||||||
const int p_min = sched_get_priority_min (policy);
|
const int p_min = sched_get_priority_min (policy);
|
||||||
const int p_max = sched_get_priority_max (policy);
|
const int p_max = sched_get_priority_max (policy);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue