Re: Core Audio playback precision on iOS devices (and simulator)
Re: Core Audio playback precision on iOS devices (and simulator)
- Subject: Re: Core Audio playback precision on iOS devices (and simulator)
- From: Antonio Nunes <email@hidden>
- Date: Fri, 16 Jul 2010 17:59:01 +0100
On 16 Jul 2010, at 16:37, Kyle Sluder wrote:
> "Precision" and "usleep()" don't mix. It looks like your -driver
> method is trying to play catch-up with your realtime audio thread? If
> you wind up sleeping for long enough in the call to usleep() to
> exhaust the stack of samples, you're going to start lagging.
Actually, I put the usleep in only at a later stage, to see if lightening the driver thread's cpu load made any difference on performance. But I get the exact same measurements whether without usleep, or with usleep(1) or usleep(2), or, for that matter (with the current setup of one tick per second), even usleep(1000) or more.
If the driver thread had a hard time keeping up with the realtime thread, then the realtime thread would consume more samples than the driver could deliver, and sleep would never (or seldom) be called. But sleep is called frequently, which means that the driver thread easily fills up the buffer faster than the real time thread can consume it. This makes sense, since the load for getting the samples is is very light.
Also, if the speed at which the driver thread runs were the issue, then I would expect worse performance on the iPad than on the Core i5 iMac. But the opposite is true.
António
-----------------------------------------------------------
Some things have to be believed to be seen.
--Ralph Hodgson
-----------------------------------------------------------
_______________________________________________
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