Xmp

From iPodLinux

Jump to: navigation, search
The title of this article should be xmp. The initial letter is capitalized due to technical limitations.

Contents

What is xmp

The Extended Module Player, or xmp, is a portable command-line module player for Unix and Unix-like systems such as Linux, BSD, Solaris, HP-UX and MacOS X, and also QNX, BeOS, Windows, OS/2 and AmigaOS. Xmp plays over 80 mainstream and obscure module formats from Amiga, Atari, Acorn, Apple IIgs and PC. The official SourceForge page can be found at http://xmp.sourceforge.net/.

The official website lists 81 formats; I have so far confirmed that the .xm, .s3m, .it and .mod formats work flawlessly (tested with sample files from The Mod Archive: [1] [2] [3] [4]). The binary was launched from a script file via podzilla2's file browser and the quality was smooth without problems.

At the moment this is really just for proof-of-concept; if you want actual playback with a nice GUI, use mikmod. This page is also really temporary until I actually do a proper port. Feel free to clean up the wiki page if you want (though I'll be updating it later).

See the "Release" section for the modified source code and pre-compiled binary as well as a podzilla 2 module.

Building Instructions

This page will just show you how to cross-compile xmp from source code. The final binary will just be a normal command-line binary that can be executed via Loader 2 or a script file. You will need some type of compiling environment with the 3.4.3 toolchain.

1. Download the source code from xmp's sourceforge page. Latest is xmp 2.5.1. You will want the file "xmp-2.5.1.tar.gz".

2. Extract the above archive. You should get a "xmp-2.5.1" folder. In your compiling environment, cd to that folder (i.e. cd xmp-2.5.1). Also make sure you have exported your PATH to include the 3.4.3 toolchain.

3. Type "./configure CC=arm-elf-gcc LDFLAGS=-elf2flt --host=arm-elf-gcc" and wait for it to finish.

4. Manually open up the "xmp-2.5.1/Makefile.rules" file with a text editor. Add " -elf2flt" to the LDFLAGS line (i.e. "LDFLAGS = -o $@ -elf2flt" at line ~19). Not sure why ./configure fails to change the LDFLAGS but you need that addition.

5. Manually open up the "xmp-2.5.1/src/main/main.c" file with a text editor. Scroll down to line 292 and modify the cases for "switch (cmd)". This will allow you to remap the interactive commands to the iPod's key presses. For my pre-compiled binary, I changed 'q'->'m', 'b'->'w', ' '->'d', and commented out the 'n' and 'p' cases.

6. Type "make". You will get a few non-fatal "Makefile:##: depend: No such file or directory found" errors but it should not stop the compiling process. Once make is done, you should find a "xmp" binary in the "xmp-2.5.1/src/main" folder. My compiled binary was ~730 kb in size. If your binary is ~1.5 mb, you did not add the "-elf2flt" correctly (you will have to "make clean" and redo steps 3 and 4 properly).

Testing

1. Copy the final "xmp" binary to somewhere on your iPod (here I'll just be copying it directly to my iPod's root, i.e. "/mnt").

2. Download a sample module from The Mod Archive. In this example download "a-depres.xm". Extract the file from the zip to your iPod (e.g. to "/mnt").

3. Create a text file named "xmp.sh" with the following content (you may need to modify the paths to point to the correct locations):

#!/bin/sh
exec /mnt/xmp /mnt/a-depres.xm

Make sure the script file is in Unix format.

4. Reboot your iPod into iPodLinux. Browse to the "/mnt/xmp.sh" file via file browser and execute it (with pz0, just press centre; with pz2, hold centre, select Execute > Open VT).

5. Playback of the trance song will ensue. Since key controls are not implemented in this clean port (so you can't change the volume either), the only thing you can do is keep pressing forward till the song finishes to exit xmp, or just listen to all of it ; ) .

Release

A podzilla 2 module can be found File:Xmp-1.0.tar.gz. The module plays xmp-supported files by externally launching the xmp binary from the file browser via pz_execv. It requires a podzilla 2 build after revision 2395 (a nightly build will work) and the file browser module. I will try porting the actual xmp as an integrated PZ2 module later.

The source code to the pre-compiled xmp binary used in the above module can be found File:Xmp-2.5.1-mod.tar.gz. It contains both (barely) modified source code and the pre-compiled binary. I may make a patch file that does the modifications mentioned in "Building Instructions"'s steps 4 and 5 later.

The mikmod module supports some (but not all) of the same file formats and VLC player plays just about anything you throw at it, so you can also try comparing them with xmp. As mentioned earlier, there are tons of free modules you can download and try at The Mod Archive. Have fun!

~Keripo