[MPlayer-dev-eng] MPEG audio pass-through fake decoder

Siarhei Siamashka siarhei.siamashka at gmail.com
Sat Jul 22 18:29:14 CEST 2006


Hello All,

I'm currently preparing MPlayer port for Nokia 770. Port page is here:
https://garage.maemo.org/projects/mplayer/

A discussion of this port in the forum is here:
http://www.internettablettalk.com/forums/showthread.php?t=2405

Now about the issue, Nokia 770 is a very hardware limited device, but has a
dualcore CPU. One core is ARM and the other is DSP. Most programs including 
MPlayer use only ARM core (programming for DSP core is not so easy as there is
no gcc for it, in addition it is 16-bit CPU). Fortunately Nokia 770 already
has MP3 audio decoder which is implemented in DSP. For programmers this 
MP3 decoder (actually it is player only) is available via gstreamer API.

So here is where pass-through comes in action. I implemented a gstreamer
based output module and tried to make ad_hwmpa.c work with it. But 'hwmpa' 
seems to have several problems:
1. First it is quite buggy, can crash or hang, and contains some obviously
broken code.
2. Second, its output is not very well suited for audio/video synchronization 
(or I did not understand synchronization code from ao_mpegpes.c), in addition
it seems to fail completely when playing audio only. 

I solved the second problem by padding output data stream so that its size
matches the size of decoded data and it seems to work perfectly now.
Unfortunately it introduces incompatibility with current AF_FORMAT_MPEG2 and
requires a separate fake decoder derived from ad_hwmpeg.c (it can be found in
ad_dspmp3.c in my Nokia 770 patch). And also I fixed some of the bugs I could
find. Patch against MPlayer-1.0pre8 can be downloaded here:
https://garage.maemo.org/frs/?group_id=54

MPlayer patched for Nokia 770 still works on a normal desktop PC well (I tried
not to break anything). So this gstreamer passthrough stuff can be tested even
not having Nokia 770 device (you only need to have gstreamer-0.10 installed
with libmad and alsa support).

I would like ad_hwmpa.c maintainer to have a look at my ad_dspmp3.c file and
take some fixes from it if he finds them useful (mostly mpa_sync() function). 
I know that there are some fixes committed to MPlayer SVN since 1.0pre8
release, but from looking at the code, looks like some bugs are still there.
Hopefully this could be of any use.

Also I don't like the idea of having several MP3 pass-through modules, it
seems a bit redundant to me. So I would like to either fix my ao_gst.c module
to accept AF_FORMAT_MPEG2 (and find a way to solve audio/video synchronization
and seeking issues) in the future. Another option is to change AF_FORMAT_MPEG2
to a padded version (such as AF_FORMAT_PADDED_MPEG2 in my patch) and tweak
ao_mpegpes.c and other output modules to use it. As I don't have any hardware
that could work used with AF_FORMAT_MPEG2, I would like to hear your opinion
if it is possible and if it has any use.

Thanks.



More information about the MPlayer-dev-eng mailing list