• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: iOS mic input latency
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: iOS mic input latency


  • Subject: Re: iOS mic input latency
  • From: Beinan Li <email@hidden>
  • Date: Tue, 21 May 2013 17:56:41 -0400

This problem has been solved:

I simply needed to reduce the buffer size by setting 
the kAudioSessionProperty_PreferredHardwareIOBufferDuration property.

Thanks,
Beinan


On Tue, May 21, 2013 at 5:04 PM, Beinan Li <email@hidden> wrote:
Hello CoreAudio,

I'm running a test to measure the basic latency of my iPhone app, and the result was disappointing: 50ms for a play-through test app. The app just picks up mic input and plays it out using the same render callback, no other audio units or processing involved. Therefore, the results seemed too bad for such a basic scenario. I need some pointers to see if the result makes sense or I had design flaws in my test.

The basic idea of the test was to have three roles:
  1. My finger snap as the reference sound source.
  2. A simple iOS play-thru app (using built-in mic) as the first listener to #1. 
  3. A Mac (with a USB mic and Audacity) as the second listener to #1 and the only listener to the iOS output (through a speaker connected via iOS headphone jack).
Then, with Audacity in recording mode, the #3 would pick up both the sound from my fingers and its "clone" from the iOS speaker in close range. Finally I simply observe the visual waveform in Audacity's recorded track and measure the time distance between the peaks of the two recorded snaps.

This was by no means a super accurate measurement, but at least the innate latency of the Mac recording pipeline should have been cancelled out this way. So that the error should mainly come from the peak distance measurement, which I assume should be much smaller than the Mac latency would have caused. 

I was expecting 20ms or lower latency, but clearly the result gave me 50~60ms.
My ASBD uses kAudioFormatFlagsCanonical and kAudioFormatLinearPCM as format.

Thanks,
Beinan

 _______________________________________________
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

  • Prev by Date: iOS mic input latency
  • Next by Date: Listener for when stream formats change (Leopard)
  • Previous by thread: iOS mic input latency
  • Next by thread: Listener for when stream formats change (Leopard)
  • Index(es):
    • Date
    • Thread