Re: PlayThru (was: AudioUnit for default input device)
Re: PlayThru (was: AudioUnit for default input device)
- Subject: Re: PlayThru (was: AudioUnit for default input device)
- From: Jeff Moore <email@hidden>
- Date: Tue, 20 Nov 2001 13:59:34 -0800
on 11/20/01 1:30 PM, James McCartney <email@hidden> wrote:
>
I think it might be easily possible for a user to read in a huge sound file
>
and random access pieces of it in a fashion such that parts of it get paged
>
out.
Here's a perl script one of the Speech guys gave me to thrash VM. You can
use it to see just how bad it might get:
#!/usr/bin/perl
# Thanks to Matthias Neeracher for this script
alarm(30); # Increase if your machine has more than 256M of memory
$_ = "a";
while (1) {
$_ .= $_;
}
>
I suppose I could write a "memory heater" thread to touch all pages of
>
loaded sample ram periodically. Sounds like a bad kludge compared to the
>
kext scheme, but at least portable.
Wiring memory down is in general not a very portable bit of code.
FWIW, it takes a lot of thrashing to page out the sound stack (including the
code and data it touches via your IOProc) when it is playing, especially
when the buffer size is low. It's not impossible but on machines with a
reasonable amount of RAM (say 256MB) it doesn't happen too often.
--
Jeff Moore
Core Audio
Apple