Hello,
ok, read the chapter semaphores! B))
Am Freitag 14 Juli 2006 12:17 schrieb Dmitry Baikov:
The short answer:
#include <jack/jack.h>
#include <jack/ringbuffer.h>
#include <semaphore.h>
sem_t block_wait;
jack_ringbuffer_t ringbuf;
init()
{
int max_blocks = buffer_size_in_samples/jack_block_size
sem_init(&block_wait, 0, max_blocks);
}
fine , I understand!
jack_process()
{
float *out = jack_port_get_buffer(...);
jack_ringbuffer_read(ringbuf, out, block_size*sizeof(float));
sem_post(&block_wait);
}
Just to be sure.
This means every Port has his own Ringbuffer, right? So stereo needs two, 5.1
needs 6 ?
But i only need one sem_post for all, because i should avoid to have different
readpositions in my RingBuffers.
And if i understand Paul Davis in the right way, i never read more data as
jack needed, and this isn't more as 1 or 2k - normally. ??!
sizu c~