Homebrew MusicPlayer Advance: ID-ing compression algorithm from 2003 homebrew

therealbenwiley

Member
OP
Newcomer
Joined
Feb 23, 2024
Messages
10
Trophies
0
XP
67
Country
Canada
Hi there, I'm new to these forums, looking for folks who might know about GBA homebrew toolchains from 2003.

I came because I'm working on trying to reverse engineer the ROM-building process for MusicPlayer Advance, Neimod's 2003 WinAMP-inspired homebrew for GBA. I know there are better-maintained music player solutions like GSMPlayer, but I find MPA to be charming and the Windows software for converting audio and packing it into the ROM still works!

The (somewhat tedious) process goes like this:
1. Convert audio files to PCM (WAV) with specific bitrate and sample rate
2. Use MPAWRITE.exe to convert PCM to "MPA" format (mystery compression), one file at a time.
3. Use MPAWRITE.exe to insert a playlist of MPA format tracks into the music player ROM.

I'm a web dev and I want to build a web app that automates this whole process, so you upload a list of songs and it spits out a MusicPlayer Advance ROM with your music included.

I already successfully spec'd the format used for packing MPA into the ROM, but I haven't figured out what compression is used to convert PCM to the MPA format. I figured folks familiar with early GBA homebrew toolchains might be able to provide insights. Were there common types of file compression, or common audio file types, used for homebrew games at the time?

I have attached a folder with all the MusicPlayer Advance files, plus a text file where I describe the spec of the MPA audio storage in the GBA ROM, and also a before/after sample of PCM converted to MPA.
 

Attachments

  • MusicPlayer_Advance_2-20240224T170549Z-001.zip
    1.4 MB · Views: 54

therealbenwiley

Member
OP
Newcomer
Joined
Feb 23, 2024
Messages
10
Trophies
0
XP
67
Country
Canada
I would like to know also. :(

I somewhat automated the process of making the ROM, but it still does require manual work to encode PCM files to NEiM0D's mysterious MPA codec.

I created a hacky approach to achieve a similar goal for the SCFW project
Did you try / were you successful writing MPA2 to a cartridge? This is a separate issue I've run into, I'm getting a blank screen (Game Boy but no Nintendo logo) when launching it on a GBA SP
 

OmDRetro

Well-Known Member
Newcomer
Joined
Apr 23, 2024
Messages
90
Trophies
0
XP
251
Country
Philippines
Did you try / were you successful writing MPA2 to a cartridge? This is a separate issue I've run into, I'm getting a blank screen (Game Boy but no Nintendo logo) when launching it on a GBA SP

Yep, already tested :D



My only problem now is automating the conversion from PCM to MPA.


EDIT:

As for booting this on a cartridge, the best way to perform UAT is to open the ROM itself in an emulator WITHOUT skipping the BIOS. It will let you know if the ROM passes the logo check(which means it can boot on a real cartridge). I learned this the hard way when I thought it had something to do with the BIOS 😅

https://github.com/mgba-emu/mgba/issues/3227#issuecomment-2156436936

If the ROM fails the logo check, you must apply gbafix (this binary comes with the devkitarm toolchain). Once fixed, it should boot.
 
Last edited by OmDRetro,
  • Love
Reactions: SylverReZ

therealbenwiley

Member
OP
Newcomer
Joined
Feb 23, 2024
Messages
10
Trophies
0
XP
67
Country
Canada
Ah I see you're using an SD cart. I should try with my Everdrive and see if that works. I was flashing with GBxCart RW to a single flash cart.
Post automatically merged:

Thanks so much for the tip about gbafix. This was indeed what I needed and the ROM works now on my GBA. I had been running the built-in fixers proposed by FlashGBX which worked for others ROMs.

As for the format, I still have no idea.
Post automatically merged:

Also, another thing I'd love to figure out, is how I could inject graphics into the ROM. I'd love to insert album art into the header. I opened the GBA file up in a tile editor (called "Tile Molester" (???)), I was able to make out an embedded array of alphanumeric characters as well as some pieces of the logo, but the graphics seem pretty mangled/compressed. I guess I could figure it out if I spend long enough drawing red pixels in random places, but it will require much trial and error.
 
Last edited by therealbenwiley,

SylverReZ

Well-Known Member
Member
Joined
Sep 13, 2022
Messages
9,260
Trophies
6
Location
The Wired
Website
m4x1mumrez87.neocities.org
XP
28,967
Country
United Kingdom
Does the MusicPlayer Advance have any sort of buffer overflow that can be performed on the audio files, similar to the Nintendo 3DS Sound? Perhaps try to find ways to expand the audio length or header to locate a flaw that could allow the execution of unsigned code (i.e., homebrew).
 

OmDRetro

Well-Known Member
Newcomer
Joined
Apr 23, 2024
Messages
90
Trophies
0
XP
251
Country
Philippines
The audio compression is Dialogic ADPCM (aka VOX) [https://en.wikipedia.org/wiki/Dialogic_ADPCM]. Tools that use libsndfile (like Adobe Audition) support reading and writing it.

I tried importing a converted PCM file(*.MPA) to Audacity. Since VOX is headerless and that its a raw sound file, I tried importing with the ff. settings:

VOX-Audio(UnusualSound).PNG


The output audio is wrong. I can hear the music being played, but its as if only certain mid-low frequencies are captured. Also, I haven't tried SOX to see if that will make a difference in playback after conversion from VOX(Raw audio / Headerless) to the usual playback formats.

EDIT: I stumbled upon this discussion indicating that ADPCM can have a multitude of implementations/algorithms. Looks like we may be stuck with MPAWrite for a while.
 
Last edited by OmDRetro,

Rednorka

Well-Known Member
Newcomer
Joined
Nov 30, 2021
Messages
55
Trophies
0
Website
rednorka.tumblr.com
XP
1,211
Country
Russia
I heard from a friend who attempted GBA sound modding that IMA ADPCM might work in this regard (unless you already tried it). Do avoid using Adobe Premier for the conversion though - it wrongly uses this name for VOX ADPCM format.
 
  • Like
Reactions: hippy dave

OmDRetro

Well-Known Member
Newcomer
Joined
Apr 23, 2024
Messages
90
Trophies
0
XP
251
Country
Philippines
I heard from a friend who attempted GBA sound modding that IMA ADPCM might work in this regard (unless you already tried it). Do avoid using Adobe Premier for the conversion though - it wrongly uses this name for VOX ADPCM format.

Thanks for the suggestion, but I think that somehow narrows it down. Much like what's mentioned in my last comment, there IS a multitude of compression algorithms/codecs.

Here's a small snip of a few ADPCM formats so far.
ADPCM_ID-ing.PNG


I'll take a look via trial and error to see which ones NEiM0D has likely used.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    Kirbydogs @ Kirbydogs: @SonicMan44 https://upload.wikimedia.org/wikipedia/en/5/53/Snoopy_Peanuts.png can you make me a...