-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Remote session defaults to Audio sink after pausing and resuming Stream #2913
Comments
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: moonlight-stream/moonlight-android#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 The way I workaround this issue is having:
So I downloaded Create a folder in C drive called For @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 @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 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 Note: If you installed Sunshine in a non-default directory, modify the path of $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 <?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 Enjoy! |
Is there an existing issue for this?
Is your issue described in 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,
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
Apps
Relevant log output
The text was updated successfully, but these errors were encountered: