gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS Misc > ARM7 MP3 Playback test

#143450 - Lazy1 - Sun Oct 21, 2007 9:48 pm

I have it somewhat working though it's a bit hacky in a few places and only works with mono MP3s.

http://rapidshare.com/files/64213556/mp3stream-test.zip.html

Extract d_e1m1.mp3 to the root of your card, run mp3stream.nds

Limitations/info:

1) Mono only
2) As far as I know 128kbps is the limit on bitrate
3) Thrown together, there may be some bugs

Any tips/suggestions would be helpful, let me know if it plays properly too.

#143454 - DragonMinded - Sun Oct 21, 2007 10:26 pm

Why mono only? Is this due to processing speed or setup limitations?
_________________
Enter the mind of the dragon.

http://dragonminded.blogspot.com

Seriously guys, how hard is it to simply TRY something yourself?

#143471 - Lazy1 - Mon Oct 22, 2007 2:48 am

If I remember correctly the decoder outputs the samples for left and right in the same buffer.
While it's possible to separate it into two different buffers and play each back on their own speaker I chose not to for the sake of simplicity.

That and stereo sound may require more data to be read from the arm9 and there are already certain situations where it doesn't get done fast enough. (swiWaitForVBlank)

#143473 - tepples - Mon Oct 22, 2007 3:20 am

MoonShell and DSOrganize manage to fill the ring buffer fast enough to keep up with playback. If you make the two ring buffers big enough so that you can decode several frames ahead, it becomes more difficult for a single vblank to throw things off. You could try 4608 samples each, which is four MP3 frames.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#143474 - Lazy1 - Mon Oct 22, 2007 3:36 am

I guess it would be possible to make the buffer 2 times larger and see how that goes.

#143484 - username - Mon Oct 22, 2007 8:40 am

e1m1? If this is being developed in order to provide music for a Doom port, you could always use XM files instead...

#143485 - Lazy1 - Mon Oct 22, 2007 8:53 am

I just picked an mp3 from Doom to test the decoder, if someone wants to throw the decoder into the doom sources they are more than welcome to.

#143515 - dantheman - Tue Oct 23, 2007 2:34 am

Just for the sake of having some place slightly more permanent than Rapidshare to host it, here's a mirror.

#146081 - FireSlash - Wed Nov 28, 2007 6:26 pm

Does not compile. Seems to be missing a file or two, others are improperly placed.

Code:
c:/work/Pi_MP3/arm7/source/mp37.c:28:23: warning: ipcshared.h: No such file or directory
c:/work/Pi_MP3/arm7/source/mp37.c:30:20: warning: mp3dec.h: No such file or directory

_________________
FireSlash.net

#146083 - Lazy1 - Wed Nov 28, 2007 6:42 pm

Compiles fine here, make sure your makefile has all of the paths set up.
Check the arm7 makefile that the example came with.