Sunshine icon indicating copy to clipboard operation
Sunshine copied to clipboard

undo from prep-cmd is not called on application termination

Open Forusim opened this issue 3 years ago • 5 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

Describe the Bug

According to documentation the undo command should be invoked after application termination. In fact this is not working for me neither on Sunshine 0.11.1 or 0.15.0. The do command is invoked as expected before the stream starts, but undo is never invoked and also not mentioned in the logs.

This is how my apps.json look like:

{
    "env": {
        "PATH": "$(PATH)"
    },
    "apps": [
        {
            "name": "DuckStation",
            "output": "",
            "cmd": "D:\\Spiele\\Emulation\\DuckStation\\duckstation-nogui-x64-ReleaseLTCG.exe",
            "prep-cmd":[
                {
                    "do":"C:\\Portable\\Nirsoft\\NirCmd\\nircmd.exe setdisplay 1920 1080 32",
                    "undo":"C:\\Portable\\Nirsoft\\NirCmd\\nircmd.exe setdisplay 1920 1200 32"
                }
            ],
            "image-path": "DuckStation.png"
        }
    ]
}

The undo command is correct and can be called from a cmd.exe during the stream or after with the expected result. I tested it with multiple clients, but the undo was never called.

Expected Behavior

Invoke the undo command after application termination.

Additional Context

Clients: Intel, Windows 7, Moonlight QT 4.3.1 Rpi3, Recalbox 7.2.2, Moonlight Embedded 2.5.2

Host Operating System

Windows

Operating System Version

Windows 10 21H2 (Patched 10/2022)

Architecture

64 bit

Sunshine commit or version

0.15.0

Package

Windows - portable

GPU Type

none (software encoding)

GPU Model

UHD 750

GPU Driver/Mesa Version

31.0.101.3790

Capture Method (Linux Only)

No response

Relevant log output

