Page 1 of 1

Compile libmp3 with ps2sdk

Posted: Tue Feb 22, 2005 9:21 pm
by neofar
Hiz.

Anyone knows how I can to compile libmp3 only with ps2sdk... it's possbile?

in makefile I see:
EE_LIBS += -lfileXio -lsample -lmad -lpad -lgs -lm -lcdvdfs -lc -lkernel -lsyscall -lc
  • where...
    -lfileXio (ok, in ps2sdk)
    -lsample (what?????)
    -lmad (ok, included with libmp3)
    -lpad (ok, in ps2sdk)
    -lgs (What!!!!!! gs in sound lib?????)
    -lm (from newlib???)
    -lcdvdfs (ok, in ps2sdk)
    -lc (ok, in ps2sdk)
    -lkernel (ok, in ps2sdk)
    -lsyscall (ok, in ps2sdk)
in the past I allways get a caotic installation with ps2lib + newlib + other random libs.... but now I'm working with a clear installation of ps2sdk, without any external libs

I install only the libs that I need... so what I need to compile this?
thanks men!!

Posted: Tue Feb 22, 2005 10:58 pm
by neofar
I download 'libcdvd' and correct some make sentences... and now I compile the lib, and the sample only give me 2 erros:

Code: Select all

libmp3.o(.text+0xbbc): undefined reference to `ls_get_resampler'
libmp3.o(.text+0xc18): undefined reference to `ls_resampled_size'
I search this functions in libmp3 sources and libmad sources, but only found the declaration in sample.h

in this file I see this line "libsample - audio sample convertion/mixing library" ..... this it's the -lsample ..... where it's this library?

Posted: Tue Feb 22, 2005 11:14 pm
by cheriff
libsample is what resamples audio from whatever the file is (44.1kHz for instance) to 48kHz which is required by sjpcm.irx.

libsample.a and libcdvdfs.a are in cvs under:
libmp3/contrib/lib/attic

speaking to rinco on irc, he mentioned something about compiling libmad with resampling included, hence libsample being left to the attic... not sure why it's still needed, in that case.

might also be worth looking at
cvs/ps2sdk-ports/[ libmad madplay]

i couldn't get these to fully compile, but may still be useful

Posted: Wed Feb 23, 2005 1:17 am
by neofar
I see both libsample.a and libcdvdfs.a browsing cvs... I will try it
I'm downloading the ps2sdk-ports repository... will try to recompile libmad

Posted: Wed Feb 23, 2005 1:58 pm
by rinco
please forgive my lack of instructions and read
http://forums.ps2dev.org/viewtopic.php?t=1047

if you are interested in using madplay with your demo
then just patch main() to something like play_mp3()
and away you go. but be careful. it's GPL, so you may
want to avoid mixing it with AFL code.

if you plan on distributing a binary; then you could compile
madplay such that it can be executed by pkoLoadElf(). i've
done this and it works great.

Posted: Wed Feb 23, 2005 2:34 pm
by rinco
I should probably also explain this craziness...
-lsample (what?????)
-lgs (What!!!!!! gs in sound lib?????)
I started off libmp3 by attempting to collate all the features of the
libmad derivatives that are floating about. Then I decided to start
from scratch*...

The result is what you find in ps2sdk-ports/{libid3tag,libmad,madplay}:
a port that doesn't depend on -lsample or -lgs and interprets id3v2 tags.
I also think my use of threads is simpler, sexier and faster.

libmp3 remains an abomination for now.

* I kept bstdfile.c/file.c/directory.c/rmalloc.c because they are nice, but
I'm not sure if bstdfile is GPL compatible.