[maemo-developers] Python and GStreamer

From: Jesse Guardiani jesse at guardiani.us
Date: Thu Aug 30 16:03:42 EEST 2007
Austin Che wrote:
> Jesse Guardiani <jesse at guardiani.us> wrote:
>> And no, before you ask, I don't think it's not Nokia's fault. gstreamer
>> is just unexpectedly buggy. Too bad ALSA doesn't support inline mp3
>> decoders... life would be easier for all of us...
>     I've been wondering: what is the performance hit for not going
>     through gstreamer? So based on my understanding, going through
>     gstreamer, the mp3 is decoded on the DSP. Supposing it was decoded
>     on the cpu and sent out through alsa, which of the following is
>     likely to be true:
>     - The CPU wouldn't be able to handle it (playback would skip)

No, not even close. It doesn't use anywhere near that much CPU. Even 
with a separate process running transcoding the decoded mp3 into SBC 
packets (think a2dpd from the bluetooth-alsa package) we still don't get 
skipping, though doing other things at the same time will cause skipping 

>     - The CPU could handle it just as well as the DSP but the rest of
>     the system might be less usable
>     - The battery life would decrease (how much?)

Yes, mostly it's a battery life issue. But decoding mp3 in software does 
take a bit of available CPU, so you can't do quite as much simultaneously.

>     - some other reason this wouldn't work well?

Nah. Battery and multi-tasking. Those are the primary concerns, I think.

>     And the related question is: given an existing program that sends
>     stuff out to ALSA and doesn't use gstreamer, how difficult is it
>     generally to port it so that it works properly?

No porting necessary, really. mplayer comes with a decoder called 
libmp3. It's not optimized for ARM or anything, and it compiles without 
any problems. We don't use it in Kagu for A2DP though because there is 
another decoder out there called ffmp3 which doesn't use floating point 
math, so it's a little more efficient on ARM.

>  By this, I'm
>     thinking of a typical C program that plays mp3 files. Would it
>     likely require a complete rework of the code structure or is it
>     probably a "trivial" replacement of function calls?

Trivial. You could always optimize it by re-writing it to do everything 
with fixed point math, but it's not strictly necessary, at least on the 

Jesse Guardiani
Programmer/Sys Admin
jesse at guardiani.us

More information about the maemo-developers mailing list