RemoteIO & hardware decoding latency
RemoteIO & hardware decoding latency
- Subject: RemoteIO & hardware decoding latency
- From: Zachary Kulis <email@hidden>
- Date: Tue, 08 Jun 2010 12:32:01 -0400
Hi all,
I've been dealing with an intermittent issue for some time regarding
hardware decoding latency when using the RemoteIO. In my app, I am
decoding MP3 files on-the-fly using the hardware decoder (i.e., via the
AudioQueueOfflineRender API) and using the RemoteIO to play the decoded
samples. In addition, I am queueing the samples in an internal circular
buffer (RemoteIO thread) and dequeueing them in a separate worker thread.
Usually, everything works fine. However, when I try to log the raw PCM
samples to a file on the iPhone/iPod Touch, the AudioQueueOfflineRender
function may fail to produce enough decoded audio samples for the
current time (thus causing audible "gaps" in the playback). Note that
there are no direct dependencies between the RemoteIO and worker
threads. The worker is notified (via pthread_cond_signal()) when new
data is available in the queue. Samples are dumped to disk only in the
worker thread (which should not cause the RemoteIO thread to block).
I've done some benchmarking/debugging of the code, and it appears that
the AudioQueueOfflineRender() may occasionally take up to 1 second to
decode 32 ms of audio samples when logging raw samples to disk. This
clearly does not seem correct. My question is the following: is the OS
somehow blocked when writing to disk, such that an attempt to initiate a
hardware decode via the AudioQueueOfflineRender ()call would also be
blocked? Or could the AudioQueueOfflineRender() call somehow be getting
blocked midway due to the disk write? I would not expect filesystem
access and hardware audio decoding to be codependent operations...
Thanks in advance for any insight into this issue.
Zach
_______________________________________________
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