Getting Switchres Working with Lakka on Raspberry Pi Zero 2 W (HDMI)
Use the Raspberry Pi 3 (aarch64) image Download the nightly version from: https://nightly.builds.lakka.tv/latest/RPi3.aarch64/
(I used the Lakka-RPi3.aarch64-5.x-20240723-e2c1b74.img.gz image)
Install the image, and boot your Raspberry Pi.
Test Lakka using a LCD and connect it to your network.
Configure the following settings:
- Settings -> User Interface -> Show Advanced Settings = ON
- Settings -> Drivers -> Menu = RGUI
- Main Menu -> Configuration File -> Save Current Configuration
Restart RetroArch to test the RGUI menu:
- Main Menu -> Restart
- Access \\LAKKA network share
- Goto to Configfiles
- Create a folder with the name "firmware"
- Copy 480i_zero.bin to the "firmware" folder.
This file is the EDID to get 480i after booting. It is optional, but it will help to keep everything at 15KHz when switching resolutions.
First, you need to access the console, to do that:
- Settings -> Services -> SSH: Enabled
- Main Menu -> Configuration File -> Save Current Configuration
Then from your PC, access the RPI via SSH:
ssh root@lakka
Answer 'yes' to save the fingerprint. The password is: root
Now, to edit the following files, /flash must be mounted as read and write:
mount -o remount,rw /flash
To edit the files use 'nano' or 'vi'. Ex:
nano /flash/config.txt
/flash/config.txt: Just comment the HDMI lines.
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2009-2014 Stephan Raue ([email protected])
# Copyright (C) 2016-present Team LibreELEC (https://libreelec.tv)
################################################################################
# Bootloader configuration
# config.txt version v1 (do not remove or change this line!)
################################################################################
# For more options and information see
# http://rpf.io/configtxt
################################################################################
# Default GPU memory split, 76MB are needed for H264 decoder
gpu_mem=76
# Don't send initial active source message.
# Avoids bringing CEC (enabled TV) out of standby and channel switch when
# rebooting.
# hdmi_ignore_cec_init=1
[all]
################################################################################
# Use distroconfig-composite.txt instead of distroconfig.txt to enable
# composite video output.
# The composite video mode needs to be configured in cmdline.txt:
# For PAL add: video=Composite-1:720x576@50ie
# For NTSC add: video=Composite-1:720x480@60ie
################################################################################
include distroconfig.txt
#include distroconfig-composite.txt
# uncomment to enable analog audio output
#dtparam=audio=on
#audio_pwm_mode=1
# uncomment to enable infrared remote receiver connected to GPIO 18
#dtoverlay=gpio-ir,gpio_pin=18
force_turbo=0
/flash/distroconfig.txt: Just comment the HDMI lines.
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2019-present Team LibreELEC (https://libreelec.tv)
# WARNING: DO NOT EDIT THIS FILE - IT WILL BE OVERWRITTEN WHEN UPGRADING!
arm_64bit=1
kernel=kernel.img
dtoverlay=vc4-kms-v3d
# disable_overscan=1
# disable_overscan=0
disable_splash=1
dtparam=audio=on
# hdmi_max_pixel_freq:0=200000000
# hdmi_max_pixel_freq:1=200000000
cmdline.txt: The UUIDs are going to be different, don't worry, just add the "drm.edid_firmware=480i_zero.bin" at the end of the line. This will boot 480i with audio support through the HDMI port.
boot=UUID=2307-5426 disk=UUID=7e4b2ed5-e279-40c1-8c5e-3eb0fb91b30d quiet console=tty0 drm.edid_firmware=480i_zero.bin
Connect Pi Zero 2 W via HDMI Use appropriate transcoder (no upscalers) for:
- VGA to SCART
- VGA to Component
- VGA to S-video/composite
Boot. You are going to get Lakka running at 480i.
If RetroArch don't start, check this in RetroArch configuration \\LAKKA\Configfiles\retroarch\retroarch.cfg
video_fullscreen = "true"
video_fullscreen_x = "0"
video_fullscreen_y = "0"
Now configure CRT Switchres (using RetroArch menu in this order)
- Settings -> Video -> CRT Switchres -> CRT Super Resolution = 1920
- Settings -> Video -> CRT Switchres -> CRT Switchres = 15KHz
- Main Menu -> Configuration File -> Save Current Configuration
- Main Menu -> Restart
1920 is the only value that seems to work. 2560 doesn't work.
You can do the same editing: \\LAKKA\Configfiles\retroarch\retroarch.cfg
First you need to stop the RetroArch service via SSH:
systemctl stop retroarch
This is the content of the file regarding crt_switch:
crt_switch_center_adjust = "0"
crt_switch_hires_menu = "false"
crt_switch_porch_adjust = "0"
crt_switch_resolution = "1"
crt_switch_resolution_super = "1920"
crt_switch_resolution_use_custom_refresh_rate = "false"
crt_switch_timings = ""
crt_video_refresh_rate = "60.000000"
Remebember to start the service again:
systemctl start retroarch