iphone - iOS: Bad Mic input latency measurement result -
i'm running test measure basic latency of iphone app, , result disappointing: 50ms play-through test app. app picks mic input , plays out using same render callback, no other audio units or processing involved. therefore, results seemed bad such basic scenario. need pointers see if result makes sense or had design flaws in test.
the basic idea of test have 3 roles:
- my finger snap reference sound source.
- a simple ios play-thru app (using built-in mic) first listener #1.
- a mac (with usb mic , audacity) second listener #1 , listener ios output (through speaker connected via ios headphone jack).
then, audacity in recording mode, mac pick both sound fingers , "clone" ios speaker in close range. visually observe waveform in audacity's recorded track , measure time interval between peaks of 2 recorded snaps.
this no means super accurate measurement, @ least innate latency of mac recording pipeline should have been cancelled out way. error should come peak distance measurement, assume should smaller audio pipeline latency , can ignored.
i expecting 20ms or lower latency, result gave me 50~60ms. asbd uses kaudioformatflagscanonical , kaudioformatlinearpcm format.
i'll summarize paul r's comments answer, has solved problem:
50 ms corresponds total buffer size of around 2048 @ 44.1 khz sample rate, doesn't seem unreasonable given have both record , playback path.
i don't know buffer size 2048, , there may more 1 buffer in record-playback loopback test, seems effective total buffer size in test of order of 2048, doesn't seem unreasonable. of course if you're interested in record latency, title of question suggests, you'll need find way tease out separately playback latency.
Comments
Post a Comment