Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switching Audio output during gaming session can potentially render the games frozen #3430

Open
2 tasks done
RebelliousX opened this issue Dec 5, 2024 · 2 comments
Open
2 tasks done

Comments

@RebelliousX
Copy link

RebelliousX commented Dec 5, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Is your issue described in the documentation?

  • I have read the documentation

Is your issue present in the latest beta/pre-release?

None

Describe the Bug

It happens with some games for example Prince of Persia Forgotten Sands from Steam.
The game runs fine, but if I exit the session while the game is still running, trying to join the session again
the game is frozen, but streaming still happening. And if I exit the session in the game menu, and resume
the session, the animation of the main menu of the game is frozen, but the mouse still active.

In task manager, it shows the process of Prince of Persia is not responding with 0 percent of activity.

This started happening about a month or so ago. I believe around the commit where resuming session or some audio changes
I really can't remember exactly. But less than 2 months for sure. I wish I have access to prior pre-release builds. The actions / runs doesn't have any installers or builds to test. I can't compile the code unfortunately.

I thought this is due to recent Windows 11 24H2, so I wiped the system and installed latest Windows 10 22H2, same issue.

Nvidia driver v566.14, I downgraded to a 2 month older driver v561.09. I tried both Game Ready and Studio drivers, same thing.

Expected Behavior

To be able to resume the session without crashing the game

Additional Context

I tried Intel encoder, software encoder. Same thing.

I tried installing Virtual Display Driver, the game didn't freeze, but since I was selecting the Virtual monitor and the game starts on the default monitor, I couldn't see anything except the wallpaper of monitor 2. But the game didn't freeze.

Host Operating System

Windows

Operating System Version

Tried both Windows 11 v24H2 and Windows 10 v22H2 fully updated

Architecture

amd64/x86_64

Sunshine commit or version

v2024.1204.170534

Package

Windows - installer (recommended)

GPU Type

none (software encoding), hardware encoding, nothing seems to work.

GPU Model

GTX 1050ti / Intel 630

GPU Driver/Mesa Version

see above

Capture Method

I tried both DXGI (running as service) and WGC (running as admin, not as service), still same issue.

Config

No response

Apps

No response

Relevant log output

output doesn't show any errors.
@RebelliousX
Copy link
Author

RebelliousX commented Dec 10, 2024

I installed Geforce Experience and enabled Game Stream, there are no freezes for the games. With sunshine, the games freezes whether it is a windowed or full-screen mode (more games have this now), but only when resuming the session. Geforce Experience has low frame-rates in 30s compared to sunshine solid 60 for some reason. Steam Link works, but the game controller setup is retarded there and lots of stuttering.

I hope this gets fixed, I tried everything, disabling HAGS, realtime priority. I am not even using GTX 1050ti to encode, I used Intel iGPU and even Software Encoding, same thing.

@RebelliousX
Copy link
Author

RebelliousX commented Dec 23, 2024

Update, I was able to pinpoint the cause of this. It seems lots of games don't like it when audio output device change while the game is running. This happens when Sunshine switch to Steam Streaming Speakers while game is running from another Audio output device. The game thinks the sound card was physically yanked from motherboard or something.

A workaround for now is to have Moonlight to play audio on host, which prevents the audio switching during game play. The problem is I don't need audio on host (main PC). So I downloaded SetVol app from here on github and added command for DO and Undo like

For Do:

C:\temp\SetVol mute

For Undo:

 C:\temp\SetVol unmute

Which works great. The issue is, the UNDO command doesn't run when the client gets disconnected, but only when session quits. That is, if I minimize Moonlight, the client disconnects, streaming stops, but Volume still muted. If I open Moonlight and force session to quit, the Undo command runs.

I also have similar issue when running VDD trying to run UNDO command when client disconnect, for example Moonlight on Shield TV (session is on, just Moonlight minimized). The Undo command to switch back to main display doesn't run until I force quit the session from Moonlight.

This is another issue I would like to have it resolved. To run UNDO command on client disconnects, not just Session quits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant