LizardByte / Sunshine

Self-hosted game stream host for Moonlight.
http://app.lizardbyte.dev/Sunshine/
GNU General Public License v3.0
19.49k stars 947 forks source link

Black screen when streaming, Error: GL: ~/Sunshine/src/platform/linux/graphics.cpp:529: [00000501] #838

Closed Deytron closed 1 year ago

Deytron commented 1 year ago

Is there an existing issue for this?

Is your issue described in the documentation?

Is your issue present in the nightly release?

Describe the Bug

Following #761 , this new issue prevents the stream from working on Linux, using Nvidia - Wayland - KDE.

649 should have fixed the issue, but on my end it does not work. I suspect this has something to do with the desktop environment and compositor, as the issue is fixed on Sway (Weston compositor) and I use KDE (Kwin).

When using this set of hardware and software, a client gets a black screen when connecting to the server. Reported FPS is 60, audio, keyboard and mouse work fine. And this error is reported :

[2023:01:13:11:39:24]: Error: GL: ~/Sunshine/src/platform/linux/graphics.cpp:529: [00000501]

Expected Behavior

The stream should work with video

Additional Context

No response

Host Operating System

Linux

Operating System Version

Linux Kernel 6.1.7

Architecture

64 bit

Sunshine commit or version

0.17.0 + PR 649 (e77a68c)

Package

other (self built)

GPU Type

Nvidia

GPU Model

Geforce RTX 2060

GPU Driver/Mesa Version

525.85.05

Capture Method (Linux Only)

KMS

Relevant log output

