On Fri, April 3, 2009 10:38 am, hermann meyer wrote:
I open 2 clients because I wont 2 treads and give one
(the midi tread) a
lower prio with pthread_setschedprio. I first try to open the treads
from one client, but I cant figure out how to do, with 2 clients that
work fine with jackd.
I give the midi tread a lower prio, because at least it is a audio app,
so midi is "just a gast". On low level CPU's this protect the DSP for
xrun's when the CPU limit is reached.
Have you run in to problems with a single-client scheme? Was it giving
you xruns? IMHO, this is premature optimization. Doing two clients and
synchronizing threads is hard, error-prone work -- why not let JACK do
that work for you?
Besides, if your goal is to ignore MIDI input when the CPU load gets too
high, why not do something like:
process(){
if( ! too_busy_for_midi() ) {
// process MIDI
}
// process AUDIO
}
BTW, I see that your midi_process() is reading from a ringbuffer -- who is
*writing* to it?
Isn't it common open 2 Clients ?
I don't think so.
--
G a b r i e l M B e d d i n g f i e l d