mmatyas / pegasus-frontend

A cross platform, customizable graphical frontend for launching emulators and managing your game collection.
http://pegasus-frontend.org
Other
1.17k stars 104 forks source link

Pegasus not working properly on pi5 #1091

Open darksaviorx opened 8 months ago

darksaviorx commented 8 months ago

The issue

I managed to build pegasus on my pi5 on 64bit bookworm pi-os-lite, but it loads at 4k30Hz and there's a flashing black rectangle on the upper left corner. I want Pegasus to load at 4k60Hz, and not have the flashing black rectangle. I have hdmi_enable_4kp60=1 on my pi5 config.txt.

Log file: https://pastebin.com/V9fqFt1i IMG_0161 copy

How I built Pegasus:

sudo apt install fontconfig gstreamer1.0-alsa gstreamer1.0-libav gstreamer1.0-plugins-good jq libsdl2-dev policykit-1 libqt5gamepad5-dev libqt5svg5-dev qml-module-qtgraphicaleffects qml-module-qtmultimedia qtdeclarative5-dev qtmultimedia5-dev qttools5-dev-tools qml-module-qtgraphicaleffects qml-module-qtmultimedia qml-module-qtqml qml-module-qtqml-models2 qml-module-qtquick-controls qml-module-qtquick-controls2 qml-module-qtquick-layouts qml-module-qtquick-templates2 qml-module-qtquick-window2 qml-module-qtquick2 qttools5-dev-tools qttools5-dev libqt5multimedia5-plugins qml-module-qt-labs-qmlmodels qtbase5-private-dev
git clone --depth 1 https://github.com/mmatyas/pegasus-frontend
cd pegasus-frontend/
sudo git submodule update --init
sudo wget https://raw.githubusercontent.com/mmatyas/pegasus-frontend/master/etc/rpi4/kms_launch_fix.diff 
sudo patch -p1 < kms_launch_fix.diff
sudo qmake /home/pi/pegasus-frontend QMAKE_LIBS_LIBDL=-ldl USE_SDL_GAMEPAD=1 INSTALLDIR=/opt/retropie/supplementary/pegasus-fe
sudo make -j4
sudo make install

I load Pegasus with:QT_QPA_EGLFS_ATOMIC=1 QT_QPA_EGLFS_KMS_CONFIG=/home/pi/egl.json /opt/retropie/supplementary/pegasus-fe/pegasus-fe -- -platform eglfs

Contents of the json file I use: { "device": "/dev/dri/card1" } Here's the log when I attempt to load pegasus without the json file: https://pastebin.com/HZVqjrUs

I previously tried this other json file which worked on my pi4 (when I wanted to use 1440p), but it does not work on the pi5:

{
  "outputs": [
    {
      "name": "HDMI1",
      "mode": "2560x1440"
    }
  ]
}

I'm not sure how to use { "device": "/dev/dri/card1" }with the above so I can set a resolution.

mmatyas commented 8 months ago

Hm I'm not familiar with 4K displays, I wonder if any of the env vars here https://doc.qt.io/qt-5/highdpi.html could help?

The flashing indicates that there's something constantly trying to draw at the same time as Pegasus. I'd assume it's not intentional by any underlying components; I wonder if it comes from somewhere else? Maybe from the hardware, like the overheating indicator on previous Raspberries? Or the OS? The cable signal? Does it happen with any program where you are certain it's running in 4k60Hz?

The Qt version is slightly older than what we use, perhaps this was fixed since then? I wonder if the Pi 5 is backward compatible, and capable of running the Pi 4 build?

darksaviorx commented 8 months ago

I wouldn't know how to try those env vars but I'll do a trial and error later.

The problem is exclusive to only Pegasus. I've had none of these issues with Emulationstation and the Retroarch emulators. They all run at 4k60Hz without issues and without that flashing rectangle.