[min_log_level] -- [info]
[2023:01:27:09:36:58]: Warning: Couldn't find app image at path [steam.png]
[2023:01:27:09:36:58]: Info: Found display [wayland-0]
[2023:01:27:09:36:58]: Info: Found interface: zxdg_output_manager_v1(30) version 3
[2023:01:27:09:36:58]: Info: Found interface: wl_output(45) version 4
[2023:01:27:09:36:58]: Info: Found interface: wl_output(46) version 4
[2023:01:27:09:36:58]: Warning: Missing Wayland wire for wlr-export-dmabuf
[2023:01:27:09:36:58]: Info: Found display [wayland-0]
[2023:01:27:09:36:58]: Info: Found display [wayland-0]
[2023:01:27:09:36:58]: Info: Found interface: zxdg_output_manager_v1(30) version 3
[2023:01:27:09:36:58]: Info: Found interface: wl_output(45) version 4
[2023:01:27:09:36:58]: Info: Found interface: wl_output(46) version 4
[2023:01:27:09:36:58]: Info: Offset: 1920x0
[2023:01:27:09:36:58]: Info: Resolution: 1920x1080
[2023:01:27:09:36:58]: Info: Name: DP-2
[2023:01:27:09:36:58]: Info: Found monitor: Ancor Communications Inc ASUS VS228/FALMTF229400
[2023:01:27:09:36:58]: Info: Offset: 0x0
[2023:01:27:09:36:58]: Info: Resolution: 1920x1080
[2023:01:27:09:36:58]: Info: Name: HDMI-A-1
[2023:01:27:09:36:58]: Info: Found monitor: BNQ BenQ GL2460/V1F03876SL0
[2023:01:27:09:36:58]: Info: DP-2: Ancor Communications Inc ASUS VS228/FALMTF229400
[2023:01:27:09:36:58]: Info: HDMI-A-1: BNQ BenQ GL2460/V1F03876SL0
[2023:01:27:09:36:58]: Info: // Testing for available encoders, this may generate errors. You can safely ignore those errors. //
[2023:01:27:09:36:58]: Info: Trying encoder [nvenc]
[2023:01:27:09:36:58]: Info: Screencasting with KMS
[2023:01:27:09:36:58]: Info: Found monitor for DRM screencasting
[2023:01:27:09:36:58]: Info: Color coding [Rec. 601]
[2023:01:27:09:36:58]: Info: Color range: [JPEG]
[2023:01:27:09:36:58]: Info: Screencasting with KMS
[2023:01:27:09:36:58]: Info: Found monitor for DRM screencasting
[2023:01:27:09:36:58]: Info: Color coding [Rec. 601]
[2023:01:27:09:36:58]: Info: Color range: [JPEG]
[2023:01:27:09:36:58]: Info: Screencasting with KMS
[2023:01:27:09:36:58]: Info: Found monitor for DRM screencasting
[2023:01:27:09:36:58]: Info: Color coding [Rec. 601]
[2023:01:27:09:36:58]: Info: Color range: [JPEG]
[2023:01:27:09:36:58]: Info: Screencasting with KMS
[2023:01:27:09:36:58]: Info: Found monitor for DRM screencasting
[2023:01:27:09:36:58]: Info: Color coding [Rec. 601]
[2023:01:27:09:36:58]: Info: Color range: [JPEG]
[2023:01:27:09:36:58]: Info: Screencasting with KMS
[2023:01:27:09:36:58]: Info: Found monitor for DRM screencasting
[2023:01:27:09:36:58]: Info: Color coding [Rec. 601]
[2023:01:27:09:36:58]: Info: Color range: [JPEG]
[2023:01:27:09:36:58]: Info: Screencasting with KMS
[2023:01:27:09:36:58]: Info: Found monitor for DRM screencasting
[2023:01:27:09:36:58]: Info: Color coding [Rec. 709]
[2023:01:27:09:36:58]: Info: Color range: [JPEG]
[2023:01:27:09:36:58]: Error: Could not open codec [h264_nvenc]: Function not implemented
[2023:01:27:09:36:58]: Info: Screencasting with KMS
[2023:01:27:09:36:58]: Info: Found monitor for DRM screencasting
[2023:01:27:09:36:58]: Info: Color coding [Rec. 709]
[2023:01:27:09:36:58]: Info: Color range: [JPEG]
[2023:01:27:09:36:58]: Info: Screencasting with KMS
[2023:01:27:09:36:58]: Info: Found monitor for DRM screencasting
[2023:01:27:09:36:58]: Info: Color coding [Rec. 601]
[2023:01:27:09:36:58]: Info: Color range: [JPEG]
[2023:01:27:09:36:58]: Info: Screencasting with KMS
[2023:01:27:09:36:58]: Info: Found monitor for DRM screencasting
[2023:01:27:09:36:58]: Info: Color coding [Rec. 601]
[2023:01:27:09:36:58]: Info: Color range: [JPEG]
[2023:01:27:09:36:58]: Warning: nvenc: hevc: replacing nalu prefix data
[2023:01:27:09:36:58]: Info: 
[2023:01:27:09:36:58]: Info: // Ignore any errors mentioned above, they are not relevant. //
[2023:01:27:09:36:58]: Info: 
[2023:01:27:09:36:58]: Info: Found encoder nvenc: [h264_nvenc, hevc_nvenc]
[2023:01:27:09:36:58]: Info: Adding avahi service Sunshine
[2023:01:27:09:36:58]: Info: Configuration UI available at [https://localhost:47990]
[2023:01:27:09:36:59]: Info: Avahi service Sunshine successfully established.
[2023:01:27:09:37:19]: Info: /CN=NVIDIA GameStream Client -- verified
[2023:01:27:09:37:21]: Warning: Couldn't find app image at path [steam.png]
[2023:01:27:09:37:21]: Info: /CN=NVIDIA GameStream Client -- verified
[2023:01:27:09:37:21]: Info: /CN=NVIDIA GameStream Client -- verified
[2023:01:27:09:37:21]: Info: Executing: [xrandr --output HDMI-1 --mode 1920x1080]
[2023:01:27:09:37:21]: Info: Executing [Desktop]
[2023:01:27:09:37:21]: Info: CLIENT CONNECTED
[2023:01:27:09:37:21]: Info: Found display [wayland-0]
[2023:01:27:09:37:21]: Info: Found interface: zxdg_output_manager_v1(30) version 3
[2023:01:27:09:37:21]: Info: Found interface: wl_output(45) version 4
[2023:01:27:09:37:21]: Info: Found interface: wl_output(46) version 4
[2023:01:27:09:37:21]: Info: Offset: 1920x0
[2023:01:27:09:37:21]: Info: Resolution: 1920x1080
[2023:01:27:09:37:21]: Info: Name: DP-2
[2023:01:27:09:37:21]: Info: Found monitor: Ancor Communications Inc ASUS VS228/FALMTF229400
[2023:01:27:09:37:21]: Info: Offset: 0x0
[2023:01:27:09:37:21]: Info: Resolution: 1920x1080
[2023:01:27:09:37:21]: Info: Name: HDMI-A-1
[2023:01:27:09:37:21]: Info: Found monitor: BNQ BenQ GL2460/V1F03876SL0
[2023:01:27:09:37:21]: Info: DP-2: Ancor Communications Inc ASUS VS228/FALMTF229400
[2023:01:27:09:37:21]: Info: HDMI-A-1: BNQ BenQ GL2460/V1F03876SL0
[2023:01:27:09:37:21]: Info: Screencasting with KMS
[2023:01:27:09:37:21]: Info: Found monitor for DRM screencasting
[2023:01:27:09:37:21]: Info: Color coding [Rec. 709]
[2023:01:27:09:37:21]: Info: Color range: [MPEG]
[2023:01:27:09:37:22]: Info: Setting default sink to: [sink-sunshine-stereo]
[2023:01:27:09:37:22]: Info: Found default monitor by name: sink-sunshine-stereo.monitor

[2023:01:13:11:39:24]: Error: GL: ~/Sunshine/src/platform/linux/graphics.cpp:529: [00000501]
exalented commented 1 year ago

This issue has been present since release 15.

himekifee commented 1 year ago

I don't know why but somehow these two lines fixed it for me. Could anybody test it? You can build it or grab the CI build.

zastrixarundell commented 1 year ago

I literally woke up at 4 am at this comment.

Well I'll be darned... it works!

Fedora Kinoite 37 (silverblue but with KDE) running the flatpak image built from the aformentioned CI build, RTX 2070 and running under 525.85.05 drivers.

Deytron commented 1 year ago

I can confirm that this works 100%, HEVC encoder, low latency and all. Still wondering how you managed to find these two lines 😁

himekifee commented 1 year ago

I first flooded drain_errors() to find which line of gl generated the error. It's the line underneath my change. Then I checked the gl document which occurrence can cause the 501 INVALID_VALUE error. One situation is the specified width is larger than the texture size, so it naturally comes to check the texture size using the function. Then it accidentally works. I jumped back and forth to check which exact line fixed it and this it was. However, I kinda wasted my time debugging as #649 already had a fix for wlgrab, I actually only need to import the change to kmsgrab.

LizardByte-bot commented 1 year ago

This issue has been fixed and will be available in the next release.