• 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: Page faults hurt sound quality
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Page faults hurt sound quality


  • Subject: Re: Page faults hurt sound quality
  • From: Philippe Wicker <email@hidden>
  • Date: Tue, 14 Oct 2003 08:35:16 +0200

On Monday, October 13, 2003, at 11:43 PM, James McCartney wrote:


On Oct 12, 2003, at 9:25 AM, Philippe Wicker wrote:

Have a look to the POSIX call "mlock" (documented in a man page), it may answer (at least partially) to your question.

You can't wire memory unless you are root.

Yes, I've noticed this in the meantime.


By wiring your sound buffers you are just making it more likely that your program's code gets paged out instead of the buffer, which is equally bad or worse. And if you wired your program in memory then it might page out a framework you need. Wiring more and more memory is just painting yourself in a corner. By the time the system needs to page, if it chooses one of your buffers it is because they are cold. Something will have to give.

So it appears that a good solution is to anticipate the use of the memory and to touch the pages.


Don't be unfriendly to the rest of the system. You could touch each page of your buffers in AudioUnitReset. If you want zeroed buffers use memset, not calloc, as calloc uses an optimization that will defer zeroing the memory until it is mapped by touching it.
If someone loads Photoshop while your AudioUnit is running there is not much you can do.

-
james mccartney
apple coreaudio


Philippe Wicker
email@hidden
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Page faults hurt sound quality
      • From: William Stewart <email@hidden>
References: 
 >Re: Page faults hurt sound quality (From: James McCartney <email@hidden>)

  • Prev by Date: Re: Audio midi setup with MOTU PCI 324 + 2048 MKII + 1296 + 24i
  • Next by Date: Re: Page faults hurt sound quality
  • Previous by thread: Re: Page faults hurt sound quality
  • Next by thread: Re: Page faults hurt sound quality
  • Index(es):
    • Date
    • Thread