kamalmostafa / minimodem

general-purpose software audio FSK modem
http://www.whence.com/minimodem
Other
854 stars 114 forks source link

High Confidence But Still Dropping Data #44

Open slinga-homebrew opened 4 years ago

slinga-homebrew commented 4 years ago

Thank you for creating the amazing minimodem. I have ported it to a video game console to try and retrieve my save game data over audio. I am successfully able to transmit and decode small messages (~35 bytes). However when I try and transmit larger blocks of data I frequently run into data corruption, dropped data, or extraneous data. I have tweaked the parameters and I have a confidence of 7-8 but I am still seeing these issues. I chunk the data into 8 bytes before transmitting over.

I tried to transmit 3,236 bytes of data in 405 8 byte chunks. Not counting the last chunk, 5 of the other 404 chunks were truncated. Instead of being 8 bytes in length they were 5-7 bytes long. I verified that my final file byte was 12 bytes short which is the sum of the bytes missing from the 5 truncated chunks.

Here's an example of what it looks like (minimodem -R 44100 -r 200):

### NOCARRIER ndata=8 confidence=8.352 ampl=0.984 bps=200.00 (rate perfect) ###
### CARRIER 200 @ 1250.0 Hz ###

### NOCARRIER ndata=8 confidence=9.251 ampl=0.982 bps=200.00 (rate perfect) ###
### CARRIER 200 @ 1250.0 Hz ###

### NOCARRIER ndata=5 confidence=7.827 ampl=0.982 bps=200.00 (rate perfect) ###
### CARRIER 200 @ 1250.0 Hz ###

### NOCARRIER ndata=8 confidence=8.962 ampl=0.982 bps=200.00 (rate perfect) ###
### CARRIER 200 @ 1250.0 Hz ###

As you can see in the 3rd one, only 5 bytes were sent when I expected to receive 8. The confidence, ampl, and bps, all look great. Can you please provide some advice on how I can improve the reliability of the data transfer? Thanks.

slinga-homebrew commented 4 years ago

I improved things by adding a sync byte, adding start and stop bits, and Reed Solomon encoding my data before transmitting. I get ~1 bit flip every 500 bytes or so but the RS encoding is able to detect and correct it.

rubeemangut commented 3 years ago

@slinga-homebrew may you please share your code changes for adding Reed Solomon support to minimodem project. Thanks for your support.

slinga-homebrew commented 3 years ago

The project is here: https://github.com/slinga-homebrew/Save-Game-Extractor.

I used https://github.com/quiet/libcorrect for Reed Solomon.