Hello,
we make VoIP software for Android and I ran into problems with severe audio glitches when testing the app on Google Nexus 4 device. After the analysis, I found that we hit the setting for low-latency audio (fast-path) for that device accidentally (mono, 48KHz sampling rate, 16bit samples).
The call for android.media.property.OUTPUT_FRAMES_PER_BUFFER suggests buffer for 5ms of audio. If I use this buffer size, audio playback is very glitchy - I cannot guarantee that the callback will finish quickly and always take roughly the same time, because of rather complex audio processing (jitter buffer, noise suppression, AGC, echo cancellation etc.) which also needs locking in our multithreaded environment.
So I thought the solution will be easy - I will set up playback buffers which are 5x the OUTPUT_FRAMES_PER_BUFFER. This will even out the dropouts and delay of 25ms is still acceptable for our application.
I was surprised that the quality did not improve at all. It seems that the audio engine silently consumes 9 buffers out of 10 and only then it asks for more data, so I am exactly where I was before - if I take more than a few milliseconds in the callback, there will be dropout.
This would make low-latency audio pretty much unsuitable for our app, we wouldn’t be able to use it without heavy refactorization of our audio code. Before we jump into that - is this really the expected and desired behaviour?
Jiri Kral
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk...@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at http://groups.google.com/group/android-ndk.
For more options, visit https://groups.google.com/d/optout.