Re: Latency
Re: Latency
- Subject: Re: Latency
- From: Gregory Wieber <email@hidden>
- Date: Tue, 28 Dec 2010 16:18:17 -0800
Ok, so no luck. First, kAudioUnitProperty_PresentationLatency is Mac OS X only. Second, kAudioUnitProperty_Latency keeps returning 0. I have many different multi-channel mixers all connected in an AUGraph. I've tried getting the latency property on each mixer individually, as well as my remoteIO unit, and they all return 0. I've tried every possible scope (though, output is what I believe would be the correct one), and different channels on each mixer -- still no luck.
Suspecting that I was calling it too early, I also tried getting the property 'later' in my program. Then, I tried creating a callback for that latency property, but it never gets called.
All of this goes for both the simulator and the device.
I'm managing to get and set audio unit properties elsewhere in my app, so I'm almost positive it's not a syntax issue. Without the PresentationLatency property, I'm not really sure how to get an accurate number. I saw a post on the core audio list some time back that was related to this, but google is not revealing it, and I'm somewhat at a loss.
Just for fun I tried multiplying my inNumberFrames by the CAHostTimeBase::GetFrequency(), divided by the sample rate, added it to my normal time calculation to arrive at a best guess for around where the sound would 'actually' be heard. This only worked when I added a bit more 'time' to the formula, so if anything I can tell that the difference between when the buffer is prepared and when it actually hits the audio card is more than a buffer length -- how much more, I can't tell. When I did all of that, my MIDI note-on/off messages arrive roughly at the correct time.
I've done extensive googling, but don't seem to be any closer. Is there some documentation I'm missing that covers all of this for iOS devices?
1) When is the proper time to get the latency property of an audio unit?
2) In an audio unit graph, with multiple multi-channel mixers, must one collect the latency property for each mixer / each bus on those mixers?
3) In addition to latency, what other properties can be retrieved that will (in combination with the audio unit latency) give an accurate time for when the sound is 'heard' (ie, something like what PresentationLatency appears to be for)
Thanks again...
_______________________________________________
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>) |
| >Re: Latency (From: Gregory Wieber <email@hidden>) |