Re: avoiding VM page swaps for big sample buffers
Re: avoiding VM page swaps for big sample buffers
- Subject: Re: avoiding VM page swaps for big sample buffers
- From: Frank (Steim) <email@hidden>
- Date: Sat, 25 Sep 2004 18:15:20 +0200
David,
thanks for the quick reply, but I need this buffer because in my
software the user can jump from one location in the buffer to another
instantly by either Midi control or LFO's. And by instantly I mean
within 1 millisecond. I don't think this can be achieved by streaming
the data from disk.
Frank
On 25 Sep 2004, at 17:53, David Duncan wrote:
I would say that you are using a buffer that is WAY too large. It is
possible to hold a certain amount of RAM (see man mlock) but this is
VERY rude for large amounts of memory (like a sample buffer). You
would do far better if you streamed in the data from disk during your
playback from a secondary thread and then played back from a much
smaller (say 30 sec max) buffer. There is some example code for a
lock-less ring buffer in the ComplexPlayThru example (link below).
This will let you read from your CA callback without blocking.
Complex Play Thru:
<http://developer.apple.com/samplecode/ComplexPlayThru/
ComplexPlayThru.html>
--
Reality is what, when you stop believing in it, doesn't go away.
Failure is not an option. It is a privilege reserved for those who try.
David Duncan
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden