On Sun, Jan 08, 2017 at 07:25:47PM -0800, Yuri wrote:
  jackd on FreeBSD calls pthread_setschedparam(thread,
SCHED_FIFO, &rtparam)
 with rtparam.sched_priority = 10.
 I am wondering where does 10 come from? The range for SCHED_FIFO is 0 .. 31, 
On Linux, it's 1 .. 99.
  as returned by sched_get_priority_min() and
sched_get_priority_max(). The
 value 10 seems wrong, since the fastest priority is 0, the slowest is 31. 
On Linux, higher is definitely better:
   "Processes with numerically higher priority values are scheduled
    before processes  with  numerically  lower  priority  values."
  In controlapi.c
sched_get_priority_min()/sched_get_priority_max() are called
 for OpenBSD. For this purpose FreeBSD should be the same. So it should be
 #ifndef __OpenBSD__ && defined(__FreeBSD__). 
Please send a patch or ideally a pull request on github. It's easier to
discuss.
  Another problem is that FreeBSD doesn't allow to
set thread priorities
 for non-root users, but jackd is supposed to run by the regular user. 
You can always run without realtime priorities (-r or --no-realtime).
I'm surprised FreeBSD doesn't use PAM to allow users to call SCHED_FIFO.
You're sure about this?
HTH
--
mail: adi(a)thur.de       
http://adi.thur.de      PGP/GPG: key via keyserver