Skip to content

Reverting Resolution after 120 seconds #74

@bayramog

Description

@bayramog

Hello,

Thanks for all your automation scripts which make Moonlight + Sunshine experience more seamless for us! I have very basic setup with MonitorSwapper and ResolutionAutomation. Firstly my MonitorSwapper changes my monitor to a Dummy one which is a working automation. Then ResolutionAutomation changes my resolution to desired state. Which is again working. So I can enter with my setup to desired monitor and resolution. But since I dont end stream, while in the stream ResolutionAutomation revert its changes after 120 seconds which is delay timeline for Sunshine suspension. The odd thing is I am still in the stream and there is no suspension on Sunshine. Also MonitorSwapper acts same as ResolutionAutomation. After its delay it also changes to primary screen since I am in the stream. Cannot solve the issue own by own. Here is the log for ResolutionAutomation.


Windows PowerShell transcript start
Start time: 20240809140700
Username: GamingOS\bayramog
RunAs User: GamingOS\bayramog
Configuration Name:
Machine: GamingOS (Microsoft Windows NT 10.0.22631.0)
Host Application: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -File C:\ResolutionMatcher\ResolutionMatcher.ps1 -async True
Process ID: 29604
PSVersion: 5.1.22621.3958
PSEdition: Desktop
PSCompatibleVersions: 1.0, 2.0, 3.0, 4.0, 5.0, 5.1.22621.3958
BuildVersion: 10.0.22621.3958
CLRVersion: 4.0.30319.42000
WSManStackVersion: 3.0
PSRemotingProtocolVersion: 2.3
SerializationVersion: 1.1.0.1


Transcript started, output file is .\log.txt

Id Name PSJobTypeName State HasMoreData Location Command


1 ResolutionMa... BackgroundJob Running True localhost ...
3 ResolutionMa... BackgroundJob Running True localhost ...
Waiting for the next event to be called... (for starting/ending stream)
Processing event: Start
Before Override: 3840 x 2160 x 120
After Override: 3840 x 2160 x 120
Setting screen resolution to 3840 x 2160 x 120
Resolution changed successfully.
Still waiting for the next event to fire...
Processing event: End
Setting screen resolution to 1920 x 1080 x 120
Resolution changed successfully.


Windows PowerShell transcript end
End time: 20240809140903


This one for MonitorSwapper.


Windows PowerShell transcript start
Start time: 20240809140649
Username: GamingOS\bayramog
RunAs User: GamingOS\bayramog
Configuration Name:
Machine: GamingOS (Microsoft Windows NT 10.0.22631.0)
Host Application: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -Command & 'C:\MonitorSwapper\StreamMonitor.ps1' -scriptName MonitorSwapper -sib 1
Process ID: 8676
PSVersion: 5.1.22621.3958
PSEdition: Desktop
PSCompatibleVersions: 1.0, 2.0, 3.0, 4.0, 5.0, 5.1.22621.3958
BuildVersion: 10.0.22621.3958
CLRVersion: 4.0.30319.42000
WSManStackVersion: 3.0
PSRemotingProtocolVersion: 2.3
SerializationVersion: 1.1.0.1


Transcript started, output file is .\logs\log_1723212410.txt
Waiting for the next event to be called... (for starting/ending stream)
Processing event: Start
Dummy plug activated
Processing event: GracePeriodExpired
Stream has been suspended beyond the defined grace period. We will now treat this as if you ended the stream. If this was unintentional or if you wish to extend the grace period, please adjust the grace period timeout in the settings.json file.
INFO: System.Collections.Hashtable
INFO: Stream has ended, now invoking code
INFO: Primary monitor(s) have been successfully restored!


Windows PowerShell transcript end
End time: 20240809142202


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions