LizardByte / LizardByte/Sunshine

GL Error when trying to stream virtual monitor

Open
#2,044 28 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
41.3k
Forks
2.1k
Avg merge
23h 47m
Merged PRs (30d)
124

Description

### Is there an existing issue for this?

- [X] I have searched the existing issues

### Is your issue described in the documentation?

- [X] I have read the documentation

### Is your issue present in the nightly release?

- [X] This issue is present in the nightly release

### Describe the Bug

Hello
I'm creating a second virtual monitor with vkms and trying to stream it with sunshine.
But when Moonlight client connects you see a black screen and one error line is spammed in the logs.
[2024:01:20:14:04:07]: Error: GL: /run/build/sunshine/src/platform/linux/graphics.cpp:562: [00000505]

### Expected Behavior

Working stream displaying a virtual monitor.

### Additional Context

I'm using latest nightly to incorporate latest fix without which the virtual monitor wasn't even detected properly.
https://github.com/LizardByte/Sunshine/pull/2030
I'm on wayland.

Side question: The Capture Method (Linux Only) fields lists PipeWire as a capture method but I don't see any mention of it in the docs. Does sunshine have or has plans on supporting pipewire capture? I think that could be useful and a nice way to get another capture method on wayland.

### Host Operating System

Linux

### Operating System Version

Nobara Linux 39 (fedora fork)

### Architecture

64 bit

### Sunshine commit or version

a10ec3a98ac6a3f5618dc53469f3c5b48dab36ee (Latest nightly as of now)

### Package

Linux - flatpak

### GPU Type

AMD

### GPU Model

AMD Radeon RX 5600 XT

### GPU Driver/Mesa Version

Mesa 23.3.3

### Capture Method (Linux Only)

KMS

### Config

```Shell
sunshine_name = Szczurek PC
```

### Apps

```json
N\A
```

### Relevant log output

```shell
[2024:01:20:14:04:07]: Info: // Ignore any errors mentioned above, they are not relevant. //
[2024:01:20:14:04:07]: Info:
[2024:01:20:14:04:07]: Info: Found H.264 encoder: h264_vaapi [vaapi]
[2024:01:20:14:04:07]: Info: Found HEVC encoder: hevc_vaapi [vaapi]
[2024:01:20:14:04:07]: Info: Executing [Desktop]
[2024:01:20:14:04:07]: Info: CLIENT CONNECTED
[2024:01:20:14:04:07]: Warning: No render device name for: /dev/dri/card0
[2024:01:20:14:04:07]: Info: Screencasting with KMS
[2024:01:20:14:04:07]: Warning: No render device name for: /dev/dri/card0
[2024:01:20:14:04:07]: Info: Found monitor for DRM screencasting
[2024:01:20:14:04:07]: Info: Found connector ID [38]
[2024:01:20:14:04:07]: Info: Found cursor plane [34]
libva info: VA-API version 1.18.0
Xlib: extension "DRI2" missing on display ":0".
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/vkms_drv_video.so
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/intel-vaapi-driver/vkms_drv_video.so
libva info: Trying to open /usr/lib/x86_64-linux-gnu/GL/lib/dri/vkms_drv_video.so
libva info: va_openDriver() returns -1
[2024:01:20:14:04:07]: Error: Couldn't initialize va display: unknown libva error
[2024:01:20:14:04:07]: Warning: Monitor 1 doesn't support hardware encoding. Reverting back to GPU -> RAM -> GPU
[2024:01:20:14:04:07]: Warning: No render device name for: /dev/dri/card0
[2024:01:20:14:04:07]: Info: Found monitor for DRM screencasting
[2024:01:20:14:04:07]: Info: Found connector ID [38]
[2024:01:20:14:04:07]: Info: Found cursor plane [34]
MESA-LOADER: failed to open vkms: /usr/lib/x86_64-linux-gnu/GL/default/lib/dri/vkms_dri.so: nie można otworzyć pliku obiektu dzielonego: Nie ma takiego pliku ani katalogu (search paths /usr/lib/x86_64-linux-gnu/GL/default/lib/dri, suffix _dri)
[2024:01:20:14:04:07]: Info: SDR color coding [Rec. 709]
[2024:01:20:14:04:07]: Info: Color depth: 8-bit
[2024:01:20:14:04:07]: Info: Color range: [MPEG]
[2024:01:20:14:04:07]: Error: GL: /run/build/sunshine/src/platform/linux/graphics.cpp:562: [00000505]
libva info: VA-API version 1.18.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/radeonsi_drv_video.so
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/intel-vaapi-driver/radeonsi_drv_video.so
libva info: Trying to open /usr/lib/x86_64-linux-gnu/GL/lib/dri/radeonsi_drv_video.so
libva info: Found init function __vaDriverInit_1_18
libva info: va_openDriver() returns 0
[2024:01:20:14:04:07]: Error: [hevc_vaapi @ 0x7faffc227100] No usable encoding entrypoint found for profile VAProfileHEVCMain (17).
[2024:01:20:14:04:07]: Info: Retrying with fallback configuration options for [hevc_vaapi] after error: Nie zaimplementowana funkcja
[2024:01:20:14:04:07]: Error: GL: /run/build/sunshine/src/platform/linux/graphics.cpp:562: [00000505]
libva info: VA-API version 1.18.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/radeonsi_drv_video.so
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/intel-vaapi-driver/radeonsi_drv_video.so
libva info: Trying to open /usr/lib/x86_64-linux-gnu/GL/lib/dri/radeonsi_drv_video.so
libva info: Found init function __vaDriverInit_1_18
libva info: va_openDriver() returns 0
[2024:01:20:14:04:07]: Warning: [hevc_vaapi @ 0x7faffcd63780] Driver does not support some wanted packed headers (wanted 0xd, found 0x1).
[2024:01:20:14:04:07]: Error: GL: /run/build/sunshine/src/platform/linux/graphics.cpp:562: [00000505]
[2024:01:20:14:04:07]: Error: GL: /run/build/sunshine/src/platform/linux/graphics.cpp:562: [00000505]
[2024:01:20:14:04:07]: Error: GL: /run/build/sunshine/src/platform/linux/graphics.cpp:562: [00000505]
[2024:01:20:14:04:07]: Error: GL: /run/build/sunshine/src/platform/linux/graphics.cpp:562: [00000505]
[2024:01:20:14:04:07]: Error: GL: /run/build/sunshine/src/platform/linux/graphics.cpp:562: [00000505]
[2024:01:20:14:04:07]: Error: GL: /run/build/sunshine/src/platform/linux/graphics.cpp:562: [00000505]
[2024:01:20:14:04:07]: Error: GL: /run/build/sunshine/src/platform/linux/graphics.cpp:562: [00000505]
[2024:01:20:14:04:07]: Error: GL: /run/build/sunshine/src/platform/linux/graphics.cpp:562: [00000505]
[2024:01:20:14:04:07]: Error: GL: /run/build/sunshine/src/platform/linux/graphics.cpp:562: [00000505]
[2024:01:20:14:04:08]: Error: GL: /run/build/sunshine/src/platform/linux/graphics.cpp:562: [00000505]
```

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/platform/linux/graphics.cpp around line 562 and trace the KMS virtual-monitor path shown in the logs. Compare the behavior introduced or fixed by pull request #2030, then reproduce with vkms and the reported AMD/Mesa setup. Done means the virtual monitor streams a visible image without the repeated GL error.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, linux
Domain
computer-graphics, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.