[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Linphone-developers] Audio system for Android.
From: |
Simon MORLAT |
Subject: |
Re: [Linphone-developers] Audio system for Android. |
Date: |
Thu, 11 Jun 2015 10:45:06 +0200 |
Hi Sergey,
OpenSLES was introduced lately (android 4.2 I think ?) so we needed a better solution.
When the libmedia backend was engineered android 2.3 was the current version.
There are three ways of accessing sound on android:
- java AudioRecord and AudioTrack: the oldest API, official but with really poor performance for real time applications, but hardware AEC is activable through this API if the device supports it.
- openSLES: better API, that is actually an overlayer on top of libmedia C++ AudioTrack and AudioRecord. Latency performance is good but it still lacks a way to activate hardware Acoustic Echo Canceller.
- libmedia, unofficial, that we use by making dlopen(), dlsym(). This is the original sound client library of android, but it's not part of any public API. It has clearly the best performance and allows to activate hardware AEC.
Linphone has backends for all these 3 APIs, that are selected according to the android version number running on the device and its capabilities.
- android <= 4.4 libmedia backend is used
- android > 4.4 if hardware AEC is available, java AudioRecord is used for capture and OpenSLES for playback
- android > 4.4 if hardware AEC is all the time activated or no hardware AEC is available, OpenSLES is used for both capture and playback.
For the future, we really hope that Google will add the missing control to activate hardware AEC from openSLES, because this is where we want to move on. The libmedia backend is painful to maintain accross releases.
Best regards,
Simon