Retroarch: Save files not written on forced close or crashes

Created on 23 Apr 2017  路  3Comments  路  Source: libretro/RetroArch

Description

When a computer crashes or RetroArch is forced to close in another way in which it can't handle the SIGTERM signal, it will not write save files. This can be pretty annoying when you're far in a game but lose progress because of a computer crash, empty laptop battery or unresponsive OS. You name it.

I had this problem on the snes9x core, but I tested it with other cores (in this case bsnes-mercury too) and the same thing happens.

This problem is worse on Android, since force closing the app will also discard the save games. It is pretty common practice on Android by people to close their apps with this method:

https://www.youtube.com/watch?v=lg7rX4MrkME

Skip to 0:23. It won't trigger the save function this way. Someone I know lost a lot of Pokemon progress this way.

Expected behavior

I expect the SRAM to be written the exact moment I save in a game.

Actual behavior

The SRAM is written on close, but this is not always reliable since computers tend to crash sometimes.

Steps to reproduce the bug

  1. Start a game
  2. Save somewhere
  3. Try killing RetroArch by using kill -9 [retroarch's process id]
  4. Your save is gone

Bisect Results

As far as I know, this has always been the case in RetroArch.

Version/Commit

You can find this information under Information/System Information

RetroArch: Frontend for libretro -- v1.5.0 -- dd1da5154 --

Environment information

  • OS: Debian Stretch
  • Compiler: GCC (6.3.0) 64-bitBuilt: Apr 21 2017

Proposed solutions

Do the following by default or let the user set it in the options:

  1. Write to the SRAM file when SRAM gets written. The downside is that it can cause more disk I/O than needed in most cases. However, this can be explained in the option entry.
  2. Set a timer which writes to SRAM periodically. The user can configure the timer which it sees as necessary.

All 3 comments

This is working as intended.

solution 1 isn't doable because some cores use SRAM for actual scratch RAM and write to it constantly.

solution 2 already exists. Settings > saving > SRAM autosave interval.

How did I miss this? I'm sorry for my bug report. Thanks for the great feature.

Taking a few minutes to calm down, I still stand by most of what I said. This is not a good emulator. It鈥檚 basic common sense to synchronize to the disk at least every half hour. Preferably every 10 minutes. That will not affect performance at all for the player. This should be ON BY DEFAULT!!

Hell, if you鈥檙e really that worried about performance, just attach a hook to any code that writes to the battery backup and compare a hash/checksum with a known value and write to the freaking HARD DRIVE if it鈥檚 changed. Again, commonsense.

If you don鈥檛 want angry messages like this from users, then exercise basic common sense. I understand you made this program for free, but I don鈥檛 appreciate having over two hours of my time wasted because I assumed that damn program was saving my work.

This is not a good emulator

Was this page helpful?
0 / 5 - 0 ratings