Virtual display support on Linux: stream at on-demand resolutions/refresh rates without a dummy dongle #1024
Unanswered
EnriqueWood
asked this question in
Sunshine
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Select Topic Area
Question
Body
TLDR; Have near-on demand virtual display with custom client resolution and frequencies. I'm already providing a working POC implementation (not built into sunshine, but using shell scripts to give an idea of how it could work)
Hi, and thanks for the recent capture work. The KWin / PipeWire / XDG-portal
capture that landed in the last release made streaming on KDE Wayland genuinely
nice on my machine, and honestly it's what made me think the thing I'm about to
ask for is now within reach.
What I'd really love to see is virtual display support on Linux, so people
don't have to keep a drawer of USB/DP dummy dongles around just to stream at a
resolution or refresh rate that differs from their physical monitor. As best I
understand it, it splits into a few pieces:
new backends Sunshine can already grab a Wayland output cleanly, the missing
half is having an output to grab that isn't your real screen. Today that
means a hardware dummy (stuck with whatever modes the dongle's EDID
advertises) or manual kernel/EDID tinkering.
The goal is to stream at whatever the client asks for, or from a list I
configure, without buying a dongle per resolution. Windows already has the
dd_*display-config options for this; on Linux there's no equivalent and weend up hand-rolling
global_prep_cmdscripts.restore the real monitor on disconnect. This one is already mostly possible
today with
global_prep_cmd, so it's the least important, but having itbuilt in would make the whole thing turnkey.
Why I think it's worth doing: it removes the dongle requirement entirely, it
builds directly on the capture work you just shipped, and it lets the host match
the client's display exactly (better quality and latency than scaling a fixed
resolution). It also covers the "use my PC normally while someone streams to it"
and headless cases, and it'd bring the Linux experience closer to what Windows
users already get.
sadly, I'm not a graphics or kernel developer, which is why this
is a feature request and not a PR. But I didn't want to just drop an idea and
walk away, so I put together a working proof of concept (with a lot of help from
an AI assistant, since the low-level parts are beyond me) to show it's doable and
to save whoever picks this up some of the digging. It's been running well for me:
lizardbyte/stableCopron a spare DisplayPort connector
POC + notes: https://github.com/EnriqueWood/sunshine-virtual-displays-support-poc
How it works, briefly, in case it's useful:
cmdline
video=<conn>:e drm.edid_firmware=<conn>:edid/<file>.bin. One gotchaworth flagging: on the NVIDIA proprietary driver
drm.edid_firmwarealone issilently ignored, you need
video=:eas well. With both, you get a fullyvirtual output, no dongle and no HBR bandwidth cap.
client resolutions like my phone's 2448x1080) so clients get an exact match.
global_prep_cmdsets the virtual output to the client'srequested mode (or the closest one), makes it the only active display so games
and Steam open there, and holds a screensaver/DPMS inhibitor so capture doesn't
die when the host is idle. On disconnect it restores the real monitor.
is regenerated automatically.
And the limitations... where the POC hits a wall, and where an in-tree
solution could do better than my hack:
newly-added mode only appears after a reboot. A real virtual DRM device (along
the lines of the kernel's VKMS, or a compositor-provided virtual output) could
change modes live and would be the much cleaner long-term answer, that's
really the feature I'm hoping for; the EDID approach is just what I could get
working today.
only does that over a real HDMI 2.1 link with SCDC), so HDR streaming still
needs a real display.
I'm glad to test patches, share the full scripts / EDID generator / notes, or
provide logs from my setup, whatever helps. Mostly I'd just love to see this
become a proper feature so the next person doesn't need a pile of dummy plugs.
Thanks for considering it, and for Sunshine in general.
Beta Was this translation helpful? Give feedback.
All reactions