Re: Sensible delay between AudioOutputUnitStart call and sound output
Re: Sensible delay between AudioOutputUnitStart call and sound output
- Subject: Re: Sensible delay between AudioOutputUnitStart call and sound output
- From: David Duncan <email@hidden>
- Date: Wed, 1 Dec 2004 08:19:35 -0500
On Dec 1, 2004, at 06:06 AM, FILIPPIN LUCA wrote:
I've noticed this fact: it takes some millisecs to a Dual G4 machine
(about 10 ms running nothing else but my application) to get the first
call
to my AudioUnit input callback since AudioOutputUnitStart call. How can
avoid this without using tricks such as starting AudioUnit early and
feeding
it with zero filled input buffer until I need to start playing my
sound?
There is nothing you can do to avoid the delay. It is basically how
long until the next render callback comes around (usually 512 samples @
44100 => 11ms between callbacks). AudioOutputUnitStart() is
asynchronous, it just notifies the HAL that the callback is ready to
start feeding audio, the HAL still has to get around to asking for
audio.
About the only thing you can do to reduce the delay is to reduce the
buffer size (and thus how often you get called back) but in general
this also increases the CPU load (less efficient to make 2 256 requests
than 1 512 request, etc). If you need to eliminate the "delay" then
what you propose is the only solution -- start early and feed with
zeros.
--
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