Am 26.08.2014 um 15:59 schrieb Garth Hjelte <[email protected]>:

>  In your examples you set it to 1024*1024 but I set it to 2048*2048.

Okay. 4 MB is better than 1 MB.

4 MB are 11 seconds for 44.1 KHz stereo.

> I was ignoring that ReadFrames() might not fill up the memoryblock m and 
> return numFrames that is lower than the size of m, in cases where the 
> ringbuffer isn't filled up enough. Although it's strange that I was getting 
> dropouts further into stream, not right at the start. The correction is this:

okay. great.

> My question is - what is a "frame"? Sometimes the term is used for a set of 
> bytes representing one sample, other times it's used to indicate bytes that 
> represent all the channel's samples. (So the former it would be 4 bytes, in 
> cases of stereo it's 8.) I think in your case it's the former, but I wanted 
> to ask to make sure.

frame is one little number. As we use single values (32bit floating point), it 
is 4 bytes big.
For stereo you have a frame for left and one for right.

> And in almost most cases, you always are recording in stereo and the data is 
> in floats, right? I know in OpenStream() you can say channels=1, but that 
> assumes the left input since most/all sources are stereo?

I'm not sure how mono is made. Could be just one channel picked or a mixdown of 
both.

> (It's your references to "/4" where I assume a frame is a single sample, not 
> all the channels' samples.)

/4 because we have mono and 32 bit floats.

> You say "use a big buffer" but is that the size of the ring buffer or the 
> size of "m" which you grab things out of ReadFrames()?

Reduce the number of ReadFrames calls as each call blocks the buffer for a 
little time, so the callback filling it needs to wait.

>  I use paFramesPerBufferUnspecified in OpenStream()

that's another buffer :-)

> so it's kind of the Wild West here when it comes to efficiency. I know you 
> can use BufferWriteIndex or BufferReadIndex to debug, perhaps I could write 
> code to indicate if I hit a wraparound circumstance but I was sort of 
> expecting the stream to flag that, but perhaps it's busy with its own work?

you can simply compare those two properties and see if write index overtakes 
read index

> When you say calling ReadFrames is expensive, I get that, but does it matter? 
> Given a large ring buffer and getting as much out of ReadFrames() as 
> possible, I'm kind fo rich as it is. I call ReadFrames with a timer, I call 
> it every 250ms, could I call it quicker?

it's nothing to worry about. It's just that if you call it 1 time per second, 
you have less overhead compared to 100 times per second.

Sincerely
Christian

-- 
Read our blog about news on our plugins:

http://www.mbsplugins.de/

_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
[email protected]
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Reply via email to