mp3 decoding

Start a work log and update it occasionally with your projects progress
Post Reply
User avatar
nocash
Verified
PSX Aficionado
PSX Aficionado
Posts: 605
Joined: Nov 12, 2012
Contact:

mp3 decoding

Post by nocash » September 2nd, 2024, 3:45 pm

I've made an mp3 decoder in 80x86 asm code. That's just a first step towards making a similar decoder in MIPS asm for PSX consoles, and perhaps also ARM asm for GBA consoles. But before porting the code to other consoles, I would be glad about some beta testing & feedback.

The source code and win32 executables can be found here:
http://problemkaputt.de/mp3.htm

If there aren't any serious bugs and flaws in there, then it's almost ready to be ported to other consoles. Except, I should probably first do something about some global variables that are currently preventing to decode multiple mp3 files simultaneously... and after spending 10 weeks on the project, maybe I need a break soon.

scphscpe
Interested PSXDEV User
Interested PSXDEV User
Posts: 6
Joined: Mar 14, 2024

Post by scphscpe » September 5th, 2024, 2:10 pm

I think, people on https://www.vogons.org/ would like to test this thing on an old hardware, but I'm not even registered there and I don't have such hardware.

I tested it with a few tracks on my PC and sometimes they just stop abruptly at random points while the program keeps running and never exits on its own. Converting them to WAV or running it with /test parameter works without issues.

Talking about MP3 playback on old hardware, in the past for DOS I used QuickView Pro, it supported many audio and video formats, even MP4, but I don't know whether it required FPU or not, the readme only says that minimum supported CPU is 386 without specifying any details.

User avatar
nocash
Verified
PSX Aficionado
PSX Aficionado
Posts: 605
Joined: Nov 12, 2012
Contact:

Post by nocash » September 8th, 2024, 8:13 pm

Vogons sounds good for such questions, thanks! I've registered an account and will post there later today.

Yes, some people nesdev also mentioned that v1.1 can hang during playback, apparently on newer multicore processors. I've just uploaded v1.2, with three new EXE's which should fix the problem (if mp3play doesn't work, try mp3wom or mp3lock).

80386 with FPU is probably too slow for mp3, but 80386 with integer maths might work, at 8kHz or so (and there is somebody in the vogons forum mentioning a video in which somebody seems to play 22kHz mp3 on a CRT monitor, which is thought to connect to a 486 with 50MHz).
Last edited by nocash on September 22nd, 2024, 3:38 am, edited 1 time in total.

User avatar
Administrator
Verified
Admin / PSXDEV
Admin / PSXDEV
Posts: 2683
Joined: Dec 31, 2012
I am a: Shadow
PlayStation Model: H2000/5502

Post by Administrator » September 16th, 2024, 3:58 pm

Code: Select all

mp3 player for Playstation
	http://www.geocities.co.jp/Playtown/2004/
	[email protected]


It is first implementation for test.
‚±‚ê‚̓eƒXƒg‚Ì‚½‚߂̍ŏ‰‚ÌŽÀ‘•‚Å‚·B

It is toooooo sloooooooooooow. not optimized for speed yet.
use verbose mode,otherwise you will think psx hang up.
‚Þ‚¿‚á‚­‚¿‚á’x‚¢‚Å‚·B‚‘¬‰»‚µ‚Ä‚Ü‚¹‚ñB
verboseƒ‚[ƒh‚É‚µ‚È‚¢‚ÆPS‚ªƒnƒ“ƒO‚µ‚½‚ÆŽv‚¤‚Å‚µ‚傤B

It read mp3 file from pc-hdd, decode mp3, encode psx adpcm, store sound memory, and last, play sound with loop.
PC‚̃n[ƒhƒfƒBƒXƒN‚©‚çmp3ƒtƒ@ƒCƒ‹‚ð“ǂ݁Amp3‚ðƒfƒR[ƒh‚µApsx adpcm‚ɃGƒ“ƒR[ƒh‚µAƒTƒEƒ“ƒhƒƒ‚ƒŠ‚ɃXƒgƒA‚µAÅŒã‚Ƀ‹[ƒvÄ¶‚µ‚Ü‚·B

long mp3 file is only played first part.
’·‚¢mp3ƒtƒ@ƒCƒ‹‚͍ŏ‰‚Ì•”•ª‚¾‚¯Ä¶‚µ‚Ü‚·B

because using caetla commandline/pcdrv extension. It can't work yaroze.
caelta‚̃Rƒ}ƒ“ƒhƒ‰ƒCƒ“/pcdrvŠg’£‹@”\‚ðŽg‚Á‚Ä‚¢‚é‚̂ŁA‚â‚낤‚º‚Å‚Í“®ì‚µ‚Ü‚¹‚ñB

usage:

psexe mp3play.exe -c [-v] [-h] mp3-filename
 -v verbose mode
 -h program help information

to stop play,press enter on PC.
‰‰‘t‚ð‚Æ‚ß‚é‚ɂ́APC‚Ìenter‚ð‰Ÿ‚µ‚Ü‚·B

example:
  psexe -Y mp3play.exe -c -v pcdrv:sample.mp3

compile:

for compile, need math.h and libm.a.
I get it from newlib at ftp://ftp.cygnus.com/pub/newlib/
ƒRƒ“ƒpƒCƒ‹‚É‚Ímath.h‚Ælibm.a‚ª•K—v‚Å‚·B
Ž„‚Í ftp://ftp.cygnus.com/pub/newlib/ ‚Ìnewlib‚ðŽg‚¢‚Ü‚µ‚½B

Thanks:
mp3 decode  : mpeg3play by ISO MPEG Audio Subgroup Software Simulation Group / Johan Hagman
spu hack    : si.c by Dodger of CREATURE http://www.in-brb.de/~creature/index.htm
adpcm encode: vagpack.c by bITmASTER http://members.xoom.com/_bITmASTER_/

PSX_MP3.zip
You do not have the required permissions to view the files attached to this post.
Development Console: SCPH-5502 with 8MB RAM, MM3 Modchip, PAL 60 Colour Modification (for NTSC), PSIO Switch Board, DB-9 breakout headers for both RGB and Serial output and an Xplorer with CAETLA 0.34.

PlayStation Development PC: Windows 98 SE, Pentium 3 at 400MHz, 128MB SDRAM, DTL-H2000, DTL-H2010, DTL-H201A, DTL-S2020 (with 4GB SCSI-2 HDD), 21" Sony G420, CD-R burner, 3.25" and 5.25" Floppy Diskette Drives, ZIP 100 Diskette Drive and an IBM Model M keyboard.

OdieKessler
What is PSXDEV?
What is PSXDEV?
Posts: 1
Joined: Sep 18, 2024
PlayStation Model: Kessler
Discord: 10001
Location: america

Post by OdieKessler » September 18th, 2024, 7:54 pm

nocash wrote: September 2nd, 2024, 3:45 pm I've made an mp3 decoder in 80x86 asm code. That's just a first step towards making a similar decoder in MIPS asm for PSX consoles, and perhaps also ARM asm for GBA consoles. But before porting the code to other consoles, I would be glad about some beta testing & feedback.Raft Wars

The source code and win32 executables can be found here:
http://problemkaputt.de/mp3.htm

If there aren't any serious bugs and flaws in there, then it's almost ready to be ported to other consoles. Except, I should probably first do something about some global variables that are currently preventing to decode multiple mp3 files simultaneously... and after spending 10 weeks on the project, maybe I need a break soon.
You are really good when you can create an mp3 decoder by yourself. I admire your talent.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests