LizardByte / Sunshine

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

Can't stream a headless monitor created with Hyprland #2955

Open Kofa1 opened 3 months ago

Kofa1 commented 3 months ago

Is there an existing issue for this?

Is your issue described in the documentation?

Is your issue present in the latest beta/pre-release?

I'm too lazy to test

Describe the Bug

Virtual outputs created with hyprctl output create headless don't seem to be recognized by Sunshine. Error: Unknown Monitor connector type [HEADLESS]: Please report this to the GitHub issue tracker\

Expected Behavior

No response

Additional Context

https://github.com/hyprwm/Hyprland/issues/6623#issue-2367348069

Host Operating System

Linux

Operating System Version

6.10.2-arch1-1, Hyprland window manager

Architecture

64 bit

Sunshine commit or version

Sunshine version: 0.23.1

Package

Linux - AUR (Third Party)

GPU Type

Nvidia

GPU Model

TU117

GPU Driver/Mesa Version

nvidia-open 555.58.02-10

Capture Method

None

Config

output_name = Headless output 2
resolutions = [
    352x240,
    480x360,
    858x480,
    1280x720,
    1920x1080,
    2560x1080,
    2560x1440,
    3440x1440,
    1920x1200,
    3840x2160,
    3840x1600,
    1920x1200
]

Apps

No response

Relevant log output

