Sunshine icon indicating copy to clipboard operation
Sunshine copied to clipboard

Using Do/Undo Command makes connection impossible

Open fayeinmay opened this issue 5 months ago • 9 comments

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 latest beta/pre-release?

This issue is present in the latest pre-release

Describe the Bug

When using the Do/Undo commands which are described in the docs, no connection is possible anymore. Do Note: These commands work just fine outside sunshine and also worked in previous sunshine versions, though I don't exactly know when it broke.

I'm using: sh -c "kscreen-doctor output.DP-1.mode.${SUNSHINE_CLIENT_WIDTH}x${SUNSHINE_CLIENT_HEIGHT}@${SUNSHINE_CLIENT_FPS} && kscreen-doctor output.DP-2.disable" and Undo kscreen-doctor output.DP-1.mode.2560x1440@144 && kscreen-doctor output.DP-2.enable

Results in

"[2025-11-29 23:04:33.089]: Error: Property tree is empty. Probably, control flow got interrupted by an unexpected C++ exception. This is a bug in Sunshine. Moonlight-qt will report Malformed XML (missing root element)."

Expected Behavior

No response

Additional Context

No response

Host Operating System

Linux

Operating System Version

Bazzite Latest (Fedora 43)

Architecture

amd64/x86_64

Sunshine commit or version

Version 2025.1127.34355

Package

Linux - Fedora Copr

GPU Type

AMD

GPU Model

9070 XT

GPU Driver/Mesa Version

25.3.0

Capture Method

None

Config


Apps


Relevant log output

