Android audio framework quality issue

152 views
Skip to first unread message

Fung James

unread,
Jan 12, 2016, 10:08:50 AM1/12/16
to android-platform
Current AudioFlinger at stereo 16-bit PCM at 44.1 kHz(−32,768 to +32,767) is a little bit too out-dated. The audio quality is degraded, especially in lossless have been downsample. In addition, more and more hq record is launched, not only at CD level. So, it is neccessary to get into 24-bit 96kHz(−8,388,608 to +8,388,607), also get advantage on high SNR too.

I don't know the major obstacle of being upgrade to hi-res audio. I guess hardware limit, bad AD/DA converter, hard to implement on software side,etc...

Glenn Kasten

unread,
Jan 12, 2016, 10:54:23 AM1/12/16
to android-platform
Beginning with Android 5.0 (Lollipop) and continuing through Android 6.0 (Marshmallow) and beyond,
the internal audio data path is gradually being widened along several dimensions:
bit depth, dynamic range, sample rate, and channel count.

Many internal calculations are now performed in single-precision floating-point,
which has a greater effective bit depth of 24-25 bits and much wider dynamic range than before.
Sample rates up to 96kHz or 192 kHz are supported provided the endpoints
(source and sink) specify the appropriate sample rate in their configuration.
The resampler implementations have been rewritten for improved quality and speed.
There is now better support for multi-channel, especially for indexed (non-positional) audio and on input side.

However, these improvements are not complete as of 6.0.  There is still more work to do,
for example the effects and some of the file parsers and codecs (encoders and decoders) are not yet upgraded,
and multi-channel over OpenSL ES API is not yet as capable as the Java API.
We're continuing in that process.  If you would like to contribute, please post a note either
here or at android-contrib@ group.

It is up to each device OEM to configure the endpoints, so not all endpoints
will make use of the wider paths.

Historically, floating-point was slower than integer arithmetic.
But in modern processors the use of floating-point for internal math
does not significantly decrease CPU performance, and
in fact in some cases it can be faster than integer math.

However, higher sample rates (e.g. 96 kHz and above)  do
use more CPU and power than lower sample rates (44.1 or 48 kHz).
Higher sample rates are generally accepted to be useful during pro audio recording and editing.
The value of high sample rates for playback/listening by ordinary users is controversial,
especially if the endpoints are analog or have the kind of small transducers typical on mobile devices.
Given the higher power consumption and controversy, device OEMs may choose
to not implement high sample rates for the local transducers and only support
high sample rates over USB.

Here are links to some more resources on these topics:

Will it float? The glory and shame of floating-point audio

Google I/O 2014 - Building great multi-media experiences on Android
     (0:42 to 3:57 are on the wider data path)
https://www.youtube.com/watch?v=92fgcUNCHic

Data formats

High-Performance audio on Android

Fung James

unread,
Jan 13, 2016, 2:47:44 PM1/13/16
to android-platform
I understand the situation, CPU load is high when 24 bit depth, might be pass PCM to USB DAC is good idea to help balance audio quality and power consumption.

I'm a audio effect developer on playback. I know there have some methods that can bypass audio framework. My effector is quite depend on audio framework, and can't avoid my audio data being resampled to 16 bit depth at 44.1kHz. That's my consideration on it.
Reply all
Reply to author
Forward
0 new messages