MikMod Module Player for PSP

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
User avatar
Jim
Posts: 476
Joined: Sat Jul 02, 2005 10:06 pm
Location: Sydney
Contact:

MikMod Module Player for PSP

Post by Jim »

I've ported MikMod module player V3.0.3 to PSP. I think this about the last version released before the player GUI was split from the actual player, c1999. I can't find any current maintainer to submit changes to.

It will play most MOD, XM, IT, S3M, STM, MTM, 669, FAR, DSM, MED, ULT and UNI tracker files (while other things are happening).

An example app is included. I built it with cygwin and beta 1.0 SDK.
The modules I used are hardcoded in the source.

http://members.iinet.net.au/~jimshaw/PS ... -3.0.3.zip

Thanks to Peter Amstutz and all the other MikMod developers who released it under a free-to-anyone license.
Also many thanks to the ps2dev people for the psp sdk.

Jim
emumaniac
Posts: 79
Joined: Sun May 08, 2005 12:22 am

Post by emumaniac »

link not working ?
User avatar
Jim
Posts: 476
Joined: Sat Jul 02, 2005 10:06 pm
Location: Sydney
Contact:

Post by Jim »

Fine here. :-/
Jim
caetla
Posts: 3
Joined: Sat Jul 09, 2005 10:27 am

Post by caetla »

get compilation issue :

Code: Select all

