Sunshine
Sunshine copied to clipboard
Remote session defaults to Audio sink after pausing and resuming Stream
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
Hello, I have an issue with a specific game's audio capture.
When I use Virtual Sink (Steam Streaming Speaker) and launch the game all is fine until I decide to just minimise (not quit remote session) from Moonlight and then later remote back in there's no audio from the game only but audio still plays everywhere else (tested on a Youtube video).
What's odd is that when I do the above and enable "Play audio on PC" it uses my default speaker and when I do the exact scenario as described above, I don't have any of the above issue and audio plays in properly from the game to my Moonlight client (Android device).
After a bit more thorough testing I found out that when I minimise the stream it defaults to Audio sink but when I resume the remote session from where I left it switches back to Virtual sink. I think this switching of Audio devices is what's causing an issue in the first place with the game. Is there a way to possibly force it to use Virtual Sink at all times until the client decides to Quit remote session from Moonlight and then switch over to Audio sink?
To reproduce this bug,
- Verify that "Play audio on PC" is unticked from Moonlight
- Remote into Sunshine PC from Moonlight
- Open Sound from Control Panel
- Verify that the Virtual Sink is the default device
- In Moonlight client do the back button hand gesture, or the button.
- Verify that in Moonlight client there is a white play sign on top of whatever app you've launched for testing (Or just hold on the app and verify that Quit Session is present)
- Check the host PC and the default device is switched back to Audio Sink
- Now remote back again into the same app and as expected it reverts back to Virtual Sink
Expected Behavior
7a) Force it to use the Virtual Sink unless the Moonlight client instructs to Quit Session at which you revert back to Audio Sink.
Additional Context
I did the same test but with "Play audio on PC" ticked on Moonlight and despite me minimising the remote session and resuming it back the audio from the game doesn't cut off because the audio output doesn't change. But this isn't the case with Virtual Sink.
On Moonlight client when doing the back button gesture the logs say that the client disconnected and I am assuming that because of this behaviour Sunshine is reverting it back to Audio Sink while in reality the user did not Quit the Session but instead pause?
P.S: - Capture Method is set to None as I have left "Force a Specific Capture Method" to Autodetect (Recommended)
Host Operating System
Windows
Operating System Version
Windows 11 IoT Enterprise LTSC 10.0.26100 Build 26100
Architecture
64 bit
Sunshine commit or version
v2024.724.84421
Package
Windows - installer
GPU Type
Nvidia
GPU Model
GTX 1080
GPU Driver/Mesa Version
560.70
Capture Method
None
Config
resolutions = [
352x240,
480x360,
858x480,
1280x720,
1920x1080,
2560x1440
]
sunshine_name = azuriyePC
address_family = both
encoder = nvenc
nvenc_preset = 4
Apps
{
"env": {},
"apps": [
{
"name": "Desktop",
"image-path": "desktop.png"
},
{
"name": "Steam Big Picture",
"cmd": "steam://open/bigpicture",
"auto-detach": "true",
"wait-all": "true",
"image-path": "steam.png"
}
]
}
Relevant log output
[2024:07:25:13:07:07]: Info: Sunshine version: v0.23.1
[2024:07:25:13:07:07]: Info: nvprefs: No need to modify application profile settings
[2024:07:25:13:07:07]: Info: nvprefs: Changed OGL_CPL_PREFER_DXPRESENT to OGL_CPL_PREFER_DXPRESENT_PREFER_ENABLED for base profile
[2024:07:25:13:07:07]: Info: Compiling shaders...
[2024:07:25:13:07:07]: Info: Compiled shaders
[2024:07:25:13:07:08]: Info: System tray created
[2024:07:25:13:07:08]: Info: Trying encoder [nvenc]
[2024:07:25:13:07:08]: Info: ddprobe.exe [1] [] returned: 0x00000000
[2024:07:25:13:07:08]: Info: Set GPU preference: 1
[2024:07:25:13:07:08]: Info:
Device Description : NVIDIA GeForce GTX 1080
Device Vendor ID : 0x000010DE
Device Device ID : 0x00001B80
Device Video Mem : 8059 MiB
Device Sys Mem : 0 MiB
Share Sys Mem : 16340 MiB
Feature Level : 0x0000B100
Capture size : 2560x1440
Offset : 0x0
Virtual Desktop : 2560x1440
[2024:07:25:13:07:08]: Info: Active GPU has HAGS enabled
[2024:07:25:13:07:08]: Info: Using realtime GPU priority
[2024:07:25:13:07:08]: Info: Desktop resolution [2560x1440]
[2024:07:25:13:07:08]: Info: Desktop format [DXGI_FORMAT_B8G8R8A8_UNORM]
[2024:07:25:13:07:08]: Info: Display refresh rate [59.951Hz]
[2024:07:25:13:07:08]: Info: Requested frame rate [60fps]
[2024:07:25:13:07:08]: Info:
Colorspace : DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709
Bits Per Color : 8
Red Primary : [0.639648,0.330078]
Green Primary : [0.299805,0.599609]
Blue Primary : [0.150391,0.0595703]
White Point : [0.313477,0.329102]
Min Luminance : 0.5 nits
Max Luminance : 270 nits
Max Full Luminance : 270 nits
[2024:07:25:13:07:08]: Info: SDR color coding [Rec. 601]
[2024:07:25:13:07:08]: Info: Color depth: 8-bit
[2024:07:25:13:07:08]: Info: Color range: [JPEG]
[2024:07:25:13:07:08]: Info: NvEnc: created encoder P4 two-pass
[2024:07:25:13:07:08]: Info: SDR color coding [Rec. 601]
[2024:07:25:13:07:08]: Info: Color depth: 8-bit
[2024:07:25:13:07:08]: Info: Color range: [JPEG]
[2024:07:25:13:07:08]: Info: NvEnc: created encoder P4 two-pass
[2024:07:25:13:07:08]: Info: SDR color coding [Rec. 601]
[2024:07:25:13:07:08]: Info: Color depth: 8-bit
[2024:07:25:13:07:08]: Info: Color range: [JPEG]
[2024:07:25:13:07:08]: Error: NvEnc: encoding format is not supported by the gpu
[2024:07:25:13:07:08]: Info:
Device Description : NVIDIA GeForce GTX 1080
Device Vendor ID : 0x000010DE
Device Device ID : 0x00001B80
Device Video Mem : 8059 MiB
Device Sys Mem : 0 MiB
Share Sys Mem : 16340 MiB
Feature Level : 0x0000B100
Capture size : 2560x1440
Offset : 0x0
Virtual Desktop : 2560x1440
[2024:07:25:13:07:08]: Info: Active GPU has HAGS enabled
[2024:07:25:13:07:08]: Info: Using realtime GPU priority
[2024:07:25:13:07:08]: Info: Desktop resolution [2560x1440]
[2024:07:25:13:07:08]: Info: Desktop format [DXGI_FORMAT_B8G8R8A8_UNORM]
[2024:07:25:13:07:08]: Info: Display refresh rate [59.951Hz]
[2024:07:25:13:07:08]: Info: Requested frame rate [60fps]
[2024:07:25:13:07:08]: Info:
Colorspace : DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709
Bits Per Color : 8
Red Primary : [0.639648,0.330078]
Green Primary : [0.299805,0.599609]
Blue Primary : [0.150391,0.0595703]
White Point : [0.313477,0.329102]
Min Luminance : 0.5 nits
Max Luminance : 270 nits
Max Full Luminance : 270 nits
[2024:07:25:13:07:08]: Info: SDR color coding [Rec. 709]
[2024:07:25:13:07:08]: Info: Color depth: 10-bit
[2024:07:25:13:07:08]: Info: Color range: [JPEG]
[2024:07:25:13:07:08]: Info: NvEnc: created encoder P4 10-bit two-pass
[2024:07:25:13:07:08]: Info: // Testing for available encoders, this may generate errors. You can safely ignore those errors. //
[2024:07:25:13:07:08]: Info:
[2024:07:25:13:07:08]: Info: // Ignore any errors mentioned above, they are not relevant. //
[2024:07:25:13:07:08]: Info:
[2024:07:25:13:07:08]: Info: Found H.264 encoder: h264_nvenc [nvenc]
[2024:07:25:13:07:08]: Info: Found HEVC encoder: hevc_nvenc [nvenc]
[2024:07:25:13:07:08]: Info: Configuration UI available at [https://localhost:47990]
[2024:07:25:13:07:09]: Info: Registered Sunshine mDNS service
[2024:07:25:13:07:33]: Info: Encoder reenumeration is required
[2024:07:25:13:07:33]: Info: Trying encoder [nvenc]
[2024:07:25:13:07:33]: Info:
Device Description : NVIDIA GeForce GTX 1080
Device Vendor ID : 0x000010DE
Device Device ID : 0x00001B80
Device Video Mem : 8059 MiB
Device Sys Mem : 0 MiB
Share Sys Mem : 16340 MiB
Feature Level : 0x0000B100
Capture size : 2560x1440
Offset : 0x0
Virtual Desktop : 2560x1440
[2024:07:25:13:07:33]: Info: Active GPU has HAGS enabled
[2024:07:25:13:07:33]: Info: Using realtime GPU priority
[2024:07:25:13:07:33]: Info: Desktop resolution [2560x1440]
[2024:07:25:13:07:33]: Info: Desktop format [DXGI_FORMAT_B8G8R8A8_UNORM]
[2024:07:25:13:07:33]: Info: Display refresh rate [59.951Hz]
[2024:07:25:13:07:33]: Info: Requested frame rate [60fps]
[2024:07:25:13:07:33]: Info:
Colorspace : DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709
Bits Per Color : 8
Red Primary : [0.639648,0.330078]
Green Primary : [0.299805,0.599609]
Blue Primary : [0.150391,0.0595703]
White Point : [0.313477,0.329102]
Min Luminance : 0.5 nits
Max Luminance : 270 nits
Max Full Luminance : 270 nits
[2024:07:25:13:07:33]: Info: SDR color coding [Rec. 601]
[2024:07:25:13:07:33]: Info: Color depth: 8-bit
[2024:07:25:13:07:33]: Info: Color range: [JPEG]
[2024:07:25:13:07:33]: Info: NvEnc: created encoder P4 two-pass
[2024:07:25:13:07:33]: Info: SDR color coding [Rec. 601]
[2024:07:25:13:07:33]: Info: Color depth: 8-bit
[2024:07:25:13:07:33]: Info: Color range: [JPEG]
[2024:07:25:13:07:33]: Info: NvEnc: created encoder P4 two-pass
[2024:07:25:13:07:33]: Info: SDR color coding [Rec. 601]
[2024:07:25:13:07:33]: Info: Color depth: 8-bit
[2024:07:25:13:07:33]: Info: Color range: [JPEG]
[2024:07:25:13:07:33]: Error: NvEnc: encoding format is not supported by the gpu
[2024:07:25:13:07:33]: Info:
Device Description : NVIDIA GeForce GTX 1080
Device Vendor ID : 0x000010DE
Device Device ID : 0x00001B80
Device Video Mem : 8059 MiB
Device Sys Mem : 0 MiB
Share Sys Mem : 16340 MiB
Feature Level : 0x0000B100
Capture size : 2560x1440
Offset : 0x0
Virtual Desktop : 2560x1440
[2024:07:25:13:07:33]: Info: Active GPU has HAGS enabled
[2024:07:25:13:07:33]: Info: Using realtime GPU priority
[2024:07:25:13:07:33]: Info: Desktop resolution [2560x1440]
[2024:07:25:13:07:33]: Info: Desktop format [DXGI_FORMAT_B8G8R8A8_UNORM]
[2024:07:25:13:07:33]: Info: Display refresh rate [59.951Hz]
[2024:07:25:13:07:33]: Info: Requested frame rate [60fps]
[2024:07:25:13:07:33]: Info:
Colorspace : DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709
Bits Per Color : 8
Red Primary : [0.639648,0.330078]
Green Primary : [0.299805,0.599609]
Blue Primary : [0.150391,0.0595703]
White Point : [0.313477,0.329102]
Min Luminance : 0.5 nits
Max Luminance : 270 nits
Max Full Luminance : 270 nits
[2024:07:25:13:07:33]: Info: SDR color coding [Rec. 709]
[2024:07:25:13:07:33]: Info: Color depth: 10-bit
[2024:07:25:13:07:33]: Info: Color range: [JPEG]
[2024:07:25:13:07:33]: Info: NvEnc: created encoder P4 10-bit two-pass
[2024:07:25:13:07:33]: Info: // Testing for available encoders, this may generate errors. You can safely ignore those errors. //
[2024:07:25:13:07:33]: Info:
[2024:07:25:13:07:33]: Info: // Ignore any errors mentioned above, they are not relevant. //
[2024:07:25:13:07:33]: Info:
[2024:07:25:13:07:33]: Info: Found H.264 encoder: h264_nvenc [nvenc]
[2024:07:25:13:07:33]: Info: Found HEVC encoder: hevc_nvenc [nvenc]
[2024:07:25:13:07:33]: Info: Executing: [steam://open/bigpicture] in [""]
[2024:07:25:13:07:33]: Info: Resolved user-provided command 'steam://open/bigpicture' to '"C:\Program Files (x86)\Steam\steam.exe" -- "steam://open/bigpicture"'
[2024:07:25:13:07:33]: Info: steam://open/bigpicture running with PID 24388
[2024:07:25:13:07:33]: Info: App exited gracefully within 5 seconds of launch. Treating the app as a detached command.
[2024:07:25:13:07:33]: Info: Adjust this behavior in the Applications tab or apps.json if this is not what you want.
[2024:07:25:13:07:34]: Info: nvprefs: No need to modify application profile settings
[2024:07:25:13:07:34]: Info: nvprefs: No need to modify global profile settings
[2024:07:25:13:07:34]: Info: CLIENT CONNECTED
[2024:07:25:13:07:34]: Info:
Device Description : NVIDIA GeForce GTX 1080
Device Vendor ID : 0x000010DE
Device Device ID : 0x00001B80
Device Video Mem : 8059 MiB
Device Sys Mem : 0 MiB
Share Sys Mem : 16340 MiB
Feature Level : 0x0000B100
Capture size : 2560x1440
Offset : 0x0
Virtual Desktop : 2560x1440
[2024:07:25:13:07:34]: Info: Active GPU has HAGS enabled
[2024:07:25:13:07:34]: Info: Using realtime GPU priority
[2024:07:25:13:07:34]: Info: Desktop resolution [2560x1440]
[2024:07:25:13:07:34]: Info: Desktop format [DXGI_FORMAT_B8G8R8A8_UNORM]
[2024:07:25:13:07:34]: Info: Display refresh rate [59.951Hz]
[2024:07:25:13:07:34]: Info: Requested frame rate [60fps]
[2024:07:25:13:07:34]: Info:
Colorspace : DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709
Bits Per Color : 8
Red Primary : [0.639648,0.330078]
Green Primary : [0.299805,0.599609]
Blue Primary : [0.150391,0.0595703]
White Point : [0.313477,0.329102]
Min Luminance : 0.5 nits
Max Luminance : 270 nits
Max Full Luminance : 270 nits
[2024:07:25:13:07:34]: Info: Adjusted capture rate to 59.951fps to better match display
[2024:07:25:13:07:34]: Info: Capture format [DXGI_FORMAT_B8G8R8A8_UNORM]
[2024:07:25:13:07:34]: Info: SDR color coding [Rec. 709]
[2024:07:25:13:07:34]: Info: Color depth: 8-bit
[2024:07:25:13:07:34]: Info: Color range: [MPEG]
[2024:07:25:13:07:34]: Info: NvEnc: created encoder P4 two-pass
[2024:07:25:13:07:44]: Info: Gamepad 0 will be Xbox 360 controller (default)
[2024:07:25:13:07:53]: Info:
Device Description : NVIDIA GeForce GTX 1080
Device Vendor ID : 0x000010DE
Device Device ID : 0x00001B80
Device Video Mem : 8059 MiB
Device Sys Mem : 0 MiB
Share Sys Mem : 16340 MiB
Feature Level : 0x0000B100
Capture size : 2560x1440
Offset : 0x0
Virtual Desktop : 2560x1440
[2024:07:25:13:07:53]: Info: Active GPU has HAGS enabled
[2024:07:25:13:07:53]: Info: Using realtime GPU priority
[2024:07:25:13:07:53]: Info: Desktop resolution [2560x1440]
[2024:07:25:13:07:53]: Info: Desktop format [DXGI_FORMAT_B8G8R8A8_UNORM]
[2024:07:25:13:07:53]: Info: Display refresh rate [59.951Hz]
[2024:07:25:13:07:53]: Info: Requested frame rate [60fps]
[2024:07:25:13:07:53]: Info:
Colorspace : DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709
Bits Per Color : 8
Red Primary : [0.639648,0.330078]
Green Primary : [0.299805,0.599609]
Blue Primary : [0.150391,0.0595703]
White Point : [0.313477,0.329102]
Min Luminance : 0.5 nits
Max Luminance : 270 nits
Max Full Luminance : 270 nits
[2024:07:25:13:07:53]: Info: Adjusted capture rate to 59.951fps to better match display
[2024:07:25:13:07:53]: Info: Capture format [DXGI_FORMAT_B8G8R8A8_UNORM]
[2024:07:25:13:07:53]: Info: SDR color coding [Rec. 709]
[2024:07:25:13:07:53]: Info: Color depth: 8-bit
[2024:07:25:13:07:53]: Info: Color range: [MPEG]
[2024:07:25:13:07:53]: Info: NvEnc: created encoder P4 two-pass
[2024:07:25:13:08:19]: Info: CLIENT DISCONNECTED
[2024:07:25:13:08:52]: Info: Encoder reenumeration is required
[2024:07:25:13:08:52]: Info: Trying encoder [nvenc]
[2024:07:25:13:08:52]: Info:
Device Description : NVIDIA GeForce GTX 1080
Device Vendor ID : 0x000010DE
Device Device ID : 0x00001B80
Device Video Mem : 8059 MiB
Device Sys Mem : 0 MiB
Share Sys Mem : 16340 MiB
Feature Level : 0x0000B100
Capture size : 2560x1440
Offset : 0x0
Virtual Desktop : 2560x1440
[2024:07:25:13:08:52]: Info: Active GPU has HAGS enabled
[2024:07:25:13:08:52]: Info: Using realtime GPU priority
[2024:07:25:13:08:52]: Info: Desktop resolution [2560x1440]
[2024:07:25:13:08:52]: Info: Desktop format [DXGI_FORMAT_B8G8R8A8_UNORM]
[2024:07:25:13:08:52]: Info: Display refresh rate [59.951Hz]
[2024:07:25:13:08:52]: Info: Requested frame rate [60fps]
[2024:07:25:13:08:52]: Info:
Colorspace : DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709
Bits Per Color : 8
Red Primary : [0.639648,0.330078]
Green Primary : [0.299805,0.599609]
Blue Primary : [0.150391,0.0595703]
White Point : [0.313477,0.329102]
Min Luminance : 0.5 nits
Max Luminance : 270 nits
Max Full Luminance : 270 nits
[2024:07:25:13:08:52]: Info: SDR color coding [Rec. 601]
[2024:07:25:13:08:52]: Info: Color depth: 8-bit
[2024:07:25:13:08:52]: Info: Color range: [JPEG]
[2024:07:25:13:08:52]: Info: NvEnc: created encoder P4 two-pass
[2024:07:25:13:08:52]: Info: SDR color coding [Rec. 601]
[2024:07:25:13:08:52]: Info: Color depth: 8-bit
[2024:07:25:13:08:52]: Info: Color range: [JPEG]
[2024:07:25:13:08:52]: Info: NvEnc: created encoder P4 two-pass
[2024:07:25:13:08:52]: Info: SDR color coding [Rec. 601]
[2024:07:25:13:08:52]: Info: Color depth: 8-bit
[2024:07:25:13:08:52]: Info: Color range: [JPEG]
[2024:07:25:13:08:52]: Error: NvEnc: encoding format is not supported by the gpu
[2024:07:25:13:08:53]: Info:
Device Description : NVIDIA GeForce GTX 1080
Device Vendor ID : 0x000010DE
Device Device ID : 0x00001B80
Device Video Mem : 8059 MiB
Device Sys Mem : 0 MiB
Share Sys Mem : 16340 MiB
Feature Level : 0x0000B100
Capture size : 2560x1440
Offset : 0x0
Virtual Desktop : 2560x1440
[2024:07:25:13:08:53]: Info: Active GPU has HAGS enabled
[2024:07:25:13:08:53]: Info: Using realtime GPU priority
[2024:07:25:13:08:53]: Info: Desktop resolution [2560x1440]
[2024:07:25:13:08:53]: Info: Desktop format [DXGI_FORMAT_B8G8R8A8_UNORM]
[2024:07:25:13:08:53]: Info: Display refresh rate [59.951Hz]
[2024:07:25:13:08:53]: Info: Requested frame rate [60fps]
[2024:07:25:13:08:53]: Info:
Colorspace : DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709
Bits Per Color : 8
Red Primary : [0.639648,0.330078]
Green Primary : [0.299805,0.599609]
Blue Primary : [0.150391,0.0595703]
White Point : [0.313477,0.329102]
Min Luminance : 0.5 nits
Max Luminance : 270 nits
Max Full Luminance : 270 nits
[2024:07:25:13:08:53]: Info: SDR color coding [Rec. 709]
[2024:07:25:13:08:53]: Info: Color depth: 10-bit
[2024:07:25:13:08:53]: Info: Color range: [JPEG]
[2024:07:25:13:08:53]: Info: NvEnc: created encoder P4 10-bit two-pass
[2024:07:25:13:08:53]: Info: // Testing for available encoders, this may generate errors. You can safely ignore those errors. //
[2024:07:25:13:08:53]: Info:
[2024:07:25:13:08:53]: Info: // Ignore any errors mentioned above, they are not relevant. //
[2024:07:25:13:08:53]: Info:
[2024:07:25:13:08:53]: Info: Found H.264 encoder: h264_nvenc [nvenc]
[2024:07:25:13:08:53]: Info: Found HEVC encoder: hevc_nvenc [nvenc]
[2024:07:25:13:08:53]: Info: nvprefs: No need to modify application profile settings
[2024:07:25:13:08:53]: Info: nvprefs: No need to modify global profile settings
[2024:07:25:13:08:53]: Info: CLIENT CONNECTED
[2024:07:25:13:08:53]: Info:
Device Description : NVIDIA GeForce GTX 1080
Device Vendor ID : 0x000010DE
Device Device ID : 0x00001B80
Device Video Mem : 8059 MiB
Device Sys Mem : 0 MiB
Share Sys Mem : 16340 MiB
Feature Level : 0x0000B100
Capture size : 2560x1440
Offset : 0x0
Virtual Desktop : 2560x1440
[2024:07:25:13:08:53]: Info: Active GPU has HAGS enabled
[2024:07:25:13:08:53]: Info: Using realtime GPU priority
[2024:07:25:13:08:53]: Info: Desktop resolution [2560x1440]
[2024:07:25:13:08:53]: Info: Desktop format [DXGI_FORMAT_B8G8R8A8_UNORM]
[2024:07:25:13:08:53]: Info: Display refresh rate [59.951Hz]
[2024:07:25:13:08:53]: Info: Requested frame rate [60fps]
[2024:07:25:13:08:53]: Info:
Colorspace : DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709
Bits Per Color : 8
Red Primary : [0.639648,0.330078]
Green Primary : [0.299805,0.599609]
Blue Primary : [0.150391,0.0595703]
White Point : [0.313477,0.329102]
Min Luminance : 0.5 nits
Max Luminance : 270 nits
Max Full Luminance : 270 nits
[2024:07:25:13:08:53]: Info: Adjusted capture rate to 59.951fps to better match display
[2024:07:25:13:08:53]: Info: Capture format [DXGI_FORMAT_B8G8R8A8_UNORM]
[2024:07:25:13:08:53]: Info: SDR color coding [Rec. 709]
[2024:07:25:13:08:53]: Info: Color depth: 8-bit
[2024:07:25:13:08:53]: Info: Color range: [MPEG]
[2024:07:25:13:08:53]: Info: NvEnc: created encoder P4 two-pass
[2024:07:25:13:08:54]: Info: Gamepad 0 will be Xbox 360 controller (default)
[2024:07:25:13:09:50]: Info:
Device Description : NVIDIA GeForce GTX 1080
Device Vendor ID : 0x000010DE
Device Device ID : 0x00001B80
Device Video Mem : 8059 MiB
Device Sys Mem : 0 MiB
Share Sys Mem : 16340 MiB
Feature Level : 0x0000B100
Capture size : 2560x1440
Offset : 0x0
Virtual Desktop : 2560x1440
[2024:07:25:13:09:50]: Info: Active GPU has HAGS enabled
[2024:07:25:13:09:50]: Info: Using realtime GPU priority
[2024:07:25:13:09:50]: Info: Desktop resolution [2560x1440]
[2024:07:25:13:09:50]: Info: Desktop format [DXGI_FORMAT_B8G8R8A8_UNORM]
[2024:07:25:13:09:50]: Info: Display refresh rate [59.951Hz]
[2024:07:25:13:09:50]: Info: Requested frame rate [60fps]
[2024:07:25:13:09:50]: Info:
Colorspace : DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709
Bits Per Color : 8
Red Primary : [0.639648,0.330078]
Green Primary : [0.299805,0.599609]
Blue Primary : [0.150391,0.0595703]
White Point : [0.313477,0.329102]
Min Luminance : 0.5 nits
Max Luminance : 270 nits
Max Full Luminance : 270 nits
[2024:07:25:13:09:50]: Info: Adjusted capture rate to 59.951fps to better match display
[2024:07:25:13:09:50]: Info: Capture format [DXGI_FORMAT_B8G8R8A8_UNORM]
[2024:07:25:13:09:50]: Info: SDR color coding [Rec. 709]
[2024:07:25:13:09:50]: Info: Color depth: 8-bit
[2024:07:25:13:09:50]: Info: Color range: [MPEG]
[2024:07:25:13:09:50]: Info: NvEnc: created encoder P4 two-pass
I have similar issue that audio disappears when I try to resume the stream while the game is still playing on PC. I am suspecting that the wrong audio device is chosen when resuming instead of "Steam streaming Speakers".
I created an issue in Moonlight repo, since I wasn't sure if it is an issue with moonlight or sunshine. But it seems it is related to sunshine. 1407 which I probably should close that.
Any resolution for this?
I appreciate that I have no other contribution than to shay I have the same issue and can reproduce it... nonetheless has any progress been made? I'd be happy to go through a reproduction and provide logs.
Do you have an issue number @RebelliousX for that bug you raised? I'm looking at the issues list for the Android repo of Moonlight and I'm unable to find it
@domfarr98 I believe this is the referenced issue: https://github.com/moonlight-stream/moonlight-android/issues/1407
I can also confirm that when trying to resume a game already running that I don't get audio and have to restart the game to fix the issue.
writing to say i also am having the same issues, currently running into it with Batman Arkham Asylum streaming from my pc to steam deck
Well, this is somewhat related to issue #3430
The last thing you want is during a gameplay for the game to think that the Audio Card / output device was removed. In my case, most of the games I tried on Steam just outright freeze, some they don't care, a few I lose the audio.
The way I workaround this issue is having:
- Audio Sink: Speakers (Steam Streaming Speakers)
- Virtual Sink: Speakers (Steam Streaming Speakers). Yes both Audio & Virtual Sinks are Steam Speakers.
- In Moonlight: Enable Play Audio On PC ( Very important )
- To mute the audio on PC but keep it active on client device (Android phone for example) when disconnecting and enable it when connecting (not session quit) . Here is what I did, based on the solution I came up with in #3481 (which was closed as a duplicate request):
So I downloaded SetVol app from here on github.
Create a folder in C drive called SunshineExtraScripts, save SetVol.exe inside it and any batch file or
powershell script in this folder, I will provide XML for task scheduler to run silently to run the powershell script.
For DoCommand.bat:
@echo off
REM Get the directory of the batch file
set "batch_dir=%~dp0"
REM Mute Volume using SetVol app
start /B /WAIT "" "%batch_dir%SetVol.exe" mute
For UndoCommand.bat:
@echo off
REM Get the directory of the batch file
set "batch_dir=%~dp0"
REM Unmute Volume using SetVol app
start /B /WAIT "" "%batch_dir%SetVol.exe" unmute
With the help of ChatGPT, it wrote a PowerShell script within a minute that works beautifully
to monitor the sunshine.log for CLIENT CONNECTED to run DoCommand.bat and CLIENT DISCONNECTED
to run UndoCommand.bat.
This is script will run a specific batch file when client is connected, and another when disconnected:
For the lack of ingenuity when it comes to naming things, create a text file with extension .ps1 (powershell script)
named Do_Undo_at_Connect_Disconnect.ps1. Copy content of the powershell script below and save it.
Note: If you installed Sunshine in a non-default directory, modify the path of sunshine.log in the script below.
$logFilePath = "C:\Program Files\Sunshine\config\sunshine.log"
$connectedBatchFilePath = "C:\SunshineExtraScripts\DoCommand.bat"
$disconnectedBatchFilePath = "C:\SunshineExtraScripts\UndoCommand.bat"
$matchPatternClientConnected = "CLIENT CONNECTED"
$matchPatternClientDisconnected = "CLIENT DISCONNECTED"
# Check if the log file exists before proceeding
if (-Not (Test-Path $logFilePath)) {
Write-Error "Log file does not exist: $logFilePath"
exit
}
# Monitor the log file for new content
Get-Content $logFilePath -Wait | ForEach-Object {
if ($_ -match $matchPatternClientConnected ) {
# When the pattern is matched, execute the batch file
Start-Process -WindowStyle hidden -FilePath $connectedBatchFilePath
}
if ($_ -match $matchPatternClientDisconnected ) {
# When the pattern is matched, execute the batch file
Start-Process -WindowStyle hidden -FilePath $disconnectedBatchFilePath
}
}
Lastly, almost done, open the Task Scheduler, create a folder named Sunshine and import the XML file as a task (you have to save the content below as text XML file, for example SunshineExtraScripts.xml):
<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.4" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
<RegistrationInfo>
<Date>2024-12-24T14:54:57.5504533</Date>
<Author>THAERNITRO5\RebelliousX</Author>
<Description>For Sunshine Game Streaming. This powershell script will run at startup. And it will monitor the `sunshine.log` file to see if there are any new matching `CLIENT CONNECTED` or `CLIENT DISCONNECTED` strings. And executre specific batch file in each case. This happens when Moonlight gets minimized but session is going (not quitting session compeletly) or when joining session again.</Description>
<URI>\Sunshine\SunshineExtraScripts</URI>
</RegistrationInfo>
<Triggers>
<BootTrigger>
<Enabled>true</Enabled>
</BootTrigger>
</Triggers>
<Principals>
<Principal id="Author">
<UserId>S-1-5-18</UserId>
<RunLevel>HighestAvailable</RunLevel>
</Principal>
</Principals>
<Settings>
<MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
<DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>
<StopIfGoingOnBatteries>true</StopIfGoingOnBatteries>
<AllowHardTerminate>true</AllowHardTerminate>
<StartWhenAvailable>false</StartWhenAvailable>
<RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
<IdleSettings>
<StopOnIdleEnd>true</StopOnIdleEnd>
<RestartOnIdle>false</RestartOnIdle>
</IdleSettings>
<AllowStartOnDemand>true</AllowStartOnDemand>
<Enabled>true</Enabled>
<Hidden>false</Hidden>
<RunOnlyIfIdle>false</RunOnlyIfIdle>
<DisallowStartOnRemoteAppSession>false</DisallowStartOnRemoteAppSession>
<UseUnifiedSchedulingEngine>true</UseUnifiedSchedulingEngine>
<WakeToRun>false</WakeToRun>
<ExecutionTimeLimit>PT0S</ExecutionTimeLimit>
<Priority>7</Priority>
</Settings>
<Actions Context="Author">
<Exec>
<Command>powershell.exe</Command>
<Arguments>-ExecutionPolicy Bypass -NonInteractive -WindowStyle Hidden -File "C:\SunshineExtraScripts\Do_Undo_at_Connect_Disconnect.ps1"</Arguments>
</Exec>
</Actions>
</Task>
Right click on the imported task and select Run.
Enjoy!
It seems this issue hasn't had any activity in the past 90 days. If it's still something you'd like addressed, please let us know by leaving a comment. Otherwise, to help keep our backlog tidy, we'll be closing this issue in 10 days. Thanks!
Please keep it open. It would be good to get resolved.
I second the motion proposed by @mintjberry
Holy s*** I figured it out lol, in moonlight settings check the box "play audio on PC"..... I have been trying to figure this out for days and yes it was that simple for me. I believe this will fix the issue of audio disappearing after stopping and resuming a session 🥴
I've only encountered it just now with STALKER Anomaly/GAMMA.
Disabling "mute sound on remote PC" is a workaround.
Same issue here with deltarune chapter 2 demo I legitimately downloaded from steam. Came here form the closed moonlight post, which I found form Google. Fking works for me. This post is a lifesaver, thanks
Please keep this issue open. I'm experiencing this as well
Having this same issue, regardless of client device. What seems to work sometimes for me is disconnecting session (go back to host select) force close the app in task switcher (I’m using iOS and fire cube) then relaunch. This seems to fix the issue until the next time I disconnect and reconnect.
Again, the main fix for this issue is not having the sound device disappear while the game is running. In Moonlight, turning the setting to allow the audio to play on PC mainly fixes the issue. But what if you don't want the audio to play on PC? the script above to monitor the log file fixes the issue until Sunshine implements Do / Undo commands for session reconnects / disconnects.