[2025-11-29 23:09:07.609]: Info: // Testing for available encoders, this may generate errors. You can safely ignore those errors. //
[2025-11-29 23:09:07.609]: Info: Trying encoder [nvenc]
[2025-11-29 23:09:07.609]: Info: Screencasting with KMS
[2025-11-29 23:09:07.609]: Info: /dev/dri/card0 -> amdgpu
[2025-11-29 23:09:07.609]: Error: Couldn't find monitor [0]
[2025-11-29 23:09:07.609]: Info: /dev/dri/card0 -> amdgpu
[2025-11-29 23:09:07.610]: Error: Couldn't find monitor [0]
[2025-11-29 23:09:07.810]: Info: Screencasting with KMS
[2025-11-29 23:09:07.810]: Info: /dev/dri/card0 -> amdgpu
[2025-11-29 23:09:07.810]: Error: Couldn't find monitor [0]
[2025-11-29 23:09:07.810]: Info: /dev/dri/card0 -> amdgpu
[2025-11-29 23:09:07.811]: Error: Couldn't find monitor [0]
[2025-11-29 23:09:08.011]: Info: Encoder [nvenc] failed
[2025-11-29 23:09:08.011]: Info: Trying encoder [vaapi]
[2025-11-29 23:09:08.011]: Info: Screencasting with KMS
[2025-11-29 23:09:08.011]: Info: /dev/dri/card0 -> amdgpu
[2025-11-29 23:09:08.011]: Info: Found monitor for DRM screencasting
[2025-11-29 23:09:08.011]: Info: Found connector ID [124]
[2025-11-29 23:09:08.012]: Info: Found cursor plane [101]
[2025-11-29 23:09:08.017]: Info: Creating encoder [h264_vaapi]
[2025-11-29 23:09:08.017]: Info: Color coding: SDR (Rec. 601)
[2025-11-29 23:09:08.017]: Info: Color depth: 8-bit
[2025-11-29 23:09:08.017]: Info: Color range: JPEG
[2025-11-29 23:09:08.028]: Info: vaapi vendor: Mesa Gallium driver 25.3.0 for AMD Radeon RX 9070 XT (radeonsi, gfx1201, LLVM 21.1.6, DRM 3.64, 6.17.7-ba19.fc43.x86_64)
[2025-11-29 23:09:08.028]: Info: Streaming bitrate is 1000000
[2025-11-29 23:09:08.028]: Info: Using normal encoding mode
[2025-11-29 23:09:08.028]: Info: Using default rate control
[2025-11-29 23:09:08.046]: Info: Creating encoder [hevc_vaapi]
[2025-11-29 23:09:08.046]: Info: Color coding: SDR (Rec. 601)
[2025-11-29 23:09:08.046]: Info: Color depth: 8-bit
[2025-11-29 23:09:08.046]: Info: Color range: JPEG
[2025-11-29 23:09:08.058]: Info: vaapi vendor: Mesa Gallium driver 25.3.0 for AMD Radeon RX 9070 XT (radeonsi, gfx1201, LLVM 21.1.6, DRM 3.64, 6.17.7-ba19.fc43.x86_64)
[2025-11-29 23:09:08.058]: Info: Streaming bitrate is 1000000
[2025-11-29 23:09:08.058]: Info: Using normal encoding mode
[2025-11-29 23:09:08.058]: Info: Using default rate control
[2025-11-29 23:09:08.078]: Info: Creating encoder [av1_vaapi]
[2025-11-29 23:09:08.078]: Info: Color coding: SDR (Rec. 601)
[2025-11-29 23:09:08.078]: Info: Color depth: 8-bit
[2025-11-29 23:09:08.078]: Info: Color range: JPEG
[2025-11-29 23:09:08.089]: Info: vaapi vendor: Mesa Gallium driver 25.3.0 for AMD Radeon RX 9070 XT (radeonsi, gfx1201, LLVM 21.1.6, DRM 3.64, 6.17.7-ba19.fc43.x86_64)
[2025-11-29 23:09:08.089]: Info: Streaming bitrate is 1000000
[2025-11-29 23:09:08.089]: Info: Using normal encoding mode
[2025-11-29 23:09:08.089]: Info: Using VBR with single frame VBV size
[2025-11-29 23:09:08.089]: Warning: [av1_vaapi @ 0x7f82a84196c0] Multiple slices were requested but this codec does not support controlling slices.
[2025-11-29 23:09:08.104]: Info: Screencasting with KMS
[2025-11-29 23:09:08.104]: Info: /dev/dri/card0 -> amdgpu
[2025-11-29 23:09:08.104]: Info: Found monitor for DRM screencasting
[2025-11-29 23:09:08.104]: Info: Found connector ID [124]
[2025-11-29 23:09:08.104]: Info: Found cursor plane [101]
[2025-11-29 23:09:08.110]: Info: Creating encoder [hevc_vaapi]
[2025-11-29 23:09:08.110]: Info: Color coding: SDR (Rec. 709)
[2025-11-29 23:09:08.110]: Info: Color depth: 10-bit
[2025-11-29 23:09:08.110]: Info: Color range: JPEG
[2025-11-29 23:09:08.120]: Info: vaapi vendor: Mesa Gallium driver 25.3.0 for AMD Radeon RX 9070 XT (radeonsi, gfx1201, LLVM 21.1.6, DRM 3.64, 6.17.7-ba19.fc43.x86_64)
[2025-11-29 23:09:08.121]: Info: Streaming bitrate is 1000000
[2025-11-29 23:09:08.121]: Info: Using normal encoding mode
[2025-11-29 23:09:08.121]: Info: Using default rate control
[2025-11-29 23:09:08.141]: Info: Creating encoder [av1_vaapi]
[2025-11-29 23:09:08.141]: Info: Color coding: SDR (Rec. 709)
[2025-11-29 23:09:08.141]: Info: Color depth: 10-bit
[2025-11-29 23:09:08.141]: Info: Color range: JPEG
[2025-11-29 23:09:08.151]: Info: vaapi vendor: Mesa Gallium driver 25.3.0 for AMD Radeon RX 9070 XT (radeonsi, gfx1201, LLVM 21.1.6, DRM 3.64, 6.17.7-ba19.fc43.x86_64)
[2025-11-29 23:09:08.151]: Info: Streaming bitrate is 1000000
[2025-11-29 23:09:08.151]: Info: Using normal encoding mode
[2025-11-29 23:09:08.151]: Info: Using VBR with single frame VBV size
[2025-11-29 23:09:08.151]: Warning: [av1_vaapi @ 0x7f82a84196c0] Multiple slices were requested but this codec does not support controlling slices.
[2025-11-29 23:09:08.166]: Info: 
[2025-11-29 23:09:08.166]: Info: // Ignore any errors mentioned above, they are not relevant. //
[2025-11-29 23:09:08.166]: Info: 
[2025-11-29 23:09:08.166]: Info: Found H.264 encoder: h264_vaapi [vaapi]
[2025-11-29 23:09:08.166]: Info: Found HEVC encoder: hevc_vaapi [vaapi]
[2025-11-29 23:09:08.166]: Info: Found AV1 encoder: av1_vaapi [vaapi]
[2025-11-29 23:09:08.181]: Error: Property tree is empty. Probably, control flow got interrupted by an unexpected C++ exception. This is a bug in Sunshine. Moonlight-qt will report Malformed XML (missing root element).

