Leapster Explorer: mplayer

From eLinux.org
Revision as of 20:02, 24 September 2010 by Reggie (talk | contribs) (How to install mplayer)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Simple tutorial to compile and install mplayer for the explorer and sdl/fbdev

this is a work in progress, I've only done preliminary tests with 320x240 divx, 32Khz, 64kbps audio, and 320x184 mpg2, 32Khz, 64bit audio, both produce stuttering sound. Video or Audio stream will playback perfectly if the other stream is disabled. If you manage to get better performance from mplayer then please add your findings to the wiki.


working explorer kernel with at least framebuffer driver (see main wiki for installation instructions)
SDL libraries (optional, see main wiki for instructions)
Mplayer sources
Correctly set environment variables

Create a folder in the packages dir

go to your kernel sources /packages dir and make a directory for mplayer

mkdir mplayer

Make the install script

open your favourite text editor and copy the following into it, save the file as install.sh in the folder you just created:

# Build MPlayer from source
# Patches needed for
# (1) removing strip option? from configure
# comment out line 2393: 
set -e
. $PROJECT_PATH/scripts/functions
# make sure all of the environment variables are good
# exit if the user is root
# parse args
set_standard_opts $*
pushd $PROJECT_PATH/packages/mplayer/
if [ ! -e $MPLAYER_BIN_SRC ]; then
wget http://www8.mplayerhq.hu/MPlayer/releases/$MPLAYER_BIN_SRC
MPLAYER_BIN_DIR=`echo "$MPLAYER_BIN_SRC" | cut -d '.' -f -2`
if [ "$CLEAN" == "1" -o ! -e $MPLAYER_BIN_DIR ]; then
# build and copy binary to rootfs
./configure --enable-cross-compile --cc=arm-linux-uclibcgnueabi-gcc --host-cc=gcc --target=arm-linux --disable-iwmmxt --disable-theora --disable-tremor-internal --disable-tremor-low --disable-tremor --disable-libvorbis --disable-alsa --disable-liba52 --disable-libmpeg2 --disable-gl --disable-x11 --disable-tv --disable-ftp --disable-dvdread-internal --disable-mencoder --prefix=$ROOTFS_PATH/usr --libdir=$ROOTFS_PATH/usr/lib --charset=noconv
cp mplayer $ROOTFS_PATH/usr/bin/
exit 0

You can edit the ./configure section to your taste, if you want make to use all of the cpus on a multiple core machine use the -j option, e.g for a dual core cpu:

make -j3

Make the install script executable

Now you need to make the install script executable:

chmod a+x ./install.sh

you should now be able to run the script for the first time, it will download the mplayer sources and compile it for you as well as installing the mplayer binary to your $ROOTFS_PATH/usr/bin folder:


once that's done copy mplayer to your explorer, I made a folder and put it in /LF/Bulk/mplayer/

I also made myself a couple of videos, with a resolution within 320x240, tested video formats: divx and mpg2. tested audio formats: mpg2/3

you can run a video from the command line, something like this:

./mplayer -vo fbdev -ao oss test.avi

I found this to be the best setting:

./mplayer -vo fbdev -ao sdl -autosync 30 -cache 8192 test.avi

in the console you will see a bunch of information about the desired video/audio output devices, actual devices used and codecs, as well as statistical information about the current state of playback.

Current Issues

As mentioned at the start of the tutorial, we get playback of audio and video but it stutters badly. I've tested with audio at 32Khz/64kbps, as the default cpu speeds have been optimised for brio/audio@32Khz, video is also at a low bitrate, 300kbps.

if you use 'make install' you will need to edit line 2393 and comment it out:


To Do

Add information for better codec support (libmad for mp3 audio), work out how to get configure to see the arm-linux version of strip. work out options to compile with better performance.