I’ve recently built a NES/SNES low-latency build out of a Raspberry Pi 4. I wanted to see what I could achieve with this hardware together with Lakka. I am now running Lakka 3.6 and have finished the setup and run some tests. The setup is:
- Raspberry Pi 4 4GB (CPU overclocked to 1.9 GHz, otherwise stock)
- Flirc case
- Lakka 3.6
- Rasphnet USB to Wii controller adapter + Nintendo SNES Classic controller (with 1 ms USB polling and 1 ms adapter polling)
The system/Lakka settings are:
- /boot/config.txt: arm_freq=1900
- Forced global 1000 Hz polling for USB game controllers via kernel command line (/boot/cmdline.txt): usbhid.jspoll=1
- Set emulator Nestopia for NES
- Set emulator snes9x2010 for SNES
- RetroArch: Audio driver = alsa
- RetroArch: Threaded video = off
- RetroArch: Max swapchain images = 2
- RetroArch: Frame delay = 2
- RetroArch: Run-ahead 1 frame (and use second instance enabled)
- RetroArch: Enabled zfast-crt shader
With these settings, I ran input lag tests on Super Mario World and Mega Man 2. I used my iPhone 12 and recorded the screen and me pressing the jump button at 240 FPS. I then used the app “Is It Snappy?” to carefully analyze the result, with 20 samples for each of the two tested games. Before testing, I calculated what the input lag (in 60 FPS frames) would have been on an original console with a CRT, taking into account the character’s placement on the screen. The expected input lag on a real console+CRT:
Super Mario World:
- Avg: 3.2 (i.e. ~53 ms)
- Min: 2.7
- Max: 3.7
Mega Man 2:
- Avg: 2.1 (i.e. ~35 ms)
- Min: 1.6
- Max: 2.6
For this testing, I used my trusty old 22 inch Samsung LCD TV. From previous tests and comparisons I’ve made with other displays, I’ve determined that this display’s input lag when running at 1080p native resolution is approximately 1.05 frames.
The results of my Lakka tests, after subtracting the known input lag of the display (1.05 frames) are:
Super Mario World:
- Avg: 3.2
- Min: 2.7
- Max: 3.7
Mega Man 2:
- Avg: 2.1
- Min: 1.7
- Max: 2.7
As you can see, these results are within measurement tolerances from the “real deal”. This setup, with a lowly Pi 4, performs like the original console and even manages to have the zfast-crt shader active. The one compromise I had to make was to use snes9x2010 instead of snes9x, but I believe snes9x2010 is actually a quite fine core. I can’t say I’ve tried that many games, but two of the heaviest SNES games, SMW2 and Star Fox, seem to work fine, with no stuttering, audio issues, etc.
Using this with my LG OLED65CX, the average input lag will be approximately 5 ms (0.3 frames) worse than the original NES/SNES running on a CRT. That’s quite okay, right?
Big thanks to the RetroArch and Lakka developers for making this possible. I bow in respect.