root@graziella /usr/local/pspdev/psp/sdk/samples/mikmod-3.0.3 # ./build-mikmod.psp.sh
make: Warning: File `mdreg.c' has modification time 1.3e+04 s in the future
psp-gcc  -O2 -I. -I../include -I/usr/local/pspdev/psp/sdk/include -g -DPSP   -c -o mdreg.o mdreg.c
psp-gcc  -O2 -I. -I../include -I/usr/local/pspdev/psp/sdk/include -g -DPSP   -c -o drv_psp.o drv_psp.c
drv_psp.c:87: warning: initialization from incompatible pointer type
ar r ../lib/libmikmod.a stream.o virtch.o munitrk.o \
        mloader.o mlreg.o npertab.o sloader.o load_uni.o load_mod.o load_m15.o load_mtm.o load_s3m.o load_stm.o load_669.o load_far.o load_dsm.o load_med.o load_xm.o load_ult.o load_it.o s3m_it.o mplayer.o mdriver.o mdreg.o drv_nos.o drv_raw.o drv_wav.o drv_psp.o
make: warning:  Clock skew detected.  Your build may be incomplete.
make: `../lib/libmmio.a' is up to date.
make: Warning: File `mikmodpsp.c' has modification time 1.6e+04 s in the future
psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall -I../include -DPSP -DUSE_ZIP -DCPU_SNAGGER   -c -o mikmodpsp.o mikmodpsp.c
psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall -I../include -DPSP -DUSE_ZIP -DCPU_SNAGGER  -L. -L/usr/local/pspdev/psp/sdk/lib   mikmodpsp.o ../lib/libmikmod.a ../lib/libmmio.a -lpspaudiolib -lpspaudio -lpspdebug -lpsplibc -lpspkernel -o mikmod.elf
../lib/libmikmod.a: could not read symbols: Archive has no index; run ranlib to add one
collect2: ld returned 1 exit status
make: *** [mikmod.elf] Error 1
All done.

any idea ?
thanks
User avatar
Jim
Posts: 476
Joined: Sat Jul 02, 2005 10:06 pm
Location: Sydney
Contact:

Post by Jim »

Looks like however you unzipped it has messed up the file dates.
Try using the 'touch' utility to fix them.
eg.

Code: Select all

cd playercode
touch mdreg.c
also, if it doesn't build clean in one go, use

Code: Select all

./clean-mikmod.sh
FYI I just put the zip file in the samples folder and did

Code: Select all

unzip mikmod-3.0.3.zip
cd mikmod-3.0.3
chmod 777 build-mikmod.psp.sh
./build-mikmod.psp.sh
for a full build.

Jim
caetla
Posts: 3
Joined: Sat Jul 09, 2005 10:27 am

Post by caetla »

it seem you miss the final error :

../lib/libmikmod.a: could not read symbols: Archive has no index; run ranlib to add one
collect2: ld returned 1 exit status
make: *** [mikmod.elf] Error 1
All done.

Caetla
User avatar
Jim
Posts: 476
Joined: Sat Jul 02, 2005 10:06 pm
Location: Sydney
Contact:

Post by Jim »

I'm sorry, I don't know what's wrong there.
Maybe if you do what it says, find libmikmod.a and do

Code: Select all

ranlib libmikmod.a
then run the build again that will work.

Jim
Shine
Posts: 728
Joined: Fri Dec 03, 2004 12:10 pm
Location: Germany

Post by Shine »

Nice work, but for big sound files it needs some minutes to load. I've patched it to load from memory the source and compiled with a nice sample. Now the music starts immediatly after program launch and I've added some text output for the instrument names, which are used for the composer comments.

With the bin2o it is very easy to include large binary files into the PBP file, but you have to use the -G0 switch, if the file is too large. Just put a "music.xm" file into the userdir (need not to be in xm-format, but the name is hard coded in the Makefile) and you can recompile it with your own music.

It is only a quick hack, the clean solution would be to use a special FILE_MIKMOD struct instead of FILE*, which has some pointers to the file IO functions and could be initialized with memory IO or file IO functions, like in ZLIB.
User avatar
Jim
Posts: 476
Joined: Sat Jul 02, 2005 10:06 pm
Location: Sydney
Contact:

Post by Jim »

Thanks! That's a good idea.

What I think I'll do today is build a proper file selection graphical front end for both MikMod and the YM players and put up a src+binary release.

Are there any directory scanning APIs or is it going to be easier to use a playlist?

edit: Another question, maybe it will be enough to improve the buffering in stdio in PSPSDK to get the big modules to load - I'm guessing the real problem is streaming byte-by-byte from the MS?

edit2:
You'll like this one a lot more. MikMod PSP V1.1 is released!
http://members.iinet.net.au/~jimshaw/PS ... -3.0.3.zip
Includes a file browser and a binary release!
Big modules now load instantly too!

Jim
Sixtoe
Posts: 1
Joined: Mon Jul 11, 2005 6:59 am

Post by Sixtoe »

Loverly to have a .mod player for the psp, good work. Handful of requests if possible for a future version...

Can you support files in directories please? (I have too many mods ;) At the moment if you have a directory and select it the player crashs the psp.

Can you make the player automatically move on to the next song in the list?

Can the graphics on playback be optional? (seems to be badly flickering, also not having graphics will improve battery life I imagine)

Can the list be sorted alphabetically rather than randomly (or is it by order added to the dir?)

Cheers,

Six...
User avatar
Jim
Posts: 476
Joined: Sat Jul 02, 2005 10:06 pm
Location: Sydney
Contact:

Post by Jim »

I think all those things are desirable, along with playlists, shuffle and all the other wonders of media player.
The graphics are crap, and just an experiment, I don't think they're going to flatten the battery too quick. I'll have to learn how the blitter library works for next time.

Thanks for the feedback.

Jim
wulfie
Posts: 28
Joined: Fri Jul 08, 2005 6:09 pm

Post by wulfie »

have there been any updates to this awesome player? personally I'd like to see the graphics be 'optional' ;)
User avatar
Jim
Posts: 476
Joined: Sat Jul 02, 2005 10:06 pm
Location: Sydney
Contact:

Post by Jim »

Frankly, this was never supposed to be a binary release. I wanted to use a mod player for doing as yet undesigned PSP demos. Both the YM player and MikMod have been incorporated into PSPMediaPlayer. While that also is an immature product, I'm sure it would be better if all these media types were supported in one central program and we could all work on the UI, which is the important thing for end users. We're not yet all cooperating at that level, though I hope soon we might.
So, no, I'm not really doing updates unless I need them myself and I feel like it.
Thanks for calling it awesome though :-)

Jim
Warren
Posts: 175
Joined: Sat Jan 24, 2004 8:26 am
Location: San Diego, CA

Post by Warren »

People are more than welcome to contribute to PSPMediaCenter, we were supposed to have a GUI to it made by qubitz but he seems to have dropped the ball. We have setup the gui subdir of PSPMC so that it is very easy to add new GUIs and select them at compile time.
PompeySteve
Posts: 14
Joined: Wed Mar 16, 2005 7:10 pm

Post by PompeySteve »

Hi

I'm having trouble compling... the first error I get is :

mikmodpsp.c (79) : error: parse error before 'dir'

Any ideas?

Cheers

Steve
User avatar
Jim
Posts: 476
Joined: Sat Jul 02, 2005 10:06 pm
Location: Sydney
Contact:

Post by Jim »

The source is compatible with an older version of the SDK. I'll post up a new version later this week.

Jim
adresd
Posts: 43
Joined: Sat Jan 17, 2004 11:32 am

Post by adresd »

As Warren pointed out.

in PSPMC, the gui's have been abstracted out, so ppl can add more.. I please ask they leave the debug gui pretty much alone for me and warren to play with (unless good reasons).

The same is true of the decoders (mp3,ogg,mikmod etc) so they can be easily added/compiled in/out.

the main thing PSPMC does, at its base is handle a list of decoders, the main other point is the gui, which is easily alterable/selectable.

This was all done to try and encourage people to contribute to it, without the normal complaints of 'i dont like that gui', well easy, write your own one, as long as we dont end up with 2^40 gui's it should be manageable.
User avatar
Jim
Posts: 476
Joined: Sat Jul 02, 2005 10:06 pm
Location: Sydney
Contact:

Post by Jim »

Is there a reason why I can't see the source for pspmediacentre in SVN?

Anyway, as promised, updated source for MikMod with latest SDK version is here
http://members.iinet.net.au/~jimshaw/PS ... -3.0.3.zip
also including new binaries.

Changes:
Source updated to latest PSPSDK.
Sorts the file list alphabetically.
Media files now live in PSP/MUSIC instead of local folder.
Some WAV files can now be played (flakey).
Graphics are off by default.

Jim
Warren
Posts: 175
Joined: Sat Jan 24, 2004 8:26 am
Location: San Diego, CA

Post by Warren »

It's in the PSPWare repository, not PSP.
Shine
Posts: 728
Joined: Fri Dec 03, 2004 12:10 pm
Location: Germany

Post by Shine »

What's the current state of mikmod? Looks like there is already a bit of mikmod integrated in PSPMediaCenter. I've compiled PSPMediaCenter (which was a bit difficult, because it expected libmad and libTremor directories instead of using the standard include path, but libmad uses PSPDIR instead of PSPSDK, so even if using the standard directory it would not work, or do I need to set the PSPDIR variable, too? ), but looks like it shows only mp3's from the music directory.

nevyn has repackaged Jim's latest port to a library, perhaps it should be imported in psp svn repository, like libmad and libTremor, and then it can be used from PSPMediaCenter and other programs. If this is the way to go, it should be done like other libraries, first importing the original source as a vendor branch and then the PSP changes.
nevyn
Posts: 136
Joined: Sun Jul 31, 2005 5:05 pm
Location: Sweden
Contact:

Post by nevyn »

Here's my feeble attempt at a library package:
http://ncoder.nevyn.nu/psp/mikmodlib.zip

(Packaging and unix libraries really isn't my area of expertise, so that package is seriously fugly. ('tho it works))
User avatar
Jim
Posts: 476
Joined: Sat Jul 02, 2005 10:06 pm
Location: Sydney
Contact:

Post by Jim »

If someone wants to drop mikmod in as a library into svn, then do it. Sounds like a good idea. I'm on holiday for the next month :-) so I won't be doing any work on it.

I've updated it to the latest PSPSDK and mikmod builds and works well there.

It's true that 3.0.3 isn't the latest version of mikmod, but the 3.1.x and 3.2.x libmikmod code I found will be a fair bit harder to port for very little gain. So I'm not planning to do that.

Jim
User avatar
_tmator_
Posts: 19
Joined: Mon Nov 15, 2004 5:57 pm
Location: France

Post by _tmator_ »

Hi,

i port libmikmod 3.11.1 and i want to commit it on svn but is it a good idea to have twoo mikmod vesion with same headers filename ?

this can do a conflict ....

i wait your suggestions

thx.
nevyn
Posts: 136
Joined: Sun Jul 31, 2005 5:05 pm
Location: Sweden
Contact:

Post by nevyn »

_tmator_ wrote:Hi,

i port libmikmod 3.11.1 and i want to commit it on svn but is it a good idea to have twoo mikmod vesion with same headers filename ?

this can do a conflict ....

i wait your suggestions

thx.
It'd be a real bad idea for one to have both mikmodlib and libmikmod installed on their computer, but I guess it'd be fine to have both in the /repository/. If I remember correctly though (and I might be wrong on this, on both parts) libmikmod has a GPL license and the ps2dev svn doesn't allow infectious licenses.

I'm real curious tho': What's new in libmikmod, compared to the old mikmodlib?
User avatar
_tmator_
Posts: 19
Joined: Mon Nov 15, 2004 5:57 pm
Location: France

Post by _tmator_ »

i don't know but i use it to run bb demo from aalib ;)
Shine
Posts: 728
Joined: Fri Dec 03, 2004 12:10 pm
Location: Germany

Post by Shine »

nevyn wrote:If I remember correctly though (and I might be wrong on this, on both parts) libmikmod has a GPL license and the ps2dev svn doesn't allow infectious licenses.
GPL would conflict with the BSD licence of Lua Player, but looks like it as LPGP, which is ok: http://mikmod.raphnet.net/#license

Perhaps there are fewer bugs in it and more features, then it would be a good idea to delete the current SVN libmikmod, but please check, if the wav read function of the 3.11.1 has the bug fixed, which I've fixed in the SVN version (it has problems reading some wav files, because the read function didn't tested the chunks the right way).
User avatar
Jim
Posts: 476
Joined: Sat Jul 02, 2005 10:06 pm
Location: Sydney
Contact:

Post by Jim »

It didn't look like much had changed in the driver, feature-wise, to me. Still only mono PCM samples for instance, and one new module format added. All the work seems to have been done in the front-end player, which isn't much use on the PSP. The player is GPL.
I didn't think it was worth the extra hassle to go from PD to LGPL.

Jim
Post Reply