• 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: iTunes stuttering, and don't shoot me--it might involve Core Audio
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: iTunes stuttering, and don't shoot me--it might involve Core Audio


  • Subject: Re: iTunes stuttering, and don't shoot me--it might involve Core Audio
  • From: Take Vos <email@hidden>
  • Date: Tue, 9 Aug 2005 21:22:21 +0200

Hi,

> It does raise a question I have been meaning to ask: Is there some way to
> hint to the OS that in the near future, a particular page of memory is going
> to be needed so the VM engine could have it ready in physical ram for the
> next core-audio render cycle?
Yes there is.


First use valloc() function to allocate page aligned memory.
Then use mlock() function to lock this memory, this memory will not be swapped out, also this function guaranties that all pages actually point to physical memory.


Use munlock() to unlock this memory and free() to free the memory.

I use this for the ring buffer of my audio recording application, also at the end of the io cycle after you've written into the ring buffer, one should call OSMemoryBarrier() to flush the cpu cache to the ring buffer. This so that the thread that reads from the ring buffer will actually get data on multi cpu machines.

Take

_______________________________________________
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: iTunes stuttering, and don't shoot me--it might involve Core Audio
      • From: Steve Checkoway <email@hidden>
  • Prev by Date: Re: Non-blocking memory allocation in real time threads
  • Next by Date: Re: How to save/load custom audio driver properties
  • Previous by thread: Re: AUNetSend and AUNetReceive
  • Next by thread: Re: iTunes stuttering, and don't shoot me--it might involve Core Audio
  • Index(es):
    • Date
    • Thread