Hi. We're implementing a program for Android phones that plays audio
streamed from the internet. Here's approximately what we do:

   1. Download a custom encrypted format.  This format is fixed and we
can't change it.
   2. Decrypt to get chunks of regular MP3 data.
   3. Decode MP3 data to raw PCM data in a memory buffer.
   4. Pipe the raw PCM data to an AudioTrack

Our target devices so far are Droid and Nexus One. Everything works
great on Nexus One, but the MP3 decode is too slow on Droid. The audio
playback starts to skip if we put the Droid under load. We are not
permitted to decode the MP3 data to SD card, but I know that's not our
problem anyways.

We didn't write our own MP3 decoder, but used MPADEC (http://
sourceforge.net/projects/mpadec/). It's free and was easy to integrate
with our program. We compile it with the NDK.

After exhaustive analysis with various profiling tools, we're
convinced that it's this decoder that is falling behind.

Here's the options we're thinking about:

1. Find another MP3 decoder that we can compile with the Android NDK.
This MP3 decoder would have to be either optimized to run on mobile
ARM devices or maybe use integer-only math or some other optimizations
to increase performance.

2. Since the built-in Android MediaPlayer service will take URLs, we
might be able to implement a tiny HTTP server in our program and serve
the MediaPlayer with the decrypted MP3s from localhost. That way we
can take advantage of the built-in MP3 decoder.

3. Get access to the built-in MP3 decoder through the NDK. I don't
know if this is possible.

Does anyone have any suggestions on what we can do to speed up our MP3
decoding?

-- Rob Sz

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

To unsubscribe from this group, send email to 
android-developers+unsubscribegooglegroups.com or reply to this email with the 
words "REMOVE ME" as the subject.

Reply via email to