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

Black screen after ending stream #60

Closed ghost closed 7 months ago

ghost commented 8 months ago

There are two ways to launch a gamestream via Moonlight:

  1. Open the actual Moonlight app itself and then select your game
  2. Add the game from the Moonlight app to your favorites and directly launch it

Option 2 skips launching the app, selecting the PC and then selecting the game. It allows for a much more streamlined experience without having to leave your Kodi interface. However, when you end the stream after you started it via option 2, you're stuck on a black screen with a mouse.

Option 1 doesn't have this problem. When you end the stream, it returns you to the Moonlight app and then you can close the app and return to your Kodi interface. The only way to fix the issue in option 2 is by completely rebooting the PC.

I suppose that some sort of solution is to always use option 1 but that kind of defeats the simplicity of it all. Option 2 is viable if I can somehow create a script that triggers a reboot of my PC as soon as the stream ends, but I have no idea how to do that.

So in short: option 2 results in a black screen and hardlock of the device when ending the stream.

veldenb commented 8 months ago

Which operating system do you use on your Kodi device?

ghost commented 8 months ago

@veldenb LibreELEC Generic Legacy 11.0.6.

A temporary solution that I found: after exiting Steam Big Picture Mode on the host PC (which automatically ends the stream due to a .bat file, but that takes about 2-3 seconds), I quickly hit the disconnect combination on my controller, which returns me to the regular Kodi interface.

veldenb commented 8 months ago

My Intel NUC does the same. I think it's a moonlight-qt bug, because moonlight does not seem to stop itself so the plugin keeps waiting until moonlight-qt has stopped:

LibreELEC:~ # ps | grep moonlight
 9053 root      0:00 /usr/bin/bash /storage/.kodi/addons/plugin.program.moonlight-qt/resources/bin/launch_moonlight-qt.sh stream 192.168.1.140 Steam GamepadUI
 9055 root      0:00 bash bootstrap_moonlight-qt.sh stream 192.168.1.140 Steam GamepadUI
 9056 root      0:00 tee /storage/.kodi/userdata/addon_data/plugin.program.moonlight-qt/moonlight-qt.log
 9073 root      0:48 ./moonlight-qt stream 192.168.1.140 Steam GamepadUI

also no errors in the output of moonlight-qt:

00:00:16 - SDL Info (0): Received first audio packet after 400 ms
00:00:16 - SDL Info (0): Initial audio resync period: 500 milliseconds
00:00:17 - SDL Info (0): Audio packet queue overflow
00:00:17 - SDL Info (0): Network dropped audio data (expected 112, but received 142)
00:03:15 - SDL Info (0): Control stream received unexpected disconnect event
00:03:15 - SDL Error (0): Connection terminated: -1
00:03:15 - SDL Info (0): Quit event received
00:03:15 - SDL Info (0): Failed to send ENet control packet
00:03:15 - SDL Info (0): Loss Stats: Transaction failed: 0
00:03:15 - SDL Info (0): Global video stats
00:03:15 - SDL Info (0): ----------------------------------------------------------
Incoming frame rate from network: 47.31 FPS
Decoding frame rate: 47.31 FPS
Rendering frame rate: 47.25 FPS
Frames dropped by your network connection: 0.00%
Frames dropped due to network jitter: 0.09%
Average network latency: 1 ms (variance: 0 ms)
Average decoding time: 0.80 ms
Average frame queue delay: 0.08 ms
Average rendering time (including monitor V-sync latency): 4.01 ms
00:03:15 - SDL Info (0): Stopping input stream...
00:03:15 - SDL Info (0): done
00:03:15 - SDL Info (0): Stopping audio stream...
00:03:15 - Qt Critical: Connection terminated
00:03:16 - SDL Info (0): done
00:03:16 - SDL Info (0): Stopping video stream...
00:03:16 - SDL Info (0): done
00:03:16 - SDL Info (0): Stopping control stream...
00:03:16 - SDL Info (0): ENet peer is already disconnected
00:03:16 - SDL Info (0): done
00:03:16 - SDL Info (0): Cleaning up input stream...
00:03:16 - SDL Info (0): done
00:03:16 - SDL Info (0): Cleaning up video stream...
00:03:16 - SDL Info (0): done
00:03:16 - SDL Info (0): Cleaning up control stream...
00:03:16 - SDL Info (0): done
00:03:16 - SDL Info (0): Cleaning up audio stream...
00:03:16 - SDL Info (0): done
00:03:16 - SDL Info (0): Cleaning up platform...
00:03:16 - SDL Info (0): done
00:03:16 - Qt Info: Found "gamecontrollerdb.txt" at "/storage/.kodi/userdata/addon_data/plugin.program.moonlight-qt/moonlight-home/.cache/Moonlight Game Streaming Project/Moonlight/gamecontrollerdb.txt"
00:03:16 - SDL Info (0): Loaded 296 new gamepad mappings

So I think you should report it at moonlight-qt: https://github.com/moonlight-stream/moonlight-qt/issues

ghost commented 8 months ago

@veldenb somehow the issue managed to fix itself after I switched from GeForce Experience to Sunshine. I'm not sure what you were using, but maybe you can test it out as well to see if using Sunshine fixes this issue?

veldenb commented 8 months ago

Currently it's best to use Sunshine if you experience issues with GeForce Experience: https://github.com/moonlight-stream/moonlight-qt/issues/918