[resolutions] -- [[
    352x240,
    480x360,
    858x480,
    1280x720,
    1920x1080,
    2560x1080,
    2560x1440,
    3440x1440,
    1920x1200,
    3840x2160,
    3840x1600,
    1920x1200
]]
[output_name] -- [Headless output 2]
[2024:08:03:23:29:21]: Info: Sunshine version: 0.23.1
[2024:08:03:23:29:21]: Info: Found display [wayland-1]
[2024:08:03:23:29:21]: Info: Found interface: zxdg_output_manager_v1(9) version 3
[2024:08:03:23:29:21]: Info: Found interface: wl_output(47) version 4
[2024:08:03:23:29:21]: Info: Found interface: wl_output(48) version 4
[2024:08:03:23:29:21]: Info: Found interface: wl_output(49) version 4
[2024:08:03:23:29:21]: Info: Found interface: wl_output(50) version 4
[2024:08:03:23:29:21]: Warning: Missing Wayland wire for wlr-export-dmabuf
[2024:08:03:23:29:21]: Info: /dev/dri/card0 -> nvidia-drm
[2024:08:03:23:29:21]: Info: /dev/dri/card1 -> amdgpu
[2024:08:03:23:29:21]: Info: Found display [wayland-1]
[2024:08:03:23:29:21]: Info: Found display [wayland-1]
[2024:08:03:23:29:21]: Info: Found interface: zxdg_output_manager_v1(9) version 3
[2024:08:03:23:29:21]: Info: Found interface: wl_output(47) version 4
[2024:08:03:23:29:21]: Info: Found interface: wl_output(48) version 4
[2024:08:03:23:29:21]: Info: Found interface: wl_output(49) version 4
[2024:08:03:23:29:21]: Info: Found interface: wl_output(50) version 4
[2024:08:03:23:29:21]: Info: Resolution: 1920x1080
[2024:08:03:23:29:21]: Info: Resolution: 1280x1024
[2024:08:03:23:29:21]: Info: Resolution: 1920x1200
[2024:08:03:23:29:21]: Info: Resolution: 1280x1024
[2024:08:03:23:29:21]: Info: Name: eDP-1
[2024:08:03:23:29:21]: Info: Found monitor: LG Display 0x05E5 (eDP-1)
[2024:08:03:23:29:21]: Info: Offset: 2560x1024
[2024:08:03:23:29:21]: Info: Logical size: 1536x864
[2024:08:03:23:29:21]: Info: Name: HDMI-A-1
[2024:08:03:23:29:21]: Info: Found monitor: BNQ BenQ FP93GS 0x00003760 (HDMI-A-1)
[2024:08:03:23:29:21]: Info: Offset: 1280x0
[2024:08:03:23:29:21]: Info: Logical size: 1280x1024
[2024:08:03:23:29:21]: Info: Name: HEADLESS-2
[2024:08:03:23:29:21]: Info: Found monitor: Headless output 2
[2024:08:03:23:29:21]: Info: Offset: 2560x256
[2024:08:03:23:29:21]: Info: Logical size: 1536x960
[2024:08:03:23:29:21]: Info: Name: HEADLESS-3
[2024:08:03:23:29:21]: Info: Found monitor: Headless output 3
[2024:08:03:23:29:21]: Info: Offset: 3789x0
[2024:08:03:23:29:21]: Info: Logical size: 1280x1024
[2024:08:03:23:29:21]: Info: -------- Start of KMS monitor list --------
[2024:08:03:23:29:21]: Info: Monitor 1 is eDP-1: LG Display 0x05E5 (eDP-1)
[2024:08:03:23:29:21]: Info: Monitor 0 is HDMI-A-1: BNQ BenQ FP93GS 0x00003760 (HDMI-A-1)
[2024:08:03:23:29:21]: Error: Unknown Monitor connector type [HEADLESS]: Please report this to the GitHub issue tracker
[2024:08:03:23:29:21]: Error: Unknown Monitor connector type [HEADLESS]: Please report this to the GitHub issue tracker
[2024:08:03:23:29:21]: Info: --------- End of KMS monitor list ---------
[2024:08:03:23:29:21]: Info: // Testing for available encoders, this may generate errors. You can safely ignore those errors. //
[2024:08:03:23:29:21]: Info: Trying encoder [nvenc]
[2024:08:03:23:29:21]: Info: Screencasting with KMS
[2024:08:03:23:29:21]: Info: /dev/dri/card0 -> nvidia-drm
[2024:08:03:23:29:21]: Info: /dev/dri/card1 -> amdgpu
[2024:08:03:23:29:21]: Error: Couldn't find monitor [-393538374]
[2024:08:03:23:29:21]: Info: /dev/dri/card0 -> nvidia-drm
[2024:08:03:23:29:21]: Info: /dev/dri/card1 -> amdgpu
[2024:08:03:23:29:21]: Error: Couldn't find monitor [-393538374]
[2024:08:03:23:29:21]: Info: System tray created
[2024:08:03:23:29:21]: Info: Screencasting with KMS
[2024:08:03:23:29:21]: Info: /dev/dri/card0 -> nvidia-drm
[2024:08:03:23:29:21]: Info: /dev/dri/card1 -> amdgpu
[2024:08:03:23:29:21]: Error: Couldn't find monitor [-393538374]
[2024:08:03:23:29:21]: Info: /dev/dri/card0 -> nvidia-drm
[2024:08:03:23:29:21]: Info: /dev/dri/card1 -> amdgpu
[2024:08:03:23:29:21]: Error: Couldn't find monitor [-393538374]
[2024:08:03:23:29:21]: Info: Encoder [nvenc] failed
[2024:08:03:23:29:21]: Info: Trying encoder [vaapi]
[2024:08:03:23:29:21]: Info: Screencasting with KMS
[2024:08:03:23:29:21]: Info: /dev/dri/card0 -> nvidia-drm
[2024:08:03:23:29:21]: Info: /dev/dri/card1 -> amdgpu
[2024:08:03:23:29:21]: Error: Couldn't find monitor [-393538374]
[2024:08:03:23:29:21]: Info: /dev/dri/card0 -> nvidia-drm
[2024:08:03:23:29:21]: Info: /dev/dri/card1 -> amdgpu
[2024:08:03:23:29:21]: Error: Couldn't find monitor [-393538374]
[2024:08:03:23:29:21]: Info: Screencasting with KMS
[2024:08:03:23:29:21]: Info: /dev/dri/card0 -> nvidia-drm
[2024:08:03:23:29:21]: Info: /dev/dri/card1 -> amdgpu
[2024:08:03:23:29:21]: Error: Couldn't find monitor [-393538374]
[2024:08:03:23:29:21]: Info: /dev/dri/card0 -> nvidia-drm
[2024:08:03:23:29:21]: Info: /dev/dri/card1 -> amdgpu
[2024:08:03:23:29:21]: Error: Couldn't find monitor [-393538374]
[2024:08:03:23:29:21]: Info: Encoder [vaapi] failed
[2024:08:03:23:29:21]: Info: Trying encoder [software]
[2024:08:03:23:29:21]: Info: Screencasting with KMS
[2024:08:03:23:29:21]: Info: /dev/dri/card0 -> nvidia-drm
[2024:08:03:23:29:21]: Info: /dev/dri/card1 -> amdgpu
[2024:08:03:23:29:21]: Error: Couldn't find monitor [-393538374]
[2024:08:03:23:29:22]: Info: Screencasting with KMS
[2024:08:03:23:29:22]: Info: /dev/dri/card0 -> nvidia-drm
[2024:08:03:23:29:22]: Info: /dev/dri/card1 -> amdgpu
[2024:08:03:23:29:22]: Error: Couldn't find monitor [-393538374]
[2024:08:03:23:29:22]: Info: Encoder [software] failed
[2024:08:03:23:29:22]: Fatal: Unable to find display or encoder during startup.
[2024:08:03:23:29:22]: Fatal: Please ensure your manually chosen GPU and monitor are connected and powered on.
[2024:08:03:23:29:22]: Error: Video failed to find working encoder
[2024:08:03:23:29:22]: Error: Failed to create client: Daemon not running
[2024:08:03:23:29:22]: Info: Configuration UI available at [https://localhost:47990]
egrechko commented 3 months ago

I am getting the exact same issue as well.

d-air1 commented 3 months ago

I'm not a hyprland user, but I just found out about this protocol finally being merged in wayland. It is based on wlroots wlr-screencopy-unstable-v1, but with improvements.

Link to phoronix article here: https://www.phoronix.com/news/Wayland-Merges-Screen-Capture Link to merge request: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/124

In the link that OP provided, the hyprland project seems to recommend that wlr_screencopy_v1 be used instead of wlr_export_dmabuf. Whereas If I'm understanding this correctly, this new protocol having being merged in upstream wayland protocols might be a bit more generic and useful for all desktop environments instead of just wlroots based ones. Assuming the rest of the desktops implement this. According to the merge request, wlroots already has. Perhaps this thread should be moved to a discussion for the time being?

Kofa1 commented 3 months ago

I'm not a hyprland user, but I just found out about this protocol finally being merged in wayland. It is based on wlroots wlr-screencopy-unstable-v1, but with improvements.

Link to phoronix article here: https://www.phoronix.com/news/Wayland-Merges-Screen-Capture Link to merge request: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/124

In the link that OP provided, the hyprland project seems to recommend that wlr_screencopy_v1 be used instead of wlr_export_dmabuf. Whereas If I'm understanding this correctly, this new protocol having being merged in upstream wayland protocols might be a bit more generic and useful for all desktop environments instead of just wlroots based ones. Assuming the rest of the desktops implement this. According to the merge request, wlroots already has. Perhaps this thread should be moved to a discussion for the time being?

Aren't they saying it's a Sunshine issue, which uses outdated protocols? Sorry, I'm not a Wayland dev I have no idea what they're responsible for, just trying to use Linux.

https://github.com/hyprwm/Hyprland/issues/6623#issuecomment-2185228948

https://github.com/hyprwm/Hyprland/issues/6623#issuecomment-2192660921

d-air1 commented 3 months ago

@Kofa1 that is what they are saying, but his suggestion has also become outdated.

aruhier commented 3 months ago

@Kofa1 that is what they are saying, but his suggestion has also become outdated.

Kind of, as I don't think sway or hyprland support ext-image-capture-source-v1 already. I guess that wlr_screencopy_v1 will become deprecated in favor ext-image-capture-source-v1 at one point.

Kofa1 commented 2 months ago

@Kofa1 that is what they are saying, but his suggestion has also become outdated.

Kind of, as I don't think sway or hyprland support ext-image-capture-source-v1 already. I guess that wlr_screencopy_v1 will become deprecated in favor ext-image-capture-source-v1 at one point.

I don't really understand, is it going to magically recognise the monitors once that protocol is updated in Hyprland?

aruhier commented 2 months ago

Nothing is magical, Sunshine needs to explicitly implement the client side of these protocols (wlr_screencopy_v1 to support the current releases of Hyprland and Sway, ext-image-capture-source-v1 for the standard protocol that is not yet implemented in Hyprland or Sway).

Hyprland and Sway for the moment only supports wlr_screen_copy_v1, I think ext-image-capture-source-v1 is being merged in wlroots. So if Sunshine switches to wlr_screen_copy_v1 instead of wlr_export_dmabuf, yes the monitors will be recognized directly on Hyprland and Sway. In the future, wlr_screen_copy_v1 might be deprecated for ext-image-capture-source-v1, which supports window/zone capture (and not only screen capture).

korm-spec commented 2 months ago

Is this gonna be fixed anytime soon? It's been a month and the problem exists for 5 months already.

gschintgen commented 1 month ago

Is this gonna be fixed anytime soon? It's been a month and the problem exists for 5 months already.

Could you link to your PR that fixes it? More seriously: This is a volunteer project. Things happen if somebody comes along and implements it. (This could be you!)

Pressuring is only counterproductive. It leads to developers getting grumpy, ignoring the issue or burning out.

Your choices are to be patient, to fix it yourself, or to hire somebody to do it.

Please be considerate. (Giving a thumbs up to the original report is fine and shows interest. Comments are for useful additional information.)

ElYaiko commented 2 weeks ago

Having same issue Any update?