[Top][All Lists]

[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,


2015-06-09 11:15 GMT+02:00 Sergey Guralnik <address@hidden>:
Hi, all!

I looked on mediastreamer2 code recently and I'm confused a bit with actual implementation
of audio capturing/rendering for android systems.
Mediastreamer2 performs symbol lookup at and relays on cpp mangled names
for AudioTrack/AudioRecord native implementations.
Probably this API was not intended for using in this way, but only as private interface for internal
As consequence those API may not be available for all devices due vendors are not obligated
to provide it and expose via symbol tables.

Are there reasons why mediastreamer2 doesn't use official "OpenSL ES"-based android audio API,
that is provided by NDK?

Best regards,
Sergey Guralnik.

Linphone-developers mailing list

reply via email to

[Prev in Thread] Current Thread [Next in Thread]