I put together this guide on how to setup a Raspberry Pi 4 (Model B) running Lakka.
No Game ROMs or BIOS files are linked.
Contents
- Overview
- Raspberry Pi
- Lakka
- Software
- Setup
- Access
- File Paths
- Overclocking
- Configuration
- Emulators
- Consoles
- Configuration
- Games
- Adding Games
- Configuration
- Overrides
- Configurations
- Core Options
- Controllers
- Remaps
- Backup
- Notes
- Resources
Overview
- Build Raspberry Pi
- Download Lakka
- Install Lakka to SD Card or USB Flash Drive
- Overclocking
- Configure Lakka
- Add games
- Configure Emulators, Games, and Controllers
- Backup SD Card
Raspberry Pi
Raspberry Pi 4 (Model B) 4GB or 8GB
Recommendations
Pi 4 Kits:
- CanaKit Starter Kit
- CanaKit EXTREME Kit (Aluminum Fanless Heatsink Case)
- Vilros Basic Starter Kit
- Raspberry Pi 4 Official Full Kit
These have the proper power supply, power switch, and quality SD Card.
Or build your own custom setup with heatsink and cooling fan.
Cases:
- Retroflag NESPi 4
- anidees Aluminum
- anidees Aluminum Extra High
- anidees Aluminum Heat Sink Fanless Extra High
- GeeekPi Armor Case with Fan
Heatsinks:
- GeeekPi Aluminum with Fan
- GeeekPi Low-Profile Cooler with RGB Cooling Fan
- Noctua NF-A4x10 5V 40x10mm Fan
Drives:
- Samsung EVO microSDXC Card
- Samsung FIT Plus USB 3.1 Flash Drive
Lakka
Software
Operating System
Download Lakka for Raspberry Pi 4 (aarch64) (64-bit)
(Donβt use development images, it caused many problems.)
Raspberry Pi Imager
https://www.raspberrypi.org/software
Install Lakka to the SD Card or USB Flash Drive.
FileZilla SFTP
FileZilla (Windows)
For transferring files over the network if needed.
Setup
- Use Raspberry Pi Imager to install Lakka to the SD Card or USB Flash Drive.
- After installation, eject the drive and insert into the Pi.
- Power on the Pi and allow Lakka to boot and finish setup.
- Set up your Lakka Main Configuration and Directories Paths.
Access
https://www.lakka.tv/doc/Accessing-Lakka-filesystem
Credentials
User: root
Password: root
Network
Once connected to the network, find your Raspberry Piβs IPv4 Address from your routerβs device list.
Or from the Piβs terminal type ifconfig -a
.
Wi-Fi
If you are not using Ethernet, enable Wireless network connection.
Settings β Wi-Fi
SSH
Use this for accessing the Piβs terminal from Windows.
Enable the OpenSSH Server in Windows 10
In Windows Command Prompt:
ssh [email protected]
If something gets messed up, you can open C:\Users\[Username]\.ssh\known_hosts
with a text editor and erase it.
SAMBA
Use this for transferring files from Windows to the Pi.
Settings β Services β SAMBA: On
Windows, OS X, and most Linux distributions should be able to navigate directly to Lakkaβs Samba share by entering \\lakka\
into their file browser.
SFTP
Use this for transferring files from Windows to the Pi.
Host: 192.168.1.xxx
File Paths
Lakka | |
---|---|
/tmp/assets/ |
Assets, Menu Themes, Sounds, etc. |
/tmp/cores/ |
Emulator Cores & Info |
/tmp/databases/ |
Databases |
/tmp/joypads/ |
Controller Autoconfig |
/tmp/overlays/ |
Overlays |
/tmp/shaders/ |
Shaders |
/tmp/system/ |
BIOS |
/storage/.update/ |
Update |
User | |
---|---|
/storage/database/cht/ |
Cheats |
/storage/cores/ |
Custom Emulator Cores & Info |
/storage/logfiles/ |
Logs |
/storage/remappings/ |
Controller Remaps .rmp
|
/storage/savefiles/ |
Memory Card Save Files .mcd , .mcr , .srm , .rtc , etc. |
/storage/savestates/ |
Save States |
/storage/screenshots/ |
Screenshots |
/storage/thumbnails/ |
Game Cover Art |
Config | |
---|---|
boot partition |
Overclock, GPU Memory, and Overscan set in config.txt
|
/storage/.config/retroarch/retroarch.cfg |
Main Lakka Configuration |
/storage/.config/retroarch/config/ |
Emulator Configurations .cfg and Core Options .opt
|
Games | |
---|---|
/storage/roms/ |
Games (Interal SD / USB) |
/storage/roms/media/ |
Games (External USB) |
Directory Structure
There seems to be 4 duplicates sets of the same folders in:
/storage/
/storage/.config/retroarch/
/tmp/
/usr/share/
Everything in /tmp/
is a link to /usr/share/
and /usr/lib/
.
-
/usr/lib/libretro
- cores and info files -
/usr/share/libretro-database
- database, cursor, cheats -
/usr/share/retroarch-assets
- assets -
/usr/share/retroarch-overlays
- overlays -
/usr/share/retroarch-system
- bios
Everything in /storage/.config/retroarch/
are the configuration files.
The folders in /storage/
are for user provided content, such as roms, custom assets, saves, thumbnails.
root
ββ storage
β ββ .config
β β ββ retroarch
β β ββ autoconfig
β β ββ config
β β β ββ Flycast
β β β ββ Mesen
β β β ββ mGBA
β β β ββ remaps
β β ββ content_favorites.lpl
β β ββ retroarch.cfg
β β
β ββ playlists
β ββ remappings
β ββ roms
β β ββ Nintendo - Game Boy
β β ββ Sega - Dreamcast
β β ββ Sony - PlayStation
β β ββ External USB Drive
β β ββ More Games
β β
β ββ savestates
β ββ savefiles
β ββ system
β ββ thumbnails
β
ββ tmp
β ββ assets
β ββ cores
β ββ database
β ββ joypads
β ββ overlays
β ββ shaders
β ββ system
β
ββ usr
ββ share
ββ retroarch-assets
ββ retroarch-overlays
ββ retroarch-system
Overclocking
(Optional)
Config
config.txt Documentation
Overclocking Documenation
Using Windows PC
Insert SD Card and open config.txt
with Notepad.
Settings
Guides
How to overclock Raspberry Pi 4
How to Safely Overclock your Raspberry Pi 4 to 2.147GHz
Warning:
Setting
over_voltage
higher than6
or usingforce_turbo=1
will void the Raspberry Piβs warranty and could cause damage.Overclocking requires heatsink cooling. If the Pi overheats passed 85Β°c it will throttle the CPU, defeating the purpose of the overclock.
Add one of these:
Mid
over_voltage=2
arm_freq=1750
High
over_voltage=6
arm_freq=2048
gpu_freq=600
Extreme
over_voltage=6
arm_freq=2147
gpu_freq=750
Recover From a Bad Overclock
From Windows PC
- Power off the Pi
- Remove SD card
- Insert SD card into PC
- Open the
config.txt
with Notepad - Change, comment out
#
, or remove the overclock settings
Configuration
Settings
Drivers
Video: Vulkan
Audio: alsathread
Input: udev
Menu: ozone
Menu Controls
- Settings β Input β Menu Controls β
- Unified Menu Controls:
On
- Menu Swap OK and Cancel Buttons:
On
- Unified Menu Controls:
Quick Menu Hotkeys
- Settings β Input β Hotkeys β
- Menu Toggle Controller Combo:
Start + Select
- Menu Toggle Controller Combo:
Directory Paths
- Settings β Directory
- Make sure all of your paths are set where you want them.
Main Config Resolution
- Settings β Video β Fullscreen Mode
- Fullscreen Width:
1280
- Fullscreen Height:
720
- Fullscreen Width:
Saving Sorting
- Settings β Saving β
- Sort Saves into Folders by Core Name:
On
- Sort Save States into Folders by Core Name:
On
- Sort Saves into Folders by Core Name:
Hidden Files & Unknown Extensions
- Settings β File Browser β
- Show Hidden Files and Directories:
On
- Filter Unknown Extensions:
Off
- Show Hidden Files and Directories:
Emulators
Console | Core |
---|---|
Arcade |
MAME 2003-Plus , MAME 2010 , FinalBurn Neo
|
Atari 8-bit | Atari800 |
Atari 2600 | Stella |
Atari 5200 | Atari800 |
Atari 7800 | ProSystem |
Atari Jaguar | Virtual Jaguar |
Atari - Lynx | Mednafen Lynx |
Commodore - 64 | VICE |
Commodore - Amiga | FS-UAE |
DOS |
DOSBox , DOSBox Pure
|
Magnavox - Odyssey2 | MAME |
Mattel - Intellivision | jzIntv |
Microsoft - MSX | blueMSX |
Microsoft - MSX2 | blueMSX |
NEC - PC Engine - TurboGrafx 16 | Mednafen PCE-Fast |
NEC - PC Engine SuperGrafx | Mednafen PCE-Fast |
NEC - PC Engine CD - TurboGrafx-CD | Mednafen PCE-Fast |
NEC - PC-98 | Neko Project II Kai |
NEC - PC-FX | Mednafen PC-FX |
SNK - Neo Geo | FinalBurn Neo |
SNK - Neo Geo CD | FinalBurn Neo |
SNK - Neo Geo Pocket | Mednafen NGP |
SNK - Neo Geo Pocket Color | Mednafen NGP |
Nintendo - Game Boy | Same Boy |
Nintendo - Game Boy Color | Same Boy |
Nintendo - Game Boy Advance | mGBA |
Nintendo - Nintendo Entertainment System | Mesen |
Nintendo - Super Nintendo Entertainment System | Snes9x-Current |
Nintendo - Nintendo 64 | Mupen64Plus-Next |
Nintendo - Wii | Dolphin |
Sega - Master System - Mark III | Genesis Plus GX |
Sega - Mega Drive - Genesis | Genesis Plus GX |
Sega - 32X | Genesis Plus GX |
Sega - CD | Genesis Plus GX |
Sega - Saturn | Yabause |
Sega - Dreamcast | Flycast |
Sega - Naomi | Flycast |
Sony - PlayStation | PCSX-ReARMed |
Sony - PlayStation Portable | PPSSPP |
The 3DO Company - 3DO | Opera |
Emulator Notes
Arcade
MAME
Lakka Core | MAME Version |
---|---|
MAME 2000 | 0.037b5 |
MAME 2003 | 0.078 |
MAME 2003-Plus | 0.078 |
MAME 2009 | 0.135u4 |
MAME 2010 | 0.139 |
MAME 2014 | 0.152 |
MAME 2015 | 0.157 |
MAME 2016 | 0.174 |
Your roms need to be compatible with the MAME Core version you are using.
Most roms work on 2003-Plus
or 2010
. If it doesnβt, try the FinalBurn Neo
Core.
Some games, such as Donkey Kong, will need the missing audio samples zip files placed in:
/storage/system/mame2003-plus/samples/
Check here for samples https://samples.mameworld.info
Nintendo - NES / SNES,
Sega - Master System / Genesis,
Mesen
Genesis Plus GX
If you experience input lag, try disabling Threaded Video with a Configuration Override.
Nintendo - Nintendo 64
Mupen64Plus-Next
Could not achieve full speed with most games, Video/Audio slowdown and stuttering.
Sega - Saturn
Yabause
Could not achieve full speed with most 3D games, Video/Audio slowdown and stuttering.
2D games are playable. Enable frameskip to reduce any Audio stuttering.
Sega - Dreamcast
Flycast
In the system
BIOS folder, create a new folder named dc
. Inside put the Dreamcast BIOS bin
files.
dc_boot.bin
dc_flash.bin
Fixing Graphical Texture glitches, such as in Street Fighter III: 3rd Strike
- In-Game β Quick Menu (
Start + Select
) β Options β- Anisotropic Filtering:
Off
- Threaded Rendering:
Off
- Anisotropic Filtering:
- Manage Core Options β
Save Game Options
It will create Game Options file /storage/.config/retroarch/config/Flycast/Street Fighter III: 3rd Strike.opt
Sega - Naomi
Flycast
In the system
BIOS folder, create a new folder named dc
. Inside put the Naomi BIOS zip
files.
awbios.zip
hikaru.zip
mie.zip
naomi.zip
naomi2.zip
naomigd.zip
ROM Directory Structure Example (zip
& chd
):
Guilty Gear XX Accent Core
storage
ββ roms
ββ Sega - Naomi (folder)
ββ ggxxac.zip (keep zipped)
β ββ 203_203.bin
β ββ epr-21576e.ic27
β ββ sp5002-a.bin
β ββ ...
ββ ggxxac (folder)
ββgdl-0041.chd
Sony - PlayStation
PCSX-ReARMed
Try the psxonpsp660.bin
BIOS.
Set path in the /tmp/cores/pcsx_rearmed_libretro.info
file.
firmware1_desc = "psxonpsp660.bin (PS1 US BIOS)"
firmware1_path = "psxonpsp660.bin"
MSX 1 & 2
blueMSX
Requires Database
and Machines
folders and files in BIOS /storage/system/
.
Games
Adding Games
Add game rom files to the SD Card/USB Flash Drive over the network.
Or copy them from your computer to the SD card or external USB Flash Drive.
Naming your rom folders by these Libretro schemes will make them easier to navigate.
Game File Compression
Use CHDMAN to convert .bin
/.cue
files into .chd
. Works with PlayStation 1 and Saturn.
- Place
chdman.exe
andCUE or GDI to CHD.bat
in your ROMs folder. - Run the
CUE or GDI to CHD.bat
file. - It will convert all games in the current folder and sub-folders.
Create Console Playlists
Import Content β Manual Scan
You can set the Default Core better with Manual Scan
than with Scan Directory
.
Overrides
Configuration Per-Core or Per-Game
These Configuration files .cfg
will be loaded and override settings in the Main Configuration file.
Mesen Core (Nintendo - NES) Example:
-
Quick Menu β Back out to Main Menu β Settings
-
Make your changes to
Drivers
,Video
,Audio
,Input
,Latency
, etc. -
Main Menu β Quick Menu β Overrides
- Per-Emulator
Save Core Overrides
- Per-Console
Save Content Directory Overrides
- Per-Game
Save Game Overrides
- Per-Emulator
-
It will create Config Override file
/storage/.config/retroarch/config/Mesen/Mesen.cfg
-
The Override will now be loaded the next time you launch the emulator or game.
To improve performance in certain emulator cores, you can set the resolution lower (480p) than the Main Config (720p).
Note: Some TVβs lowest resolution is 480p and canβt display 240p.
Settings β Video β Fullscreen Mode
Fullscreen Width: 640
Fullscreen Height: 480
Nintendo 64 | Mupen64Plus-Next.cfg |
GameCube / Wii | Dolphin.cfg |
Saturn | Yabause.cfg |
Dreamcast | Flycast.cfg |
Naomi | Flycast.cfg |
video_fullscreen_x = "640"
video_fullscreen_y = "480"
Some Cores may not function without the proper Video Driver
.
Settings β Drivers β Video β glcore
Saturn | Yabause.cfg |
video_driver = "glcore"
Disable Threaded Video
for less input lag in some Cores.
Settings β Video β Threaded Video: Off
Nintendo | Mesen.cfg |
Super Nintendo | Snes9x-Current.cfg |
Master System | Genesis Plus GX.cfg |
Genesis | Genesis Plus GX.cfg |
video_threaded = "false"
Core Options Per-Game
These Option .opt
files will be loaded and override settings in the default Core Options file.
Super Mario Bros. 3 (Mesen Core) Example:
In-Game β Quick Menu (Start + Select
) β Options β Manage Core Options β Save Game Options
It will create Game Options file /storage/.config/retroarch/config/Mesen/Super Mario Bros 3.opt
Controllers
Remaps
- In-Game β Quick Menu (
Start + Select
) β Controls β Set Port 1 Controls β- Per-Emulator
Save Core Remap File
- Per-Console
Save Content Directory Remap File
- Per-Game
Save Game Remap File
- Per-Emulator
Saved to /storage/remappings/
.
Backup
Create a backup image of your SD card with Win32 Disk Imager.
- Select your Device drive letter.
- Select Image File save location (make sure it has
.img
file extension). - Click the Read button.
If the SD ever corrupts, you can restore the backup image with the Write button.
Notes
My Setup
- Windows 10
- Raspberry Pi 4 8GB
- Lakka (aarch64 64-bit)
- GPU Memory: 256
- Overclock: High
- Resolution: 1280x720, 640x480
Frame Rate FPS
- If you have a 4K TV, make sure to set the Lakka Main Config to a lower resolution, such as 1080p/720p, or you will get menu lag, low game FPS, and some Emulator Cores will crash.
- Leaving the Fullscreen Resolution configuration set at 0 will use the native resolution of the TV.
- Set each Emulator Core to its own desired resolution, to ensure the Main Config does not override the resolution when using a 4K TV. (Optional)
Safe Shutdown
- Always shut off the Raspberry Pi through the Lakka Menu.
- After the green light has stopped blinking, then it is safe to press the power switch.
- Improper shutdown could corrupt the SD card.
Resources
- Raspberry Pi
- Libretro
- Community & Guides
- Tools