mirror of
https://github.com/Arbitrate3280/LutrisToSunshine.git
synced 2026-11-03 22:30:00 +00:00
[GH-ISSUE #20] [Bug]: Black screen with virtual display #17
Labels
No labels
bug
bug
enhancement
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Arbitrate3280/LutrisToSunshine#17
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Seuma on GitHub (Apr 30, 2026).
Original GitHub issue: https://github.com/Arbitrate3280/LutrisToSunshine/issues/20
Describe the bug
If I want to start a game or, for example, Steam Big Picture mode, the screen keeps being black.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I would assume that the game/steam big picture mode will start and also be displayed in Moonlight using the Virtual Display rendered in the clients Moonlight resolution and framerate
Environment
Checklist
python3 lutristosunshine.py display statusor used2. Show full status.Full status output
Paste the complete output from
python3 lutristosunshine.py display statusor menu option2. Show full status.Sunshine logs
Paste relevant Sunshine logs here.
Edit:
Additional Information:
If I start Steam from Moonlight in Big Picture Mode I can hear the big picture mode being started from my client. As for Games I do not get any output.
@Seuma commented on GitHub (Apr 30, 2026):
Also tested with official Sunshine stable (lizardbyte/sunshine 2025.924.154138-3) and sunshine-git (lizardbyte-beta/sunshine-git)
lizardbyte-beta/sunshine-git has the same issue with the black screen.
lizardbyte/sunshine 2025.924.154138-3 does not have a complete black screen instead it renders some line artifacts:
While being connected to sunshine (lizardbyte/sunshine 2025.924.154138-3) I get the following logs in sunshine:
[2026-04-30 19:40:50.270]: Info: Found H.264 encoder: h264_vaapi [vaapi]
[2026-04-30 19:40:50.270]: Info: Found HEVC encoder: hevc_vaapi [vaapi]
[2026-04-30 19:40:50.270]: Info: Found AV1 encoder: av1_vaapi [vaapi]
[2026-04-30 19:40:50.270]: Info: Executing Do Cmd: [/home/seuma/.config/lutristosunshine/bin/lutristosunshine-set-resolution.sh]
[2026-04-30 19:40:50.283]: Info: Executing: [/home/seuma/.config/lutristosunshine/bin/lutristosunshine-launch-app.sh cmd 5 aGVyb2ljIGhlcm9pYzovL2xhdW5jaC9nb2cvMjEwNjk0MjAzMCAtLW5vLWd1aSAtLW5vLXNhbmRib3g=] in ["/home/seuma/.config/lutristosunshine/bin"]
[2026-04-30 19:40:50.329]: Info: New streaming session started [active sessions: 1]
[2026-04-30 19:40:50.350]: Info: CLIENT CONNECTED
[2026-04-30 19:40:50.352]: Info: Found display [wayland-1]
[2026-04-30 19:40:50.352]: Info: Found interface: zwp_linux_dmabuf_v1(2) version 4
[2026-04-30 19:40:50.352]: Info: Found interface: zxdg_output_manager_v1(8) version 3
[2026-04-30 19:40:50.352]: Info: Found interface: zwlr_screencopy_manager_v1(28) version 3
[2026-04-30 19:40:50.352]: Info: Found interface: wl_output(53) version 4
[2026-04-30 19:40:50.352]: Info: Resolution: 1920x1080
[2026-04-30 19:40:50.352]: Info: Name: HEADLESS-1
[2026-04-30 19:40:50.352]: Info: Found monitor: Headless output 1
[2026-04-30 19:40:50.352]: Info: Offset: 0x0
[2026-04-30 19:40:50.352]: Info: Logical size: 1920x1080
[2026-04-30 19:40:50.352]: Info: -------- Start of Wayland monitor list --------
[2026-04-30 19:40:50.352]: Info: Monitor 0 is HEADLESS-1: Headless output 1
[2026-04-30 19:40:50.352]: Info: --------- End of Wayland monitor list ---------
[2026-04-30 19:40:50.352]: Info: Screencasting with Wayland's protocol
[2026-04-30 19:40:50.352]: Info: Found display [wayland-1]
[2026-04-30 19:40:50.352]: Info: Found interface: zwp_linux_dmabuf_v1(2) version 4
[2026-04-30 19:40:50.352]: Info: Found interface: zxdg_output_manager_v1(8) version 3
[2026-04-30 19:40:50.352]: Info: Found interface: zwlr_screencopy_manager_v1(28) version 3
[2026-04-30 19:40:50.352]: Info: Found interface: wl_output(53) version 4
[2026-04-30 19:40:50.352]: Info: Resolution: 1920x1080
[2026-04-30 19:40:50.352]: Info: Name: HEADLESS-1
[2026-04-30 19:40:50.352]: Info: Found monitor: Headless output 1
[2026-04-30 19:40:50.352]: Info: Offset: 0x0
[2026-04-30 19:40:50.352]: Info: Logical size: 1920x1080
[2026-04-30 19:40:50.352]: Info: Selected monitor [Headless output 1] for streaming
[2026-04-30 19:40:50.352]: Info: Creating encoder [hevc_vaapi]
[2026-04-30 19:40:50.352]: Info: Color coding: SDR (Rec. 601)
[2026-04-30 19:40:50.352]: Info: Color depth: 8-bit
[2026-04-30 19:40:50.352]: Info: Color range: MPEG
[2026-04-30 19:40:50.362]: Info: vaapi vendor: Mesa Gallium driver 26.0.5-arch2.4 for AMD Radeon RX 7900 XTX (radeonsi, navi31, ACO, DRM 3.64, 7.0.2-2-cachyos)
[2026-04-30 19:40:50.362]: Info: Streaming bitrate is 14988000
[2026-04-30 19:40:50.362]: Info: Using normal encoding mode
[2026-04-30 19:40:50.362]: Info: Using default rate control
[2026-04-30 19:40:50.368]: Info: Minimum FPS target set to ~30fps (33.3333ms)
[2026-04-30 19:40:50.821]: Info: Setting default sink to: [sink-sunshine-stereo]
[2026-04-30 19:40:50.822]: Info: Found default monitor by name: lts-sunshine-stereo.monitor
[2026-04-30 19:40:50.837]: Info: Opus initialized: 48 kHz, 2 channels, 512 kbps (total), LOWDELAY
And the status of the virtual display looks like that:
Virtual display
Status: setup=configured, Sunshine=active, Sway=active
Runtime: input bridge=inactive, audio guard=active, portal handoff=active
Host session: KDE / plasma
Input isolation: kwin-runtime-disable - disabled 5 of 5 Sunshine device(s) in KWin
Dynamic MangoHud FPS limit: [DISABLED] wrapped launches keep their normal MangoHud FPS behavior
MangoHud env value: not active
Refresh rate sync mode: follow Moonlight requested FPS
Dependencies: [OK] all required commands available
Headless display: wayland-1
Current headless mode: 1920x1080 @ 60 Hz
Host controllers: [AUTO] none reserved; client inputs from Moonlight/Sunshine already work automatically
Blocked Flatpak apps: [OK] none detected
Next step: Virtual display is ready. Use 'controllers', 'rumble', or 'logs' for follow-up actions.
@Seuma commented on GitHub (Apr 30, 2026):
I think I found the issue. I have 2 GPUs. 1 eGPU (RX 7900 XTX) and one iGPU from my CPU. The Problem: I have monitors connected to the eGPU. While Sunshine tries to access the eGPU it gets a black screen.
After I changed the Adapter Name from none to /dev/dri/renderD129 (my iGPU) and started Steam Big Picture Mode it displayed everything.
Need to test with /dev/dri/renderD128 (my eGPU)
My question:
Does it not work if monitors are connected to the eGPU while also trying to run Sunshine with Virtual Monitors through eGPU?
@Arbitrate3280 commented on GitHub (May 4, 2026):
Hi! Not a clue. I don't have a setup like that or access to a setup like that, so I can say that I didn't take that into account.
I'm super busy with college right now so I can't troubleshoot this at the moment, but PR's are welcome to make setups like yours work better.
@joeknock90 commented on GitHub (May 7, 2026):
I took a stab at vibe coding a fix for this. It's not super elegant but it's working for me. Explanation is in the pull request.
I never thought... in a million years, I'd be vibe coding.
EDIT:
Nevermind, more testing to do.
@joeknock90 commented on GitHub (May 10, 2026):
I'm continuing work on this from scratch this time, and probably with less LLM help.
In my case, I was able to stream properly if i set sunsihne to use the iGPU for hardware acceleration. I got the same garbled output if I set sunshine to use my 9070XT.
Sway attempts to automatically configure the the render gpu. If it detects 2 GPUs, it chooses one to render, and then copies the buffer over to the other.
This is what I think is happening in this case. I think sway is choosing the iGPU as primary, and attempting to copy the buffer over to the dGPU. To test this, I went into my BIOS and disabled the iGPU. As suspected, recreating the virtual display and streaming worked perfectly fine on the dGPU. (In my case it's really easy to tell as the iGPU doesn't support AV1 and the dGPU does.)
Below is sway's documentation on how to force the render GPU, and potentially where the buffer gets copied to. It seems that it might make sense to use
/dev/dri/by-pathfor consistency in this case, or potentially setting up the below udev rule. I'm leaning toward the udev rule method as sometimes during BIOS updates or other hardware changes, PCIe devices paths can change.https://github.com/swaywm/sway/wiki#i-have-a-multi-gpu-setup-like-intelnvidia-or-intelamd-and-sway-does-not-start--some-video-cards-cannot-display--full-screen-images-etc-will-be-corrupted
Just thought I put an update here.
@Seuma commented on GitHub (May 11, 2026):
Nice work. I thought it would use the iGPU because KDE/Plasma would block the eGPU as it is connected to a display.
Otherwise I made some changes to the manager so it doesn't override the sway.conf and passes the XDG_DATA_DIRS variable to the sway session. Since I dont always connect to sunshine for gaming reasons I needed a way to access my apps and have some sort of keybinding for Terminal, opening and closing apps etc. Maybe I could see to have it detect the iGPU and dGPU and always setting the WLR_DRM_DEVICES env for the start command for sway since it always recreates the scripslts on startup a bios update etc. wouldn't affect it.
@joeknock90 commented on GitHub (May 11, 2026):
Thanks, but I'm becoming a little less confident in my theory.
I've re-enabled my iGPU for testing.
In theory, adding the line
WLR_DRM_DEVICES=/dev/dir/by-path/pci-0000:03:00.0-card(dgpu in my case) to the line starting/usr/bin/env -iin~/.config/lutristosunshine/bin/lutristosunshine-start-headless-sway.shand restarting the sunshine service should be enough to test this, but I can't seem to get it to work and get garbled output.I'm continuing to investigate this.
@Seuma commented on GitHub (May 11, 2026):
Yeh that didn't work for me either.
Edit:
It doesn't replace the scripts if you only restart the virtual display.
Also Tried to do the same and it didn't work. I will look more into sway.
@Seuma commented on GitHub (May 11, 2026):
I found the Problem. It seems you have to set two environment variables. The first is
WLR_DRM_DEVICESand the second one isWLR_RENDER_DRM_DEVICEif both are set to the eGPU sunshine is able to stream from exactly that GPU and with that is able to use AV1 encoding if the eGPU supports that.Now I need to find a way to automatically get the correct path dynamically. I think it would be good if the
.shscript would do that but I'm not really sure about that.@Seuma commented on GitHub (May 11, 2026):
The script seems to work for multi-gpu. I just need to adjust the case if only the iGPU is available.
@joeknock90 commented on GitHub (May 12, 2026):
Awesome work! Guess I was on the right track but I never saw anything about
WLR_RENDER_DRM_DEVICEGlad you figured it out!
@Seuma commented on GitHub (May 20, 2026):
Closed as #23 is merged.
@Arbitrate3280 commented on GitHub (May 24, 2026):
Thanks for the work and investigation! Based on your work I've added on the cli menu a new option "Configure display GPU". Which theoretically should set the envs to the chosen gpu. Can you let me know if it works for you guys?
@Seuma commented on GitHub (May 27, 2026):
Thank you so much! That is way cleaner than what I did. Very much appreciated.
Edit: I will test it today
@Seuma commented on GitHub (May 27, 2026):
Works perfectly! Thank you so much