Not sure if there is something relevant
[fps] -- [[30,60]]
[vt_coder] -- [auto]
[amd_rc] -- [auto]
[vt_realtime] -- [enabled]
[key_rightalt_to_key_win] -- [disabled]
[resolutions] -- [[
    1280x720,
    1920x1080,
    1920x1200
]]
[origin_pin_allowed] -- [pc]
[gamepad] -- [x360]
[nv_coder] -- [auto]
[dwmflush] -- [enabled]
[min_log_level] -- [debug]
[vt_software] -- [auto]
[amd_quality] -- [default]
[origin_web_ui_allowed] -- [pc]
[nv_rc] -- [auto]
[hevc_mode] -- [0]
[encoder] -- [software]
[nv_preset] -- [default]
[upnp] -- [disabled]
[amd_coder] -- [auto]
[2022:11:06:17:45:25]: Info: Compiling shaders...
[2022:11:06:17:45:25]: Info: Compiled shaders
[2022:11:06:17:45:25]: Info: // Testing for available encoders, this may generate errors. You can safely ignore those errors. //
[2022:11:06:17:45:25]: Info: Trying encoder [software]
[2022:11:06:17:45:25]: Error: Failed to sync desktop to thread [0x000000AA]
[2022:11:06:17:45:25]: Info:
Device Description : Intel(R) UHD Graphics 750
Device Vendor ID   : 0x00008086
Device Device ID   : 0x00004C8A
Device Video Mem   : 128 MiB
Device Sys Mem     : 0 MiB
Share Sys Mem      : 65401 MiB
Feature Level      : 0x0000B100
Capture size       : 1920x1080
Offset             : 0x0
Virtual Desktop    : 1920x1080
[2022:11:06:17:45:25]: Debug: Source format [DXGI_FORMAT_B8G8R8A8_UNORM]
[2022:11:06:17:45:25]: Info: Color coding [Rec. 601]
[2022:11:06:17:45:25]: Info: Color range: [JPEG]
[2022:11:06:17:45:25]: Error: Failed to sync desktop to thread [0x000000AA]
[2022:11:06:17:45:25]: Info:
Device Description : Intel(R) UHD Graphics 750
Device Vendor ID   : 0x00008086
Device Device ID   : 0x00004C8A
Device Video Mem   : 128 MiB
Device Sys Mem     : 0 MiB
Share Sys Mem      : 65401 MiB
Feature Level      : 0x0000B100
Capture size       : 1920x1080
Offset             : 0x0
Virtual Desktop    : 1920x1080
[2022:11:06:17:45:25]: Debug: Source format [DXGI_FORMAT_B8G8R8A8_UNORM]
[2022:11:06:17:45:25]: Info: Color coding [Rec. 601]
[2022:11:06:17:45:25]: Info: Color range: [JPEG]
[2022:11:06:17:45:25]: Error: Failed to sync desktop to thread [0x000000AA]
[2022:11:06:17:45:25]: Info:
Device Description : Intel(R) UHD Graphics 750
Device Vendor ID   : 0x00008086
Device Device ID   : 0x00004C8A
Device Video Mem   : 128 MiB
Device Sys Mem     : 0 MiB
Share Sys Mem      : 65401 MiB
Feature Level      : 0x0000B100
Capture size       : 1920x1080
Offset             : 0x0
Virtual Desktop    : 1920x1080
[2022:11:06:17:45:25]: Debug: Source format [DXGI_FORMAT_B8G8R8A8_UNORM]
[2022:11:06:17:45:25]: Info: Color coding [Rec. 601]
[2022:11:06:17:45:25]: Info: Color range: [JPEG]
[2022:11:06:17:45:25]: Error: Failed to sync desktop to thread [0x000000AA]
[2022:11:06:17:45:25]: Info:
Device Description : Intel(R) UHD Graphics 750
Device Vendor ID   : 0x00008086
Device Device ID   : 0x00004C8A
Device Video Mem   : 128 MiB
Device Sys Mem     : 0 MiB
Share Sys Mem      : 65401 MiB
Feature Level      : 0x0000B100
Capture size       : 1920x1080
Offset             : 0x0
Virtual Desktop    : 1920x1080
x[22022:11:06:17:45:25]: Debug: Source format [DXGI_FORMAT_B8G8R8A8_UNORM]6
4[2022:11:06:17:45:25]: Info: Color coding [Rec. 709] [er
r[o2022:11:06:17:45:25]: Info: Color range: [JPEG]r
]: high profile doesn't support a bit depth of 10
[2022:11:06:17:45:25]: Error: Could not open codec [libx264]: Invalid argument
[2022:11:06:17:45:25]: Error: Failed to sync desktop to thread [0x000000AA]
[2022:11:06:17:45:25]: Info:
Device Description : Intel(R) UHD Graphics 750
Device Vendor ID   : 0x00008086
Device Device ID   : 0x00004C8A
Device Video Mem   : 128 MiB
Device Sys Mem     : 0 MiB
Share Sys Mem      : 65401 MiB
Feature Level      : 0x0000B100
Capture size       : 1920x1080
Offset             : 0x0
Virtual Desktop    : 1920x1080
[2022:11:06:17:45:25]: Debug: Source format [DXGI_FORMAT_B8G8R8A8_UNORM]
[2022:11:06:17:45:25]: Info: Color coding [Rec. 601]
[2022:11:06:17:45:25]: Info: Color range: [JPEG]
[2022:11:06:17:45:25]: Warning: software: h264: replacing nalu prefix data
[2022:11:06:17:45:26]: Info:
[2022:11:06:17:45:26]: Info: // Ignore any errors mentioned above, they are not relevant. //
[2022:11:06:17:45:26]: Info:
[2022:11:06:17:45:26]: Debug: ------  h264 ------
[2022:11:06:17:45:26]: Debug: PASSED: supported
[2022:11:06:17:45:26]: Debug: REF_FRAMES_RESTRICT: supported
[2022:11:06:17:45:26]: Debug: REF_FRAMES_AUTOSELECT: supported
[2022:11:06:17:45:26]: Debug: SLICE: supported
[2022:11:06:17:45:26]: Debug: CBR: supported
[2022:11:06:17:45:26]: Debug: DYNAMIC_RANGE: unsupported
[2022:11:06:17:45:26]: Debug: VUI_PARAMETERS: supported
[2022:11:06:17:45:26]: Debug: NALU_PREFIX_5b: unsupported
[2022:11:06:17:45:26]: Debug: -------------------
[2022:11:06:17:45:26]: Info: Found encoder software: [libx264]
[2022:11:06:17:45:26]: Info: Configuration UI available at [https://localhost:47990]
[2022:11:06:17:45:26]: Info: Registered Sunshine Gamestream service
[2022:11:06:17:45:28]: Debug: Found device: http://192.168.188.101:49000/igddesc.xml
[2022:11:06:17:45:28]: Debug: Found device: http://192.168.188.1:49000/igddesc.xml
[2022:11:06:17:45:28]: Debug: Found valid IGD device: http://192.168.188.1:49000/igddesc.xml
[2022:11:06:17:45:28]: Debug: Found external ip: 45.84.27.44
[2022:11:06:17:45:36]: Debug: TUNNEL :: NONE
[2022:11:06:17:45:36]: Debug: METHOD :: GET
[2022:11:06:17:45:36]: Debug: DESTINATION :: /serverinfo
[2022:11:06:17:45:36]: Debug: Accept -- */*
[2022:11:06:17:45:36]: Debug: Host -- 192.168.188.15:47989
[2022:11:06:17:45:36]: Debug:  [--]
[2022:11:06:17:45:36]: Debug: uuid -- 327741eb-e826-4a60-9a56-a6a8d1d52a9a
[2022:11:06:17:45:36]: Debug: uniqueid -- 0123456789ABCDEF
[2022:11:06:17:45:36]: Debug:  [--]
[2022:11:06:17:45:36]: Info: /CN=NVIDIA GameStream Client -- verified
[2022:11:06:17:45:36]: Debug: TUNNEL :: HTTPS
[2022:11:06:17:45:36]: Debug: METHOD :: GET
[2022:11:06:17:45:36]: Debug: DESTINATION :: /serverinfo
[2022:11:06:17:45:36]: Debug: Accept -- */*
[2022:11:06:17:45:36]: Debug: Host -- 192.168.188.15:47984
[2022:11:06:17:45:36]: Debug:  [--]
[2022:11:06:17:45:36]: Debug: uuid -- 34a351c2-fbad-4aa9-be86-8f90071c9e75
[2022:11:06:17:45:36]: Debug: uniqueid -- 0123456789ABCDEF
[2022:11:06:17:45:36]: Debug:  [--]
[2022:11:06:17:45:36]: Info: /CN=NVIDIA GameStream Client -- verified
[2022:11:06:17:45:36]: Debug: TUNNEL :: HTTPS
[2022:11:06:17:45:36]: Debug: METHOD :: GET
[2022:11:06:17:45:36]: Debug: DESTINATION :: /applist
[2022:11:06:17:45:36]: Debug: Accept -- */*
[2022:11:06:17:45:36]: Debug: Host -- 192.168.188.15:47984
[2022:11:06:17:45:36]: Debug:  [--]
[2022:11:06:17:45:36]: Debug: uuid -- 12ab6568-2f71-4ed3-9b9d-85d6f9d2c52f
[2022:11:06:17:45:36]: Debug: uniqueid -- 0123456789ABCDEF
[2022:11:06:17:45:36]: Debug:  [--]
[2022:11:06:17:45:36]: Info: /CN=NVIDIA GameStream Client -- verified
[2022:11:06:17:45:36]: Debug: TUNNEL :: HTTPS
[2022:11:06:17:45:36]: Debug: METHOD :: GET
[2022:11:06:17:45:36]: Debug: DESTINATION :: /launch
[2022:11:06:17:45:36]: Debug: Accept -- */*
[2022:11:06:17:45:36]: Debug: Host -- 192.168.188.15:47984
[2022:11:06:17:45:36]: Debug:  [--]
[2022:11:06:17:45:36]: Debug: localAudioPlayMode -- 0
[2022:11:06:17:45:36]: Debug: gcmap -- 1
[2022:11:06:17:45:36]: Debug: remoteControllersBitmap -- 1
[2022:11:06:17:45:36]: Debug: rikeyid -- -1318409334
[2022:11:06:17:45:36]: Debug: surroundAudioInfo -- 196610
[2022:11:06:17:45:36]: Debug: rikey -- a8db35faed999a3f5458097fa0707420
[2022:11:06:17:45:36]: Debug: sops -- 0
[2022:11:06:17:45:36]: Debug: mode -- 1920x1080x60
[2022:11:06:17:45:36]: Debug: appid -- 5
[2022:11:06:17:45:36]: Debug: uuid -- b54c1975-3de5-4c9d-87b5-b3463f6cc802
[2022:11:06:17:45:36]: Debug: additionalStates -- 1
[2022:11:06:17:45:36]: Debug: uniqueid -- 0123456789ABCDEF
[2022:11:06:17:45:36]: Debug:  [--]
[2022:11:06:17:45:36]: Info: Executing: [C:\Portable\Nirsoft\NirCmd\nircmd.exe setdisplay 1920 1080 32]
[2022:11:06:17:45:36]: Info: Executing: [D:\Spiele\Emulation\DuckStation\duckstation-nogui-x64-ReleaseLTCG.exe]
[2022:11:06:17:45:36]: Debug: handle_read(): Handle read of size: 89 bytes
[2022:11:06:17:45:36]: Debug: handle_payload(): Handle read of size: 0 bytes
[2022:11:06:17:45:36]: Debug: type [REQUEST]
[2022:11:06:17:45:36]: Debug: sequence number [1]
[2022:11:06:17:45:36]: Debug: protocol :: RTSP/1.0
[2022:11:06:17:45:36]: Debug: payload ::
[2022:11:06:17:45:36]: Debug: command :: OPTIONS
[2022:11:06:17:45:36]: Debug: target :: rtsp://0.0.0.0:48010
[2022:11:06:17:45:36]: Debug: CSeq ::  1
[2022:11:06:17:45:36]: Debug: X-GS-ClientVersion ::  14
[2022:11:06:17:45:36]: Debug: Host ::  0.0.0.0
[2022:11:06:17:45:36]: Debug: ---Begin MessageBuffer---
OPTIONS
---End MessageBuffer---
[2022:11:06:17:45:36]: Debug: ---Begin Response---
RTSP/1.0 200 OK
CSeq: 1



---End Response---
[2022:11:06:17:45:36]: Debug: handle_read(): Handle read of size: 165 bytes
[2022:11:06:17:45:36]: Debug: handle_payload(): Handle read of size: 0 bytes
[2022:11:06:17:45:36]: Debug: type [REQUEST]
[2022:11:06:17:45:36]: Debug: sequence number [2]
[2022:11:06:17:45:36]: Debug: protocol :: RTSP/1.0
[2022:11:06:17:45:36]: Debug: payload ::
[2022:11:06:17:45:36]: Debug: command :: DESCRIBE
[2022:11:06:17:45:36]: Debug: target :: rtsp://0.0.0.0:48010
[2022:11:06:17:45:36]: Debug: CSeq ::  2
[2022:11:06:17:45:36]: Debug: X-GS-ClientVersion ::  14
[2022:11:06:17:45:36]: Debug: Host ::  0.0.0.0
[2022:11:06:17:45:36]: Debug: Accept ::  application/sdp
[2022:11:06:17:45:36]: Debug: If-Modified-Since ::  Thu, 01 Jan 1970 00:00:00 GMT
[2022:11:06:17:45:36]: Debug: ---Begin MessageBuffer---
DESCRIBE
---End MessageBuffer---
[2022:11:06:17:45:36]: Debug: ---Begin Response---
RTSP/1.0 200 OK
CSeq: 2


a=fmtp:97 surround-params=21101
a=fmtp:97 surround-params=642012435
a=fmtp:97 surround-params=660012345
a=fmtp:97 surround-params=85301233456
a=fmtp:97 surround-params=88001233456

---End Response---
[2022:11:06:17:45:36]: Debug: handle_read(): Handle read of size: 183 bytes
[2022:11:06:17:45:36]: Debug: handle_payload(): Handle read of size: 0 bytes
[2022:11:06:17:45:36]: Debug: type [REQUEST]
[2022:11:06:17:45:36]: Debug: sequence number [3]
[2022:11:06:17:45:36]: Debug: protocol :: RTSP/1.0
[2022:11:06:17:45:36]: Debug: payload ::
[2022:11:06:17:45:36]: Debug: command :: SETUP
[2022:11:06:17:45:36]: Debug: target :: streamid=audio/0/0
[2022:11:06:17:45:36]: Debug: CSeq ::  3
[2022:11:06:17:45:36]: Debug: X-GS-ClientVersion ::  14
[2022:11:06:17:45:37]: Debug: Host ::  0.0.0.0
[2022:11:06:17:45:37]: Debug: Transport ::  unicast;X-GS-ClientPort=50000-50001
[2022:11:06:17:45:37]: Debug: If-Modified-Since ::  Thu, 01 Jan 1970 00:00:00 GMT
[2022:11:06:17:45:37]: Debug: ---Begin MessageBuffer---
SETUP
---End MessageBuffer---
[2022:11:06:17:45:37]: Debug: ---Begin Response---
RTSP/1.0 200 OK
CSeq: 3
Session: DEADBEEFCAFE;timeout = 90
Transport: server_port=48000



---End Response---
[2022:11:06:17:45:37]: Debug: handle_read(): Handle read of size: 207 bytes
[2022:11:06:17:45:37]: Debug: handle_payload(): Handle read of size: 0 bytes
[2022:11:06:17:45:37]: Debug: type [REQUEST]
[2022:11:06:17:45:37]: Debug: sequence number [4]
[2022:11:06:17:45:37]: Debug: protocol :: RTSP/1.0
[2022:11:06:17:45:37]: Debug: payload ::
[2022:11:06:17:45:37]: Debug: command :: SETUP
[2022:11:06:17:45:37]: Debug: target :: streamid=video/0/0
[2022:11:06:17:45:37]: Debug: CSeq ::  4
[2022:11:06:17:45:37]: Debug: X-GS-ClientVersion ::  14
[2022:11:06:17:45:37]: Debug: Host ::  0.0.0.0
[2022:11:06:17:45:37]: Debug: Session ::   DEADBEEFCAFE
[2022:11:06:17:45:37]: Debug: Transport ::  unicast;X-GS-ClientPort=50000-50001
[2022:11:06:17:45:37]: Debug: If-Modified-Since ::  Thu, 01 Jan 1970 00:00:00 GMT
[2022:11:06:17:45:37]: Debug: ---Begin MessageBuffer---
SETUP
---End MessageBuffer---
[2022:11:06:17:45:37]: Debug: ---Begin Response---
RTSP/1.0 200 OK
CSeq: 4
Session: DEADBEEFCAFE;timeout = 90
Transport: server_port=47998



---End Response---
[2022:11:06:17:45:37]: Debug: handle_read(): Handle read of size: 210 bytes
[2022:11:06:17:45:37]: Debug: handle_payload(): Handle read of size: 0 bytes
[2022:11:06:17:45:37]: Debug: type [REQUEST]
[2022:11:06:17:45:37]: Debug: sequence number [5]
[2022:11:06:17:45:37]: Debug: protocol :: RTSP/1.0
[2022:11:06:17:45:37]: Debug: payload ::
[2022:11:06:17:45:37]: Debug: command :: SETUP
[2022:11:06:17:45:37]: Debug: target :: streamid=control/13/0
[2022:11:06:17:45:37]: Debug: CSeq ::  5
[2022:11:06:17:45:37]: Debug: X-GS-ClientVersion ::  14
[2022:11:06:17:45:37]: Debug: Host ::  0.0.0.0
[2022:11:06:17:45:37]: Debug: Session ::   DEADBEEFCAFE
[2022:11:06:17:45:37]: Debug: Transport ::  unicast;X-GS-ClientPort=50000-50001
[2022:11:06:17:45:37]: Debug: If-Modified-Since ::  Thu, 01 Jan 1970 00:00:00 GMT
[2022:11:06:17:45:37]: Debug: ---Begin MessageBuffer---
SETUP
---End MessageBuffer---
[2022:11:06:17:45:37]: Debug: ---Begin Response---
RTSP/1.0 200 OK
CSeq: 5
Session: DEADBEEFCAFE;timeout = 90
Transport: server_port=47999



---End Response---
[2022:11:06:17:45:37]: Debug: handle_read(): Handle read of size: 1483 bytes
[2022:11:06:17:45:37]: Debug: handle_payload(): Handle read of size: 1315 bytes
[2022:11:06:17:45:37]: Debug: Found Content-Length:  1315 bytes
[2022:11:06:17:45:37]: Debug: type [REQUEST]
[2022:11:06:17:45:37]: Debug: sequence number [6]
[2022:11:06:17:45:37]: Debug: protocol :: RTSP/1.0
[2022:11:06:17:45:37]: Debug: payload :: v=0
o=android 0 14 IN IPv4 192.168.188.15
s=NVIDIA Streaming Client
a=x-nv-video[0].clientViewportWd:1920
a=x-nv-video[0].clientViewportHt:1080
a=x-nv-video[0].maxFPS:60
a=x-nv-video[0].packetSize:1392
a=x-nv-video[0].rateControlMode:4
a=x-nv-video[0].timeoutLengthMs:7000
a=x-nv-video[0].framesWithInvalidRefThreshold:0
a=x-nv-video[0].initialBitrateKbps:12500
a=x-nv-video[0].initialPeakBitrateKbps:12500
a=x-nv-vqos[0].bw.minimumBitrateKbps:12500
a=x-nv-vqos[0].bw.maximumBitrateKbps:12500
a=x-nv-vqos[0].fec.enable:1
a=x-nv-vqos[0].videoQualityScoreUpdateTime:5000
a=x-nv-vqos[0].qosTrafficType:5
a=x-nv-aqos.qosTrafficType:4
a=x-nv-general.featureFlags:167
a=x-nv-general.useReliableUdp:13
a=x-nv-vqos[0].fec.minRequiredFecPackets:2
a=x-nv-vqos[0].drc.enable:0
a=x-nv-general.enableRecoveryMode:0
a=x-nv-video[0].videoEncoderSlicesPerFrame:1
a=x-nv-clientSupportHevc:0
a=x-nv-vqos[0].bitStreamFormat:0
a=x-nv-video[0].dynamicRangeMode:0
a=x-nv-video[0].maxNumReferenceFrames:1
a=x-nv-video[0].clientRefreshRateX100:0
a=x-nv-audio.surround.numChannels:2
a=x-nv-audio.surround.channelMask:3
a=x-nv-audio.surround.enable:0
a=x-nv-audio.surround.AudioQuality:0
a=x-nv-aqos.packetDuration:5
a=x-nv-video[0].encoderCscMode:0
t=0 0
m=video 47998
[2022:11:06:17:45:37]: Debug: command :: ANNOUNCE
[2022:11:06:17:45:37]: Debug: target :: streamid=control/13/0
[2022:11:06:17:45:37]: Debug: CSeq ::  6
[2022:11:06:17:45:37]: Debug: X-GS-ClientVersion ::  14
[2022:11:06:17:45:37]: Debug: Host ::  0.0.0.0
[2022:11:06:17:45:37]: Debug: Session ::   DEADBEEFCAFE
[2022:11:06:17:45:37]: Debug: Content-type ::  application/sdp
[2022:11:06:17:45:37]: Debug: Content-length ::  1315
[2022:11:06:17:45:37]: Debug: ---Begin MessageBuffer---
ANNOUNCE
---End MessageBuffer---
[2022:11:06:17:45:37]: Debug: ---Begin Response---
RTSP/1.0 200 OK
CSeq: 6



---End Response---
[2022:11:06:17:45:37]: Debug: handle_read(): Handle read of size: 91 bytes
[2022:11:06:17:45:37]: Debug: handle_payload(): Handle read of size: 0 bytes
[2022:11:06:17:45:37]: Debug: type [REQUEST]
[2022:11:06:17:45:37]: Debug: sequence number [7]
[2022:11:06:17:45:37]: Debug: protocol :: RTSP/1.0
[2022:11:06:17:45:37]: Debug: payload ::
[2022:11:06:17:45:37]: Debug: command :: PLAY
[2022:11:06:17:45:37]: Debug: target :: /
[2022:11:06:17:45:37]: Debug: CSeq ::  7
[2022:11:06:17:45:37]: Debug: X-GS-ClientVersion ::  14
[2022:11:06:17:45:37]: Debug: Host ::  0.0.0.0
[2022:11:06:17:45:37]: Debug: Session ::   DEADBEEFCAFE
[2022:11:06:17:45:37]: Debug: ---Begin MessageBuffer---
PLAY
---End MessageBuffer---
[2022:11:06:17:45:37]: Debug: ---Begin Response---
RTSP/1.0 200 OK
CSeq: 7



---End Response---
[2022:11:06:17:45:37]: Info: CLIENT CONNECTED
[2022:11:06:17:45:37]: Debug: type [IDX_REQUEST_IDR_FRAME]
[2022:11:06:17:45:37]: Debug: type [IDX_START_B]
[2022:11:06:17:45:37]: Debug: RAISE: 192.168.188.137:45637 :: VIDEO
[2022:11:06:17:45:37]: Debug: Received ping from 192.168.188.137:45637 [474E4950]
[2022:11:06:17:45:37]: Debug: Start capturing Video
[2022:11:06:17:45:37]: Debug: Detecting monitors...
[2022:11:06:17:45:37]: Debug:
====== ADAPTER =====
Device Name      : Intel(R) UHD Graphics 750
Device Vendor ID : 0x00008086
Device Device ID : 0x00004C8A
Device Video Mem : 128 MiB
Device Sys Mem   : 0 MiB
Share Sys Mem    : 65401 MiB

    ====== OUTPUT ======
[2022:11:06:17:45:37]: Debug:     Output Name       : \\.\DISPLAY2
    AttachedToDesktop : yes
    Resolution        : 1920x1080

[2022:11:06:17:45:37]: Debug:
====== ADAPTER =====
Device Name      : Microsoft Basic Render Driver
Device Vendor ID : 0x00001414
Device Device ID : 0x0000008C
Device Video Mem : 0 MiB
Device Sys Mem   : 0 MiB
Share Sys Mem    : 65401 MiB

    ====== OUTPUT ======
[2022:11:06:17:45:37]: Debug: --begin relative mouse move packet--
deltaX [1]
deltaY [1]
--end relative mouse move packet--
[2022:11:06:17:45:37]: Debug: --begin relative mouse move packet--
deltaX [-1]
deltaY [-1]
--end relative mouse move packet--
[2022:11:06:17:45:37]: Info:
Device Description : Intel(R) UHD Graphics 750
Device Vendor ID   : 0x00008086
Device Device ID   : 0x00004C8A
Device Video Mem   : 128 MiB
Device Sys Mem     : 0 MiB
Share Sys Mem      : 65401 MiB
Feature Level      : 0x0000B100
Capture size       : 1920x1080
Offset             : 0x0
Virtual Desktop    : 1920x1080
[2022:11:06:17:45:37]: Debug: Source format [DXGI_FORMAT_B8G8R8A8_UNORM]
[2022:11:06:17:45:37]: Info: Color coding [Rec. 601]
[2022:11:06:17:45:37]: Info: Color range: [MPEG]
[2022:11:06:17:45:37]: Debug: largeMotor: 0
smallMotor: 0
[2022:11:06:17:45:37]: Debug: largeMotor: 0
smallMotor: 0
[2022:11:06:17:45:37]: Debug: largeMotor: 0
smallMotor: 0
[2022:11:06:17:45:37]: Debug: Send gamepadnr [0] with lowfreq [0] and highfreq [0]
[2022:11:06:17:45:37]: Debug: Send gamepadnr [0] with lowfreq [0] and highfreq [0]
[2022:11:06:17:45:37]: Debug: Send gamepadnr [0] with lowfreq [0] and highfreq [0]
[2022:11:06:17:45:37]: Debug: largeMotor: 0
smallMotor: 0
[2022:11:06:17:45:37]: Debug: RAISE: 192.168.188.137:40040 :: AUDIO
[2022:11:06:17:45:37]: Debug: Received ping from 192.168.188.137:40040 [474E4950]
[2022:11:06:17:45:37]: Debug: Start capturing Audio
[2022:11:06:17:45:37]: Debug: Send gamepadnr [0] with lowfreq [0] and highfreq [0]
[2022:11:06:17:45:37]: Debug: Couldn't initialize audio client for [Mono]: [0x88890008]
[2022:11:06:17:45:37]: Debug: Mono: unsupported
[2022:11:06:17:45:37]: Debug: Stereo: supported
[2022:11:06:17:45:37]: Debug: Couldn't initialize audio client for [Mono]: [0x88890008]
[2022:11:06:17:45:37]: Debug: Mono: unsupported
[2022:11:06:17:45:37]: Debug: Stereo: supported
[2022:11:06:17:45:37]: Debug: Couldn't initialize audio client for [Mono]: [0x88890008]
[2022:11:06:17:45:37]: Debug: Mono: unsupported
[2022:11:06:17:45:37]: Debug: Stereo: supported
[2022:11:06:17:45:37]: Debug: Trying audio format [Mono]
[2022:11:06:17:45:37]: Debug: Couldn't initialize audio client for [Mono]: [0x88890008]
[2022:11:06:17:45:37]: Debug: Trying audio format [Stereo]
[2022:11:06:17:45:37]: Debug: Found audio format [Stereo]
[2022:11:06:17:45:38]: Debug: largeMotor: 0
smallMotor: 0
[2022:11:06:17:45:38]: Debug: Send gamepadnr [0] with lowfreq [0] and highfreq [0]
[2022:11:06:17:45:42]: Debug: Process terminated
[2022:11:06:17:45:42]: Debug: Waiting for video to end...
[2022:11:06:17:45:42]: Debug: Waiting for audio to end...
[2022:11:06:17:45:42]: Debug: Waiting for control to end...
[2022:11:06:17:45:42]: Debug: Resetting Input...
[2022:11:06:17:45:42]: Debug: Removing references to any connections...
[2022:11:06:17:45:42]: Debug: Session ended
[2022:11:06:17:45:42]: Debug: Waiting for main listening thread to end...
[2022:11:06:17:45:42]: Debug: Waiting for main video thread to end...
[2022:11:06:17:45:42]: Debug: Waiting for main audio thread to end...
[2022:11:06:17:45:42]: Debug: Waiting for main control thread to end...
[2022:11:06:17:45:42]: Debug: All broadcasting threads ended

Forusim avatar Nov 06 '22 16:11 Forusim

I believe the documentation is wrong.

If you read the section for the do command it states that the undo command will run if the do command fails.

ReenigneArcher avatar Nov 06 '22 17:11 ReenigneArcher

Some phrasing maybe not 100% exact, but I read it different:

prep-cmd - A list of commands to be run before/after the application
    If any of the prep-commands fail, starting the application is aborted
    do - Run before the application
        If it (here: application) fails, all undo commands of the previously succeeded do commands are run
    undo - Run after the application has terminated
        This should not fail considering it is supposed to undo the do commands
        If it fails, Sunshine is terminated

do runs before app started, undo runs after app closed or failed to start.

Forusim avatar Nov 06 '22 19:11 Forusim

The undo command is called when you terminate the application, either manually or via the moonlight option to "Quit app on host after ending stream". This is present in proc_t::terminate().

It should be noted the the "do" command in proc_t::execute() is logged at info level, but the undo command in proc_t::terminate() is logged at debug level. This inconsistency should probably be fixed. If you switch the log level to debug, you see both occurring.

KuleRucket avatar Nov 21 '22 15:11 KuleRucket

Sorry, but this just not happen in my setup. Even with debug logs there is no mention of "nircmd.exe" after app closed. Is there anyone, where the undo feature actually works?

Forusim avatar Nov 21 '22 23:11 Forusim

Is there anyone, where the undo feature actually works?

Yes it works for me fine. I think that the only time it doesn't work is if the host goes to sleep.

KuleRucket avatar Nov 22 '22 07:11 KuleRucket

This issue is stale because it has been open for 90 days with no activity. Comment or remove the stale label, otherwise this will be closed in 10 days.

LizardByte-bot avatar Feb 20 '23 10:02 LizardByte-bot

Haven`t followed the changes to this project after my last comment. In the latest version 0.18.3 both commands are properly executed and logged. Thanks a lot to whoever has fixed it.

Forusim avatar Feb 20 '23 23:02 Forusim