[PlanetCCRMA] Realtime PD Troubles

Fernando Pablo Lopez-Lezcano nando@ccrma.Stanford.EDU
Mon Jan 12 16:52:01 2004


> Thanks for all of the new PD goodies for fedora!

Sure...

> I have run into a problem, though.  When I run pd (0.37.0-2.cvs) with
> the -rt flag, it locks up when trying to play any audio.  I can
> reproduce this consistently by starting up jack, running pd -rt -jack
> and then opening the test audio window.  Lock up! Leaving off the -rt
> solves the problem.  The problem is, without the -rt I get a steady
> stream of DIO errors.  Any ideas?  Thanks very much.

I think you are trying for mutually incompatible realtime options. 

Exactly which options are you using to try to start Pd? I'm going to
imagine what you are probably doing. This would only work as root (bad)
or making pd suid root (slightly less bad :-)

"pd -jack": this apparently works and will run the audio thread of pd
with realtime priorities. If you get skips then you could try to tune
the buffer size or number of buffer when you start jack. 

"pd -rt": this will run with alsa and with the internal pd code for
realtime priority. The audio thread will (that is what it prints) run
with priority 98 (100 is the highest). This should only work as root or
if you make pd suid root. 

Now, if you do:

"pd -rt -jack": most probably you are forcing a deadlock (I went as far
as starting it, did not try to open the audio test patch - too many
things running on the machine :-). The internal pd realtime priority is
98. I believe the jack priority for audio threads is _lower_ than that
(I would have to check the source of jack). So most probably you have
the pd internal realtime stuff waiting (forever) for the audio thread to
be executed. That will never happen if the priority of the realtime
audio thread is < 98. Just guessing here but this would match the
observed behavior. 

So, I think your options are either run with alsa directly or tweak the
jack parameters for more buffers or bigger buffers. Beware that the alsa
code in pd ignores xruns completely (that was discussed a while ago in
the jack list) while jack deals with them and signals their existence. I
think there is now a flag for jack that can emulate that behavior and
ignore xruns (can't remember now the name of the flag). 

-- Fernando