Welcome to ThePixelMage.

Try to learn something.
<-Back

A Syncing Ship

Published: 2024-2-17

Sync Up

When I set out on this project I envisioned a world where I could play a bit of Pokemon Crystal on the CRT and then later in bed pick up where I left off on my Steam Deck. While this could be accomplished through manual file transfer I wanted something automatic because I am way too lazy to deal with manually transferring a save each time.

I decided to try out Syncthing as it seemed to do exactly what I needed it to. After setting up the service on my NAS server (named the orojackson, yes after Gol D. Roger’s ship) I was easily able to add my Steam Deck as a device using a Decky plugin. The next challenge was getting this setup on the Pi.

Newer versions of Batocera come with Syncthing preinstalled (after v33) and easy to activate. Unfortunately the version I had installed did not have Syncthing yet. This meant I had to update the OS, which did not go as expected.

I’m Over Overscan

After downloading the latest version of Batocera I was finally able to to try everything out. The only problem was the little voice in my head telling me the screen looks off. If you’ll remember from part two I initially had overscan issues where the screen was partially obscured. This should be solved by modifying the overscan options in config.txt on the SD card. I could not get these settings to affect anything for the life of me. This was not ideal but for the time being there were bigger fish to fry.

Overscanned view of CRT display of ES

It’s Happening

Enabling Syncthing on Batocera is fairly straightforward, it just requires running batocera-services enable syncthing for v38 and higher. For older versions edit /userdata/system/batocera.conf and add system.syncthing.enabled=1. After a reboot you should be able to access Syncthing at http://batocera:8384 where batocera is the IP of the machine.

Now that all the devices were added it was time to create a shared folder. I created a shared folder called retroarch saves to sync the saves associated with RetroArch. My main goal for this project is older games and RetroArch is the backend used by most for older titles. Both the Steam Deck and Batocera utilize RetroArch cores for playing pre-PSX games.

With this knowledge I was able to add a shared folder on the Steam Deck that points to the save location of RetroArch. I then shared this folder with my NAS server’s Syncthing instance. I modified the sync relationship here to be Receive Only as there is no reason for changes on the NAS to be propagated to other devices. For fun I also enabled file versioning so my saves will not only be backed up but also version controlled in case of corruption or other issues.

While setting up the shared folder on the Orojackson I was able to select the path in which the folder should live. I ended up setting this to the same location as a SAMBA share I have for saves. Meaning that not only will saves sync across devices but I now also have easy access to them from any machine with network access.

At that point we were up and running. I booted up Crystal and saved the game, and after exiting I watched the file get synced to the orojackson. We were getting close.

Shared folder named retroarch saves

Bringing it All Together

Now that we had some syncing happening it was time to add a third device to the group. After waiting what felt like forever for the Batocera update to download it was finally time to enable Syncthing. Once it was enabled I added the shared folder and pointed it to the save location on Batocera. At this point everything was ready for a test run.

I sat down and played through the intro of Pokemon Crystal on the Batocera Pi. After getting my darling Totodile I saved the game and watched the magic go. In just a few seconds the save was synced between all devices. I booted up Crystal on Steam Deck and to my amazement I was greeted with the same save I was just playing. It was a success, and now I could finally rest having completed a solid portion of this project.

Tune in next time to see if I end up fixing the overscan issue.

Try to learn something.