veldenb / plugin.program.moonlight-qt

A launcher and updater for running Moonlight-qt on LibreELEC.
GNU General Public License v3.0
98 stars 14 forks source link

Doesn't Work On Raspberry Pi 5 Libreelec 12 Using Composite Output! #76

Open 03stevensmi opened 1 month ago

03stevensmi commented 1 month ago

Hey Guys, The Title Says It All!

Using Card1 On Raspberry Pi 5 Via Composite Output Just Crashes!

Here is the log!:

` GNU nano 7.2 moonlight-qt.log
Platform rpi (aarch64) running libreelec 12.0 detected... Loading LibreELEC profile for setting up environment... Using custom libraries from /storage/.kodi/userdata/addon_data/plugin.program.moonlight-qt/moonlight-qt/lib... Using Qt library from /storage/.kodi/userdata/addon_data/plugin.program.moonlight-qt/moonlight-qt/lib/qt5... Running without window manager... Forcing KMS mode: { "device": "/dev/dri/card1" }

Detected resolution 720,576... Using Qt scale factor 0.9... Using Kodi hooks for libreelec... --- Starting Moonlight --- 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 - Qt Warning: QStandardPaths: wrong permissions on runtime directory /var/run/, 0755 instead of 0700 00:00:00 - SDL Info (0): Compiled with SDL 2.31.0 00:00:00 - SDL Info (0): Running with SDL 2.31.0 00:00:00 - Qt Info: No translation available for "C" 00:00:00 - Qt Fatal: Cannot create window: no screens available Aborted (core dumped) `

Please, Can You Fix This?

03stevensmi commented 1 month ago

Holy F*** I actually fixed it. I can't believe I actually cracked it! So.... yeah, I found a guy here mentioning this tutorial: https://github.com/veldenb/plugin.program.moonlight-qt/issues/45#issuecomment-1819935991 so, I looked at the directory he mentioned (/dev/dri/) and I noticed there was a "card2" so I filled this tutorial here:

Hi, I recently bought a pi5 and started to use it with libreelec.

Neither of the libreelec 11 (nightly for pi5) and libreelec 12 (also nightly) worked with this addon.

But I managed to make it work, I followed the answer of this post https://stackoverflow.com/questions/64312387/rpi4-qt5-qml-drmmodegetresources-failed-error

I updated the file "/storage/.kodi/addons/plugin.program.moonlight-qt/resources/bin/launch_moonlight-qt.sh" and added the line:

export QT_QPA_EGLFS_KMS_CONFIG="/storage/.kodi/addons/plugin.program.moonlight-qt/resources/bin/eglfs.json"

Then I added a file "/storage/.kodi/addons/plugin.program.moonlight-qt/resources/bin/eglfs.json" with content:

{ "device": "/dev/dri/card1" }

And it works. By the way I have no idea of what I'm doing and the cause of the issue. Is the bug from libreelec side or should it be managed by this addon ?

By the way I'm really thankfull for all your work this addon really means a lot to me :)

Best regards

But instead of setting just /dev/dri/card1... I set it as:

{ "device": "/dev/dri/card2" }
{ "device": "/dev/dri/card1" }

Then I went to the addons resources ./resources/settings.xml And added this:

<constraints>
                        <options>
                            <option>-</option>
                            <!-- It would be better to populate this list from the system itself: /dev/dri/* -->
                            <option>card0</option>
                            <option>card1</option>
                            <option>card2</option>
                        </options>
                    </constraints>

and Composite-1 here:

<constraints>
                        <options>
                            <option>-</option>
                            <!-- It would be better to populate this list from the system itself: /sys/class/drm/card0-* -->
                            <option>HDMI1</option>
                            <option>HDMI2</option>
                            <option>HDMI3</option>
                            <option>HDMI4</option>
                            <option>HDMI5</option>
                            <option>HDMI6</option>
                            <option>Composite-1</option>
                            <option>DP1</option>
                            <option>DP2</option>
                            <option>DP3</option>
                            <option>DP4</option>
                            <option>DP5</option>
                            <option>DP6</option>
                            <option>eDP1</option>
                            <option>eDP2</option>
                            <option>LVDS1</option>
                            <option>LVDS2</option>
                            <option>VGA1</option>
                            <option>VGA2</option>
                        </options>
                    </constraints>

then lastly added the resolution here:

<constraints>
                        <options>
                            <option>-</option>
                            <option>720x576</option>
                            <option>1280x720</option>
                            <option>1920x1080</option>
                            <option>2560x1440</option>
                            <option>3440x1440</option>
                            <option>3840x2160</option>
                        </options>
                    </constraints>

and rebooted... And BOOM!!... jk it Works Fantastic!

You may want to patch this in a new update.

Hope this helps anyone else with my issue.

veldenb commented 1 month ago

Hi, feel free to create a pull request for it.