moonlight-stream / moonlight-qt

GameStream client for PCs (Windows, Mac, Linux, and Steam Link)
GNU General Public License v3.0
11.04k stars 642 forks source link

App won't start on Arch Linux using EGLFS as backend #931

Open MwenDavo opened 1 year ago

MwenDavo commented 1 year ago

Describe the bug I'm trying to setup a PC using Linux dedicated to Moonlight due to the limitations of a RPI4 with 4k60. I've got a 1050ti for the decoding with the nvidia driver package installed and Arch Linux as the OS. I've managed to compile Moonlight-qt from the AUR, and can start the app, but it crashes after starting. Seeing as I have no X or Wayland server, I've set up the appropiate environment variables so that QT uses EGLFS instead. The log just says this:

00:00:00 - Qt Critical: drmModeGetResources failed (Permission denied) 00:00:00 - SDL Info (0): Compiled with SDL 2.26.2 00:00:00 - SDL Info (0): Running with SDL 2.26.2 00:00:00 - Qt Info: No translation available for "en_US" 00:00:00 - Qt Fatal: Cannot create window: no screens available Aborted (core dumped)

After reading the first line I thought the problem was with the DRM being deactivated on the Nvidia driver, so I went and modified it following Arch's wiki page, but nothing changed. Running both as a user and sudo throw the same error. I've also tried adding my user to the render group, but it didn't work.

Steps to reproduce Install Arch using archinstall, then install drivers for Nvidia. Compile Moonlight-QT from the AUR and

Client PC details (please complete the following information)

Moonlight Logs (please attach) 00:00:00 - Qt Critical: drmModeGetResources failed (Permission denied) 00:00:00 - SDL Info (0): Compiled with SDL 2.26.2 00:00:00 - SDL Info (0): Running with SDL 2.26.2 00:00:00 - Qt Info: No translation available for "en_US" 00:00:00 - Qt Fatal: Cannot create window: no screens available Aborted (core dumped)

MwenDavo commented 1 year ago

After A LOT of digging and tinkering I think I got it working, though not as I wanted. Seems I had an issue using Nvidia's proprietary driver, where I had to enable DRM on the kernel for the driver to support it. After that, I got Moonlight to load, but shortly it crashed again, with this log:

00:00:00 - Qt Info: Unable to detect Wayland or X11, so EGLFS will be used by default. Set QT_QPA_PLATFORM to override this. 00:00:00 - Qt Info: Setting display mode by default. Set QT_QPA_EGLFS_ALWAYS_SET_MODE=0 to override this. 00:00:00 - SDL Info (0): Compiled with SDL 2.26.2 00:00:00 - SDL Info (0): Running with SDL 2.26.2 00:00:00 - Qt Info: No translation available for "en_US" 00:00:00 - Qt Warning: qrc:/gui/main.qml:12:1: QML ApplicationWindow: ToolTip must be attached to an Item 00:00:01 - Qt Info: Found "gamecontrollerdb.txt" at "/home/administrador/.cache/Moonlight Game Streaming Project/Moonlight/gamecontrollerdb.txt" 00:00:01 - SDL Info (0): Loaded 193 new gamepad mappings 00:00:01 - SDL Warn (0): Failed to create test window with platform flags: Can't window GBM/EGL surfaces on window creation. 00:00:01 - SDL Error (0): Failed to create window for hardware decode test: Can't window GBM/EGL surfaces on window creation. 00:00:02 - Qt Info: Found "gamecontrollerdb.txt" at "/home/administrador/.cache/Moonlight Game Streaming Project/Moonlight/gamecontrollerdb.txt" 00:00:02 - SDL Info (0): Loaded 193 new gamepad mappings

So I decided to investigate this, and found out the following

Buffer allocation and submission to DRM KMS using GBM is not currently supported. (From https://download.nvidia.com/XFree86/Linux-x86_64/396.51/README/kms.html)

Turns out the driver itself doesn't work with GBM (which EGL uses) when in DRM mode, so using the proprietary driver wasn't an option. Instead, I decided to try nouveau. After installing the required packages, I run the app and it opened, but without any text, which meant I couldn't pair it with my host as I didn't have the code for it.

Surprisingly, after trying with the proprietary driver again and uninstalling it, the app opened using nouveau and displayed text correctly. I have no idea what was causing the issue, but I'm happy that it works nonetheless. I'll be testing if hardware decoding works in a few days, but it doesn't seem promising as the driver has some issues with it.