Sync your saves between Batocera, Onion, and MuOS (2024)

There are a lot of retrogaming devices out there right now. Like, a lot.

Oh look, here’s one now:

Sync your saves between Batocera, Onion, and MuOS (1)

Two of the most popular devices at the moment are the Miyoo Mini Plus and the Anbernic RG35XX Plus, with dozens more available and new models being released monthly. (Buying devices using those links will get me a sweet little kickback, if you’re so inclined.)

If you play retrogames on more than one device, you’ve probably wondered if there was any way to sync your saved games’ data across all of them. There is, but it’s hard!

We’ll be setting up a tool called Syncthing to silently and automatically copy files across devices whenever save data is created or updated on any of them.

Operating System Fragmentation

Handheld gaming devices are infamous for shipping with badly translated, poorly-performing operating systems. As a result, a dozen different alternative OSs have been built by passionate developers to help make the user experience better.

Creating a single “universal” OS that works for all handheld gaming devices would be impractical, so each alternative OS works with just a small group of devices.

I’d argue that, as of right now, Onion is the best OS for the Miyoo Mini Plus, and muOS is the best for the RG35XX Plus.

While these OSs (and others) provide a much better user experience than anything device manufacturers have been able to provide, the picture begins to break down when you want to share save data between them. Different design decisions and architectures have led to a fragmented landscape.

There is very little consistency between these alternative handheld OSs when it comes to things like hotkey combinations, ROM locations, and – most importantly for our purposes – save data locations.

The Goal

The goal here is to sync both save states and save data across three devices:

  • Any mini PC running stock Batocera (v39)
  • Any handheld device running Onion (v4.3.1-1)
  • Any handheld device running muOS (v2405.2)

Save Data Locations

We’ve got our work cut out for us. Look at this mess. These are the default locations for saves across OSs:

Save Data LocationSave States Location
Batocera/userdata/saves/[systemname]//userdata/saves/[systemname]/
Onion/mnt/SDCARD/Saves/CurrentProfile/saves/[corename]//mnt/SDCARD/Saves/CurrentProfile/states/[corename]/
muOS/mnt/mmc/MUOS/save/file/[corename]//mnt/mmc/MUOS/save/state/[corename]/

[systemname] would typically be whatever your ROM folder name is. “atari2600” for example.
[corename] is the libretro core name. Like “Stella 2014“.

IMPORTANT: muOS lets you use whatever ROM folder names you want, so I re-used Batocera’s naming convention to try to get some consistency in my setup.

Just sync them all!

It’s tempting to say “I’ll just use Syncthing to sync those two groups of folders with each other!” While you certainly could do that, it would break everything.

Two of the three OSs store their save data and states in separate directories. Two of the three name those directories after after RetroArch cores, not content. And among those two, they use different naming conventions for their content directories! We need to establish some kind of uniformity across platforms to make this work.

There’s no other way around this – we’ve got to change the location where save data lives on some of our devices before we can set up any kind of automated sync.

Changing Defaults

Batocera keeps its save data and save states in a single folder by default. I like that approach, so I’m going to stick with it. I’ll need to modify my handhelds to do that, too.

So then the question becomes “Do I standardize on putting this data in a folder called systemname or corename?”

Saving by core name is not the solution because it would require you to use the same core across all of your hardware platforms. That’s not always practical when you’re using a mix of handheld devices and desktop PCs.

We’re going to save by system name. That’s not a perfect fix either because content directory names aren’t consistent across OSs. “sega32x” on Batocera is “THIRTYTWOX” on Onion. “nes” on Batocera is “FC” on Onion. The list goes on. This discrepancy alone prevents us from sharing one big ‘saves’ folder across platforms.

But we’re syncing across three OSs, so we need to figure this out!

Configuring Batocera

Sync your saves between Batocera, Onion, and MuOS (2)

Batocera lives in an always-on mini PC on my network. I’ll use this machine to act as a “save server,” the central hub from which all other devices on the network will push and pull save data.

I also want to keep Batocera relatively pristine, so aside from installing Syncthing, I’m not going to change anything in RetroArch.

Enable Syncthing

  • ssh in
  • batocera-services enable syncthing
  • Reboot

After reboot you’ll have Syncthing running on port 8384. There’s more info about this over on the Batocera wiki.

Configure Onion

Sync your saves between Batocera, Onion, and MuOS (3)

Install Syncthing

Syncthing isn’t (yet) part of Onion. You’ll need to install it manually using the instructions in this repo. Once installed, it’ll be up and running on port 8384.

Configure RetroArch

  • From Onion’s main menu, navigate to Apps/RetroArch.
  • Go to Settings/User Interface. Enable “Show Advanced Settings”
  • Go into “Menu Item Visibility” then “Settings”.
  • Enable “Show ‘Directory'”
  • Go back to Settings/Saving and set the following:
    • Sort Saves into Folders by Core Name: OFF
    • Sort Save States into Folders by Core Name: OFF
    • Sort Saves into Folders by Content Directory: ON
    • Sort Save States into Folders by Content Directory: ON
  • Back out, and go to Settings/Directory. Change the following:
    • Save Files
      • Don’t change this at all. We’re re-using this folder.
    • Save States
      • from: /mnt/SDCARD/Saves/CurrentProfile/states/
      • to: /mnt/SDCARD/Saves/CurrentProfile/saves/
  • Back out to RetroArch’s Main Menu/Configuration File, then “Save Current Configuration”

