Compile libmp3 with ps2sdk

Discuss the development of software, tools, libraries and anything else that helps make ps2dev happen.

Moderators: cheriff, Herben

Post Reply
User avatar
neofar
Posts: 47
Joined: Wed Jan 21, 2004 2:40 am
Location: Spain
Contact:

Compile libmp3 with ps2sdk

Post 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!!
User avatar
neofar
Posts: 47
Joined: Wed Jan 21, 2004 2:40 am
Location: Spain
Contact:

Post 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?
cheriff
Regular
Posts: 258
Joined: Wed Jun 23, 2004 5:35 pm
Location: Sydney.au

Post 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
Damn, I need a decent signature!
User avatar
neofar
Posts: 47
Joined: Wed Jan 21, 2004 2:40 am
Location: Spain
Contact:

Post 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
rinco
Posts: 255
Joined: Fri Jan 21, 2005 2:12 pm
Location: Canberra, Australia

Post 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.
rinco
Posts: 255
Joined: Fri Jan 21, 2005 2:12 pm
Location: Canberra, Australia

Post 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.
Post Reply