Re: precise timing -- mach_wait_until `drifts`
Re: precise timing -- mach_wait_until `drifts`
- Subject: Re: precise timing -- mach_wait_until `drifts`
- From: "support (One Red Dog Media)" <email@hidden>
- Date: Tue, 09 Dec 2014 02:46:15 +0000
- Thread-topic: precise timing -- mach_wait_until `drifts`
Yes basically the timing will drift even with mach_time. There are threading overheads, plus a priority 1 thread is not hard real-time. There are probably other things that will cause the timing to drift by small amounts. Simply not being a hard real-time
thread will be enough to ensure that the kernel is not scheduling accurately.
The only really accurate timers available are either from the CoreAudio renderProc or from the frame buffer vsync (CADisplayLink / CVDisplayLink). My suggestion would be to use either of those and then ensure that your callback does not block, take up
too much time, do any memory allocations, or delay the renderProc in any way.
If you can live with a slightly less accurate timer I would suggest using GCD dispatch_after, it effectively does the same as your code
From: "Mazzaroth M." < email@hidden>
Date: Tuesday, 9 December 2014 1:08 pm
To: coreaudio-api < email@hidden>
Subject: Re: precise timing -- mach_wait_until `drifts`
I should also mention there is a github project here:
with an iOS demo app.
|
_______________________________________________
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