Re: [LAD] Jack ringbuffer

From: Will J Godfrey <WillGodfrey@email-addr-hidden>
Date: Thu Dec 10 2015 - 18:39:43 EET

On Thu, 10 Dec 2015 06:51:48 -0800 (PST)
Len Ovens <len@email-addr-hidden> wrote:

> On Thu, 10 Dec 2015, Will J Godfrey wrote:
>
> > On Thu, 10 Dec 2015 09:07:25 -0500
> > Paul Davis <paul@email-addr-hidden> wrote:
> >
> >> On Thu, Dec 10, 2015 at 9:04 AM, Will Godfrey <willgodfrey@email-addr-hidden>
> >> wrote:
> >>
> >>> If I have a buffer size of 256 and always use a 4 byte data block, can I be
> >>> confident that reads and writes will either transfer the correct number
> >>> of bytes or none at all?
> >>>
> >>
> >>
> >> You cannot.
> >
> > Somehow I expected that would be the answer :(
> >
> > So, if I get, (say) three bytes processed, presumably I make another call for
> > just one.
>
> You can check if there are 4 bytes available, if not don't read (yet).
> Normally (at least for anything I have done) the reason I use the ring
> buffer is to divorce the data processing from any real time requirement.
> So I am reading the ring buffer in a loop, I can check how many bytes are
> available. jack_ringbuffer_read_space(buffer) can be used I think.

I'm doing this. My main concern was whether the pointers would be updated in
byte steps or block size steps, and what implications that might have.

I'm quite prepared to believe I might be over-thinking the problem. This has
been known before :)

-- 
It wasn't me! (Well actually, it probably was)
... the hard part is not dodging what life throws at you,
but trying to catch the good bits.
_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@email-addr-hidden
http://lists.linuxaudio.org/listinfo/linux-audio-dev
Received on Thu Dec 10 20:15:02 2015

This archive was generated by hypermail 2.1.8 : Thu Dec 10 2015 - 20:15:02 EET