Hi Conrad,
Now the question:
- The worker thread is faster then the jackthread. (Sure, it should be).
Faster, but it might be irregular. That's what determines the ringbuffer
size.
What
is the usual way to pause the workerthread and wake up again, when the
ringbuffer needs more data.
I use usleep, though I am suppose that's a bit crude.. Is the ringbuffer
full? Then sleep a little bit. If not, read N samples from disk and write
it in the buffer.
-Which size should the ringbuffer have.
I think this depends on many factors, such as hard disk speed.
- H oxw should the ringbuffer be initilized when
starting to play?
- Any small program to have look into or a good inroduction into pthreads?.
Another question is: how much time in advance should the workerthread
start reading, in order the have the first buffer filled when the
playerthread needs it?
I also observed that launching a thread can take a long time (esp. on
MacOSX), so I suppose you want to have the workerthread launched in
advance, and make it start reading when you need it.
maarten