AudioQueueOflineRender() and 'alac' files on iPhone
AudioQueueOflineRender() and 'alac' files on iPhone
- Subject: AudioQueueOflineRender() and 'alac' files on iPhone
- From: "Roni Music" <email@hidden>
- Date: Wed, 25 Mar 2009 16:54:26 +0100
I'm using AudioQueueOflineRender() on the iPhone OS 2.2.1
decoding data in a secondary high priority thread that fills my buffer and
then playing back the samples using kAudioUnitSubType_RemoteIO.
I try to keep around 1000 ms of decoded audio samples in my buffer.
It works like a charm except for 'alac' files.
When calling AudioQueueOflineRender() and asking for 2048 frames
and timing that call it looks like this:
100 ms
1 ms
113 ms
1 ms
107 ms
1 ms
etc
which works fine but occasionally, say once every 2-3 minutes, the
AudioQueueOflineRender() call takes
more than 1000 ms, even 1500 ms, which makes my buffer run dry and I have
glitches in the audio output.
This never happens for any other file type such as mp3, aac/m4a etc.
I can increase my buffer size to say 2000 ms for 'alac' files only which
fixes the problem but makes the app much less responsive and startup time
also increases. And it feels like a "hack".
Is this normal or is it a known problem with 'alac' files?
I've tried to use the CFRunLoopRef from my secondary thread when setting up
AudioQueueNewOutput() since this is the thread that calls
AudioQueueOflineRender() but it makes no difference and I'm also not sure if
this is correct?
The "mandatory" zero frame AudioQueueOflineRender() call has a tendency to
deadlock when doing it this way so it doesn't seem to be the way to go.
Any advice?
Thanks,
Rolf
_______________________________________________
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