ABOUT THIS ARCHIVE

By default, SDL_mixer provides support for MP3 playback via smpeg, and
OGG playback via libvorbis.

These libraries are good choices for audio playback on a PC or Mac.
But both of these libraries make heavy use of floating-point
arithmetic.  Unfortunately, the GP2X, like many handheld devices, has
no hardware floating-point unit, so these floating-point calculations
must be performed laboriously on the CPU, resulting in CPU
oversaturation and choppy audio.

There exist audio libraries for MP3 and OGG playback that entirely use
integer arithmetic to do the same work.  These libraries run much more
efficiently on the GP2X, allowing the CPU to play a standard MP3/OGG
file at full frame rate and still leave time for the CPU to do other
useful work (like update graphics for a game).

Two such libraries are libmad, for MP3, and tremor, for OGG.

This archive includes the patch necessary to build SDL_mixer version
1.2.6 against libmad.  This patch was provided by David Rose
(sdlmadpatch@ddrose.com).  The patch file also includes a patch
provided by Julien Boulnois (jboulnois@neo-rousseaux.org) to compile
SDL_mixer against tremor.

Note that libmad is released under the GPL, so any program that links
with libmad must consequently be released under the GPL as well.
Therefore, the prebuilt SDL_mixer library supplied in this archive is
distributed under the GPL, since it contains the GPL code in libmad.
See the file COPYING in this archive.  The patch itself, however, is
released into the public domain, with no restrictions.  SDL and
SDL_mixer are themselves released under the LGPL; see the respective
websites (see links below) for more information.

The patch also modifies the standard timidty/config.h within the
SDL_mixer source file to reconfigure Timidity to make less use of
floating-point arithmetic (for instance, to use single-precision
instead of double-precision floats).  This enables the efficient
playback of MIDI files on the GP2X as well.


APPLYING THE PATCH

In order to apply the patch, download and unpack SDL_mixer version
1.2.6.  Within the source directory, run:

patch -p0 < SDL_mixer-126-libmad-tremor.patch

Then configure and build as usual.  The tremor library will be enabled
automatically (if you have it installed).  To enable libmad, you
should pass the following parameters to configure:

--disable-music-mp3 --enable-music-mp3-mad

Of course, you will need to have SDL version 1.2.6 already built and
installed in order to build SDL_mixer.  You will also need to have
built and installed libmad and tremor.  If you are building for the
GP2X, remember to use your ARM cross-compiler for all of these.


THE BINARY DISTRIBUTION

You may choose to use the prebuilt libSDL_mixer.so file supplied in
this archive.  Simply replace libSDL_mixer-1.2.so.0 over the existing
libSDL_mixer-1.2.so.0 with your GP2X application.  Assuming your
existing SDL libraries are built for SDL version 1.2.6, it should be a
drop-in replacement.


Links:

tremor              http://www.xiph.org/vorbis/
libmad              http://www.underbit.com/products/mad/
SDL                 http://www.libsdl.org/
SDL_mixer           http://www.libsdl.org/projects/SDL_mixer/
  (version 1.2.6)   http://www.libsdl.org/projects/SDL_mixer/release/SDL_mixer-1.2.6.tar.gz