Configure muOS

Sync your saves between Batocera, Onion, and MuOS (4)

Enable Syncthing

  • From muOS’ main menu, navigate to Configuration/Web Services.
  • Enable Synthing

Syncthing is now running on port 7070. I’m not sure why muOS chose to change its default port.

Configure RetroArch

  • From muOS’s main menu, navigate to Applications/RetroArch.
  • Go to Settings/Saving and set the following:
    • Sort Saves into Folders by Core Name: OFF
    • Sort Save States into Folders by Core Name: OFF
    • Sort Saves into Folders by Content Directory: ON
    • Sort Save States into Folders by Content Directory: ON
  • Back out, and go to Settings/Directory. Change the following:
    • Save Files
      • from: /mnt/mmc/MUOS/save/file/
      • to: /mnt/mmc/MUOS/save/
    • Save States
      • from: /mnt/mmc/MUOS/save/state
      • to: /mnt/mmc/MUOS/save/
  • Back out to RetroArch’s Main Menu/Configuration File, then “Save Current Configuration”

Configure Syncthing

All the groundwork is now done. We’ve configured our mobile devices to save their data in new locations and we’ve got Syncthing installed and running on all of them. Now it’s time to configure Syncthing.

Sync your saves between Batocera, Onion, and MuOS (5)

Because of the ROM folder naming convention disparity between Onion and everything else, we will have to select each individual system save folder to share individually. It’s a pain, but it’s the only way.

We’ll be using Sony PlayStation as an example here. You will need to repeat this process for each system whose saves you want to sync.

Configure Syncthing on Batocera

You’ll need to visit the Syncthing web interface running on your Batocera machine, “Add Remote Device”, then figure out how to add both your MuOS and Onion devices to its “Remote Devices” list. That’s pretty basic. I don’t need to write it out. You can do it.

Now you’re going to share Batocera’s PlayStation saves directory.

  • Click “Add Folder”
    • Folder Label: “Sony PlayStation”
    • Folder ID: leave as-is
    • Folder Path: /userdata/saves/psx
  • Click the Sharing tab
    • Click the checkboxes for both your muOS and Onion devices.
    • Leave the password fields blank
    • Click Save.

Configure Syncthing on Onion

Open the Syncthing web interface running on your Onion device. You’ll now have a prompt asking you to accept the shared folder. You will need to be familiar with Onion’s rom folder names. In the case of PlayStation, Onion uses “PS” in capitals.

  • Click Add
    • Folder Label: leave as-is
    • Folder ID: leave as-is
    • Folder Path: /mnt/SDCARD/Saves/CurrentProfile/saves/PS
  • Click Save

Onion is now syncing saves with Batocera silently in the background and will continue to do so whenever it’s turned on and any files have changed on either device.

Configure Syncthing on muOS

Open the Syncthing web interface running on your muOS device. You’ll see the same prompt asking you to accept the shared folder.

  • Click Add
    • Folder Label: leave as-is
    • Folder ID: leave as-is
    • Folder Path: /mnt/mmc/MUOS/save/psx
  • Click Save

And now muOS is good to go. Like Onion, it will also sync saves with Batocera silently in the background whenever it’s turned on and any files have changed on either device.

All Done!

If you’ve done it all correctly, you should end up with a Syncthing dashboard that looks something like this:

Sync your saves between Batocera, Onion, and MuOS (6)

Future updates to Batocera, Onion, and muOS may break this setup. If that happens, it should just be a matter of reconfiguring RetroArch with the instructions above.

Save states can also break between older/newer versions of the same RetroArch core. If and when save states do break (this is rare but it can happen) save data is usually unaffected.

If you found this post helpful, or if you’ve found a better, less labor-intensive way of setting up cross-OS saves sync, please leave a comment below! I’d love to hear about it.

Related

Sync your saves between Batocera, Onion, and MuOS (2024)

References

Top Articles
Latest Posts
Article information

Author: Prof. An Powlowski

Last Updated:

Views: 6463

Rating: 4.3 / 5 (64 voted)

Reviews: 87% of readers found this page helpful

Author information

Name: Prof. An Powlowski

Birthday: 1992-09-29

Address: Apt. 994 8891 Orval Hill, Brittnyburgh, AZ 41023-0398

Phone: +26417467956738

Job: District Marketing Strategist

Hobby: Embroidery, Bodybuilding, Motor sports, Amateur radio, Wood carving, Whittling, Air sports

Introduction: My name is Prof. An Powlowski, I am a charming, helpful, attractive, good, graceful, thoughtful, vast person who loves writing and wants to share my knowledge and understanding with you.