Re: [linux-audio-dev] diskstream and jack

From: <mdeboer@email-addr-hidden>
Date: Fri Jul 14 2006 - 13:16:03 EEST

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
Received on Fri Jul 14 16:15:05 2006

This archive was generated by hypermail 2.1.8 : Fri Jul 14 2006 - 16:15:05 EEST