Save Game Extractor: Backup Saves Via Audio

Waterfuell

New Member
Talking from total ignorance, in yabause with satiator suport there is a not full implemented command.
satiator/satiator-yabause, line 118.

This command really loads menu.bin or menu.bin is only a file for test purposes???
There is some variables referencing "bios".
 

Mobius

New Member
Registered just so I could say Thanks and that this is incredible! I was playing around with this last night and it works great. And here's the kicker: my laptop doesn't even have a proper microphone or line-in jack, just a combo jack for headsets and I don't have a proper connector for it. So, I literally just had the audio play through a 20 year old set of crappy PC speakers into my laptop's microphone... And it worked! Amazing!

Bash:
user@lubuntu-virtualbox:~$ minimodem -R 44100 -r 1200 --sync 0xAB --stopbits 4 --startbits 4 > sonicjam.bin
### CARRIER 1200 @ 1200.0 Hz ###

### NOCARRIER ndata=130 confidence=2.506 ampl=0.816 bps=1192.05 (0.7% slow) ###
### CARRIER 1200 @ 1200.0 Hz ###

### NOCARRIER ndata=130 confidence=2.458 ampl=0.819 bps=1191.58 (0.7% slow) ###
### CARRIER 1200 @ 1200.0 Hz ###

### NOCARRIER ndata=118 confidence=2.470 ampl=0.823 bps=1192.52 (0.6% slow) ###
^Cuser@lubuntu-virtualbox:~python3 sgex.py sonicjam.bin
Save Game Extractor
(github.com/slinga-homebrew/Save-Game-Extractor)

Errors Corrected: 4
Transmitted Filename: SONICJAM_01
Transmitted Save Size: 1408
Transmitted MD5: f433d95b7a4e348058326ae812785f52
Computed MD5: f433d95b7a4e348058326ae812785f52

MD5 hashes validate, save is correct.
Wrote save game SONICJAM_01 to disk
 

slinga

Member
Glad to hear you were able to get SGEX to work wirelessly. I'm surprised there were so few errors. I get about 1 bit flip per 500 bytes or so when I have my Saturn wired directly to the line-in on my PC. I would expect wirelessly to have much higher error rates.
 

Mobius

New Member
Glad to hear you were able to get SGEX to work wirelessly. I'm surprised there were so few errors. I get about 1 bit flip per 500 bytes or so when I have my Saturn wired directly to the line-in on my PC. I would expect wirelessly to have much higher error rates.
Any tips for reducing the error rate? I picked up the Sabrent USB audio adapter you mentioned in chat. I was able to transfer a ~2000 byte file successfully (from my FDD, no less), but my Sega Rally records always fail. That file is ~5000 bytes. Tried transferring it from both internal memory and floppy and just can't get it to come through. Always get the same error:

Code:
tim@lubuntu-virtualbox:~/Saturn Saves$ python3 ./sgex.py rally_records.bin
Save Game Extractor
(github.com/slinga-homebrew/Save-Game-Extractor)

Reed Solomon couldn't decode buffer, too many errors.
<class 'reedsolo.ReedSolomonError'>
 

slinga

Member
Presumably you've copied it over multiple times? What are the file sizes like? For rally_records.bin. Do the sizes vary? Are the MD5 sums of the files the same?

There might be some other bug going on. I've transferred 20k Fire Pro saves before without issue (with Reed Solomon fixing a few errors).

What was your error rate on the 2000 byte file? The confidence values above (when you were transferring over-the-air) look kind of low. With a cable plugged in I would expect around ~4.0 or higher confidence.

It looks like from your screenshot you are working in a VM. What if you saved the audio file directly as a .WAV or whatever. Use whatever recording software you want. Then use minimodem's file input option ("-f") to process it?

And if you have the minimodem command prompt output I can take a look at that as well.
 
Last edited:

Mobius

New Member
I'll have to take some time to play around with it and get specific answers to your questions, but I just tried again and here's the output:

Bash:
tim@lubuntu-virtualbox:~/Saturn Saves$ minimodem -R 44100 -r 1200 --sync 0xAB --stopbits 4 --startbits 4 > rally_records.bin
### CARRIER 1200 @ 1200.0 Hz ###

### NOCARRIER ndata=130 confidence=3.931 ampl=1.255 bps=1198.59 (0.1% slow) ###
### CARRIER 1200 @ 1200.0 Hz ###

### NOCARRIER ndata=130 confidence=4.034 ampl=1.255 bps=1197.65 (0.2% slow) ###
### CARRIER 1200 @ 1200.0 Hz ###

### NOCARRIER ndata=130 confidence=4.002 ampl=1.253 bps=1197.18 (0.2% slow) ###
### CARRIER 1200 @ 1200.0 Hz ###

### NOCARRIER ndata=130 confidence=4.020 ampl=1.257 bps=1198.82 (0.1% slow) ###
### CARRIER 1200 @ 1200.0 Hz ###

### NOCARRIER ndata=130 confidence=4.020 ampl=1.255 bps=1198.35 (0.1% slow) ###
### CARRIER 1200 @ 1200.0 Hz ###
                                                                                                                                                                                           
### NOCARRIER ndata=130 confidence=4.008 ampl=1.256 bps=1198.12 (0.2% slow) ###                                                                                                            
### CARRIER 1200 @ 1200.0 Hz ###                                                                                                                                                            
                                                                                                                                                                                           
### NOCARRIER ndata=130 confidence=4.108 ampl=1.258 bps=1198.35 (0.1% slow) ###                                                                                                            
### CARRIER 1200 @ 1200.0 Hz ###                                                                                                                                                            
                                                                                                                                                                                           
