Re: Latency
Re: Latency
- Subject: Re: Latency
- From: Gregory Wieber <email@hidden>
- Date: Tue, 28 Dec 2010 11:03:17 -0800
That's great, pretty much the missing piece to my understanding of core audio properties which I somehow had missed. I'm going to proceed with this info, and do some trial & error in regards to how the latency varies between my different audio units in my graph, and change my MIDI timestamps to reflect the latency.
I believe the problem I was seeing was that my MIDI events were not accounting for the latency, thus any time a buffer cleared, the midi events were all sent at once (because to them, they were already late and the time was thus zero). This would explain the jittering of my notes (a consistent jitter which I expected was exactly the length of the buffer, which is why it's more evident in the device where the buffer is longer.) That is, the note ons were directly tied to the edge of the buffer, and were therefore always a buffer length ahead or behind the 'beat'.
Thank everyone for the tips both on-list and off.
best,
Greg
On Tue, Dec 28, 2010 at 10:45 AM, Brian Willoughby
<email@hidden> wrote:
On Dec 28, 2010, at 09:27, Gregory Wieber wrote:
After more digging, I found kAudioUnitPropery_PresentationLatency in AudioUnitProperties.h . I haven't been able to find any detailed documentation, but have found one ore two mentions of it on the mailing lists. This seems like what I need for accurately scheduling MIDI events in the future, so I'll give it a try. If anyone has used this with an Audio Graph setup, and cares to offer advice on implementation, I'd greatly appreciate it.
I recall reading elsewhere, possibly about a similar HAL property, that the latency may vary during runtime. Is this something I need to keep an eye on? Is there a proper way of doing so that won't become a bottleneck? (Checking the property constantly that is...)
In general, the proper way of handling any variance in CoreAudio is to register for Property changes. I'm sure you can just register kAudioUnitProperty_PresentationLatency and then you will only need to run your update code exactly once for each change.
Brian Willoughby
Sound Consulting
_______________________________________________
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
References: | |
| >Re: Latency (From: Gregory Wieber <email@hidden>) |
| >Re: Latency (From: Brian Willoughby <email@hidden>) |