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

From: conrad berhörster <conrad.berhoerster@email-addr-hidden>
Date: Fri Jul 14 2006 - 15:59:16 EEST

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

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