### NOCARRIER ndata=130 confidence=3.963 ampl=1.256 bps=1198.59 (0.1% slow) ###                                                                                                            
### CARRIER 1200 @ 1200.0 Hz ###                                                                                                                                                            
                                                                                                                                                                                           
### NOCARRIER ndata=130 confidence=3.949 ampl=1.254 bps=1197.88 (0.2% slow) ###                                                                                                            
### CARRIER 1200 @ 1200.0 Hz ###                                                                                                                                                            
                                                                                                                                                                                           
### NOCARRIER ndata=130 confidence=4.116 ampl=1.256 bps=1197.88 (0.2% slow) ###                                                                                                            
### CARRIER 1200 @ 1200.0 Hz ###                                                                                                                                                            
                                                                                                                                                                                           
### NOCARRIER ndata=130 confidence=4.019 ampl=1.257 bps=1198.59 (0.1% slow) ###                                                                                                            
### CARRIER 1200 @ 1200.0 Hz ###                                                                                                                                                            
                                                                                                                                                                                           
### NOCARRIER ndata=130 confidence=3.914 ampl=1.254 bps=1197.88 (0.2% slow) ###                                                                                                            
### CARRIER 1200 @ 1200.0 Hz ###

### NOCARRIER ndata=128 confidence=4.012 ampl=1.255 bps=1197.85 (0.2% slow) ###
### CARRIER 1200 @ 1200.0 Hz ###

### NOCARRIER ndata=130 confidence=4.025 ampl=1.255 bps=1198.12 (0.2% slow) ###
### CARRIER 1200 @ 1200.0 Hz ###

### NOCARRIER ndata=129 confidence=4.000 ampl=1.256 bps=1198.58 (0.1% slow) ###
### CARRIER 1200 @ 1200.0 Hz ###

### NOCARRIER ndata=128 confidence=4.099 ampl=1.256 bps=1197.85 (0.2% slow) ###
### CARRIER 1200 @ 1200.0 Hz ###

### NOCARRIER ndata=128 confidence=4.046 ampl=1.255 bps=1198.09 (0.2% slow) ###
### CARRIER 1200 @ 1200.0 Hz ###

### NOCARRIER ndata=129 confidence=4.029 ampl=1.255 bps=1197.40 (0.2% slow) ###
### CARRIER 1200 @ 1200.0 Hz ###

### NOCARRIER ndata=128 confidence=4.049 ampl=1.257 bps=1198.81 (0.1% slow) ###
### CARRIER 1200 @ 1200.0 Hz ###

### NOCARRIER ndata=111 confidence=4.147 ampl=1.256 bps=1197.52 (0.2% slow) ###
^Ctim@lubuntu-virtualbox:~/Saturn Saves$ ls -lh | grep rally
-rw-rw-r-- 1 tim tim 2.5K Oct 30 21:26 rally_records.bin
tim@lubuntu-virtualbox:~/Saturn Saves$ python3 ./sgex.py rally_records.bin
Save Game Extractor
(github.com/slinga-homebrew/Save-Game-Extractor)

Reed Solomon couldn't decode buffer, too many errors.
<class 'reedsolo.ReedSolomonError'>

Edit: I just tried recording to WAV first. The test "This is Cool" transmission worked just fine like that, but the full file failed with the same error as above.
 
Last edited:

slinga

Member
Would you mind sending me the wav file? I can see if anything make sense.

Unfortunately it looks like bytes are getting dropped in transmission. All of the chunks should be ndata=130 (except for the last). I'm seeing quite a few 129s, 128, etc. The Reed Solomon encoding I'm using can't recover missing bytes, only flipped bits. If you compare the size of rally_records.bin to the total transfer size in SGC you will see the sizes don't match.
 

Mobius

New Member
I appreciate the follow-up. Just now had a chance to come back to this. Here's the original .wav that I used to create the rally_records.bin file from the output above. (Or at least, I'm pretty sure it's the same one. It's been a few weeks!)
 

Attachments

  • rally.zip
    7.8 MB · Views: 1

slinga

Member
That was actually a fun brain teaser.

Code:
python3 sgex.py rally2.bin
Save Game Extractor
(github.com/slinga-homebrew/Save-Game-Extractor)

Errors Corrected: 6
Transmitted Filename: RALLYPLUS_0
Transmitted Save Size: 5056
Transmitted MD5: 1884dd2a14312001e07dc1642e67c5ef
Computed MD5: 1884dd2a14312001e07dc1642e67c5ef

MD5 hashes validate, save is correct.
Wrote save game RALLYPLUS_0 to disk

If you are curious here's how I did it:
1) I reviewed all of the "### NOCARRIER ndata=130" values. Each transmission (except the last) should be 128 bytes + 2 sync bytes. I noticed the 6th one was only 129 so it clearly lost a byte.
2) I grabbed the entire block containing the missing byte. I then inserted a 0x00 at position 0-254 until Reed Solomon was able to decode. RS is able to recover bit flips not missing bytes.
3) Once I found an offset that worked I edited the rally.bin file and added a 0x00 there.
4) I was now able to run SGEX and RS was able to recover correctly
 

Attachments

  • rally.zip
    4.8 KB · Views: 2

Mobius

New Member
Nice. Seems like this could this be done programmatically?

I have some huge files (like Sega Rally and other racing game ghost data) that I'd like to back up, but clearly it doesn't make sense to do this manually.
 

slinga

Member
Basically if you know the number of missing bytes it shouldn't be too hard to script it up.

Do the large files not compress well?

Also stumped why you are running into these issues. Could you try recording via your phone (assuming you have line-in, dunno if that's possible) or with another laptop? Maybe the AV cables? Power issues to the Saturn? I don't claim to know what I'm talking about, just some things to try out.
 
Top