[PD] realtime-lsm, jackd and PD [simple question]

derek holzer derek at x-i.net
Mon Jan 3 20:42:25 CET 2005

Hi Wade,

thewade wrote:

> Im using 0.38-0test13 because Millers source didnt compile
> on my x86_64 when last I tried. Also I have been told that
> using the -jack and -rt flags is a oxymoron. The -rt flag
> is for alsa and the -jack is (obviously) for jack. 

mmmm... as per my earlier response to that comment of Fernando's... 
sorry, but I just don't buy it.

I can run jackd realtime, connect to it with PD w/o realtime, and I 
still get dropouts when I move PD windows around which Jack doesn't even 
notice. I think the -rt flag has more function than simply an ALSA 
interface, but also has to do with kernel processes. Still waiting for a 
clear explaination from the developers about this, but the closest thing 
I have found is from Frank Barknecht [I beleive in answer to a question 
of yours]:

Frank Barknecht wrote:

> This is a bit complicated to explain, but I'll try my best as far as I
> understand it: 
> Linux, being a true multitasking/multiuser sytem, has many processes
> running concurrently. But there is only a limited amount of ressources
> available (one or two or more CPUs, ...) so there must be an instance,
> that keeps track of when a processes turn is coming. This instance is
> the so called Scheduler in the Linux kernel. Normally this Scheduler
> just more or less evenly divides the ressources and processor times
> between processes. But it is possible, that a process might require
> more or more immediate action. This is quite typical in our audio
> world: If you want to record something, you cannot afford a single
> lost sample, whereas an email transport doesn't care for several 
> seconds more wait.
> To get the scheduler to play nicer with (audio) processes these
> processes need to be "scheduled higher". For security reasons only the
> root user is allowed to do that per default. (There are several other
> solutions for this: Capabilities, Linux Security Modules and maybe
> more).
> So if Pd is run by root or has been setuid root, it tries to convince
> the Scheduler, that it is more equal than other processes. If you look
> into src/s_inter.c, you will see several things happen that have names
> with "sched" like "sched_get_priority_max" in set_priority. This is
> the realtime scheduling in Pd on Linux (and maybe OS-X).

thewade wrote:

> What we
> should be able to do is run jackd as user and pd as user,
> jackd gets priority in the scheduler by virtue of
> realtime-lsm and pd connects to jack. I guess that jackd
> is the only part of the system that needs priority in the
> scheduler...

In theory yes, but in practice no way. Running *both* PD and Jack 
realtime is the only setup which has ever been useful for me to do live 
performance, or even to reap the benefits of having a Hammerfall soundcard.


derek holzer ::: http://www.umatic.nl
---Oblique Strategy # 36:
"Consult other sources

More information about the Pd-list mailing list