[maemo-developers] GStreamer, mp3 playback and the DSP

From: Simon Pickering S.G.Pickering at bath.ac.uk
Date: Sat Apr 10 18:14:02 EEST 2010
> >> I'm currently using GStreamer to play mp3 files. I'm 
> >> trying to move 
> >> all mp3 decoding to the DSP but I'm unable to find any 
> >> useful info on 
> >> the matter.
> > 
> > May I ask why you're trying to move mp3 decoding to the 
> > DSP? Are the 
> > mp3s the sound track/effects for a game, etc., so you want to have 
> > more CPU cycles to do useful work?
> Yes, it's an emulator actually, and mp3 decoding is 
> noticeably stealing CPU cycles.

Ok, I just wanted to check that your reason was something valid and indeed
it is.


> >> So, obviuosly a different solution is needed but I coudn't 
> >> find any 
> >> documentation whatsoever. :) Anyone can help here?
> > 
> > Are there any existing OpenMAX mp3 decoders targetted at the 
> > TMS320c64x DSP?
> > If not, it would probably not be too painful to port one 
> (where pain 
> > is all relative, but at least this would be less painful 
> than trying 
> > on the more constrained and 8bit-less c55 ;)
> > 
> Thats what the wiki article I quoted seems to imply, but it's 
> not very clear and I couldn't find any further info. There's 
> a multimedia framework diagram suggesting that there are 
> OpenMAX audio codecs that run in the DSP via DSP-bridge, but 
> not sure if this applies to maemo 5 and there's no info on 
> how to use them.

I must admit that I've not done any DSP work on the c64, though I did pay
attention to it when the N900 was originally announced (and I thought I'd
get a Pandora to fill the gap until it was shipped, glad I didn't pin my
hopes on that now ;). Anyway I imagine some of the Nokians (and others) will
know from first hand experience so please someone jump in if I've got the
wrong idea.

So yes, my understanding is that that is exactly what's involved, therefore
it should be possible to write an OpenMAX compliant codec that uses the DSP
bridge to transfer data back and forth to a decoder running on the DSP. 

There were docs and examples on one of the websites (this one iirc:
https://gforge.ti.com/gf/project/omapbridge/ and DSP coding docs on this
site: http://www.ti.com/sc/docs/psheets/man_dsp.htm), not sure about the
OpenMAX docs, but I guess there will be example code floating about
somewhere (or you might just wrap the DSP bridge interface stuff directly in
a Gstreamer plugin and skip the OpenMax stuff completely).

I think that writing/porting this should be reasonably straight-forward,
optimising it less so, but at least afaiu the code shouldn't need major
changes to get rid of 8bit types.

However.... on the N8x0 devices it was not possible to directly output audio
from the DSP due to a lack of api docs (it would need a re-write of the DSP
kernel or reverse engineering the DSP audio codec api, which are things that
would now be good for Mer, but would take some time, but that's another

I don't know if it is currently (or would be relatively easily) possible to
output audio directly from the N900's DSP. This is something you should try
to find out, as on the N8x0, needing to pass data both to and back from the
DSP (in this case for SBC encoding) clobbered video decoding on the CPU (CPU
load was lower with SBC encoding on the DSP, but something, presumably
memory contention due to the way the data was passed to and fro for both the
DSP and framebuffer, dropped the mplayer decoded framerate down from iirc
~25fps to ~1fps). 

I imagine/hope the N900 + DSP bridge setup is better, but I really don't
know. Does anyone know? Could a Nokian tell us about the possibility of
direct audio output from the DSP and how efficient the data passing is in
the absence of direct audio output?



More information about the maemo-developers mailing list