• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: avoiding VM page swaps for big sample buffers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: avoiding VM page swaps for big sample buffers


  • Subject: Re: avoiding VM page swaps for big sample buffers
  • From: David Duncan <email@hidden>
  • Date: Sat, 25 Sep 2004 11:53:17 -0400

On Sep 25, 2004, at 11:34 AM, Frank (Steim) wrote:

In pre OSX systems if the user needed a big buffer he/she just assigned as much fysical memory as available and that was it. Now of course this is no longer possible with the result that if I load a sample of more than an hour long (16bits stereo, 44.1 kHz) into my buffer that is set to be 4000 seconds long (using a machine with 1Gb of RAM), and just wanting to play from the buffer I get a kAudioDeviceProcessorOverload notifiaction very often, resulting in interrupted audio playback.

Is there any way my app can claim a certain amount of RAM AND to avoid this to be swapped by the VM Manager? I tried the HoldMemory call but to no effect.

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


  • Follow-Ups:
    • Re: avoiding VM page swaps for big sample buffers
      • From: Frank (Steim) <email@hidden>
References: 
 >avoiding VM page swaps for big sample buffers (From: Frank (Steim) <email@hidden>)

  • Prev by Date: avoiding VM page swaps for big sample buffers
  • Next by Date: Re: avoiding VM page swaps for big sample buffers
  • Previous by thread: avoiding VM page swaps for big sample buffers
  • Next by thread: Re: avoiding VM page swaps for big sample buffers
  • Index(es):
    • Date
    • Thread