Re: Page faults hurt sound quality
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:42 +0200
On Monday, October 13, 2003, at 11:02 PM, Jeremy Sagan wrote:
Philippe,
I have been using mlock for quite some time now but this does not
address the issue of a sampler plug-in that needs its memory wired so
that page faults do not occur in the real time rendering process.
Does Apple's DLS synth handle this in a way that other plug-ins should?
Is there any standard way that plug-ins should behave to avoid page
faults?
Should the host be using the task-wire call?
Jeremy
On Sunday, October 12, 2003, at 12:25 PM, Philippe Wicker wrote:
On Sunday, October 12, 2003, at 06:08 PM, Jeremy Sagan wrote:
In March 11 2002, Herbie Robinson wrote a very useful and detailed
post on this list entitled 'Wired Memory Utilities' in which he
outlines 3 different ways to use wired memory in OS X. To the best of
my knowledge there is no Apple official documentation on the correct
way for hosts and plug-ins to handle the issue of page-faults in
audio applications.
Since plug-ins like samplers use very large chunks of memory is it
the plug-ins responsibility to wire its memory? Is it even possible,
running in user space? Should hosts use the task-wire call before
loading plug-ins?
Have a look to the POSIX call "mlock" (documented in a man page), it
may answer (at least partially) to your question.
I realized in the meantime that mlock may be used only for "root"
processes. As James McCartney wrote in a posting related to this
thread, locking memory is an unfair method. Another approach suitable
for samples players is to stream the audio in realtime from the disk.
Sounds are not loaded entirely in memory but only chunks corresponding
to the start of the sound. These "start" chunks stay in memory,
following chunks may be read from disk using a variant of the ping-pong
scheme (such as the one used in the CoreAudio sample code
PlayAudioFile). Pages containing "start" chunks may have to be touched
regularly to guarantee they are resident in physical memory.
It has been brought to my attention that page-ins seem much more
prevalent in Panther than they did in Jaguar. In either case a page
fault in the audio thread will cause a glitch.
Thanks,
Jeremy
_______________________________________________
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.
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.
_______________________________________________
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.
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.