fayeinmay avatar Nov 29 '25 22:11 fayeinmay

I have Bazzite as well and this has been a long running issue.

I can run simple commands on my system in terminal such as: kscreen-doctor output.DP-1.mode.1280x720@60

But, if I put this in the Sunshine Do command, it does not work. It results in: [2025-12-08 11:45:41.167]: Error: [kscreen-doctor output.DP-1.mode.1280x720@60] exited with code [6]

baltimoresports avatar Dec 08 '25 16:12 baltimoresports

I have Bazzite as well and this has been a long running issue.

I can run simple commands on my system in terminal such as: kscreen-doctor output.DP-1.mode.1280x720@60

But, if I put this in the Sunshine Do command, it does not work. It results in: [2025-12-08 11:45:41.167]: Error: [kscreen-doctor output.DP-1.mode.1280x720@60] exited with code [6]

It did work for a long time but stopped working some weeks ago for me. Sh -c helps resolving the issue you described.

fayeinmay avatar Dec 08 '25 16:12 fayeinmay

Sh -c

Thanks for the quick reply. Sh -c unfortunately doesn't help for me:

Image Image

Edit: For the record some Do commands work. I am having issues specifically with kscreen-doctor. I am wondering if this is another issue with Bazzite vs Sunshine.

baltimoresports avatar Dec 08 '25 16:12 baltimoresports

If you are not running in GamingMode/DeckMode and are using the desktop, I found these work: flatpak-spawn --host kscreen-doctor <command>

baltimoresports avatar Dec 08 '25 20:12 baltimoresports

If you are not running in GamingMode/DeckMode and are using the desktop, I found these work: flatpak-spawn --host kscreen-doctor <command>

I tried that, but have the same error as mentioned in the bug report unfortunately.

fayeinmay avatar Dec 08 '25 20:12 fayeinmay

I set up sunshine with the prep commands on Bazzite yesterday and I put in the command like this with the number "aliases" instead and it works flawlessly kscreen-doctor output.1.mode.31

Tebro avatar Dec 10 '25 07:12 Tebro

I set up sunshine with the prep commands on Bazzite yesterday and I put in the command like this with the number "aliases" instead and it works flawlessly kscreen-doctor output.1.mode.31

That doesn't work for me, but even if it did, how would you make it dynamic for the incoming resolutions?

fayeinmay avatar Dec 11 '25 13:12 fayeinmay

I set up sunshine with the prep commands on Bazzite yesterday and I put in the command like this with the number "aliases" instead and it works flawlessly kscreen-doctor output.1.mode.31

That doesn't work for me, but even if it did, how would you make it dynamic for the incoming resolutions?

I think you need to wrap the command in sh -c to have access to the environment variables we set.

ReenigneArcher avatar Dec 11 '25 14:12 ReenigneArcher

I set up sunshine with the prep commands on Bazzite yesterday and I put in the command like this with the number "aliases" instead and it works flawlessly kscreen-doctor output.1.mode.31

That doesn't work for me, but even if it did, how would you make it dynamic for the incoming resolutions?

I think you need to wrap the command in sh -c to have access to the environment variables we set.

Nah, still error sadly.

fayeinmay avatar Dec 11 '25 14:12 fayeinmay

Was about to open a bug report and got the usual warning about searching, I am unsure if this is fully related though but did see "It did work for a long time but stopped working some weeks ago for me. Sh -c helps resolving the issue you described."

I am using Sunshine/Moonlight for remote desktop (Sunshine - Linux/Hypr, Moonlight - OS X) both latest packaged versions (Sunshine 025.1210.519 and Moonlight os X from nightly 17th Dec). I have setup an 'application' profile. The DO command runs but when I ctrl+alt+shift+q from the remote desktop the UNDO command does not, both commands works fine normally, paths explicitly and perms liberal, added echo ran >> undo.txt to /usr/bin/bash /home/matt/ss_disconnect and not seeing anything calling it. Tried with sh -c (not using env vars supplied tho) too but no change.

However, I'm also not fully sure if it should work, since this is remote desktop there is no command but DO does run, would a blank command cause UNDO not to run? I cant see this in the docs. Fwiw, the commands just hyprctl the resolution.

Happy to split out if not related.

Also hit the scenario where the do stops running and sunshine needs a restart for it to start working again. Probably ran it a few dozen times until it stopped working.

mattbdc avatar Dec 18 '25 02:12 mattbdc