Nonary / ResolutionAutomation

Automates changing the host resolution to match the client resolution of Moonlight, with capabilities of supersampling if required
The Unlicense
681 stars 19 forks source link

Resolution reverts after exiting game #76

Open GimmickyMoniker opened 2 months ago

GimmickyMoniker commented 2 months ago

i'm streaming to a secondary monitor that's 1080p (my main display is 2K), when I start moonlight and go to desktop it successfully matches resolution, however, with most games I play when I exit the game, my resolution goes back to 2K despite playing on the 1080p monitor. Please advise how I can fix this.

Nonary commented 2 months ago

The script is designed for one monitor only, please use https://github.com/Nonary/MonitorSwapAutomation to force your machine to swap to one monitor while streaming and that should resolve your issue

GimmickyMoniker commented 2 months ago

I'm confused as to how Moonlight can be only ran with one monitor, isn't the whole point of the program to stream games/programs ect from a PC to a second screen? are there people running it with no monitor at all? The monitor attached to my PC is not on while I run moonlight.

GimmickyMoniker commented 2 months ago

When i say secondary monitor, I mean I'm streaming moonlight through a Steam Link hooked up HDMI to another display, I'm not running multiple monitors hooked up to my computer at the same time.

Nonary commented 2 months ago

Check the Log File: The script log file can help determine if the resolution change is being properly handled. Please upload the log.txt file located in the folder where the script is installed (or in the logs folder, sorted by date). This will allow me to see if the script successfully changes the resolution after exiting the game.

Borderless Windowed Mode: Ensure that your games are running in borderless windowed mode instead of fullscreen. The script works best when games are set to borderless windowed mode because it inherits the resolution from the desktop games that use fullscreen modes will not work with the script.

GimmickyMoniker commented 2 months ago

log.txt

There are several games I play that don't support borderless window mode. It's frustrating it resets to 2K when leaving a game, even if the game's resolution is 1080p. this didn't happen when I used the version of this script that supported GFE.

Nonary commented 2 months ago

log.txt

There are several games I play that don't support borderless window mode. It's frustrating it resets to 2K when leaving a game, even if the game's resolution is 1080p. this didn't happen when I used the version of this script that supported GFE.

That logs shows that it has been set to 1080p but did not make any changes afterwards, so if you're noticing that the desktop keeps changing to a specific resolution it is unrelated to this script. Are you running any other scripts with Sunshine?

GimmickyMoniker commented 2 months ago

This is the only one I've downloaded. The only changes I've made is I used the GFE version then switched to the "main" one after updating my Nviida App and now it does this.

GimmickyMoniker commented 2 months ago

It seems something about the launching of the games this happens to sets the resolution back to the default

xDaveN commented 1 month ago

@Nonary The title of this issue represents what I'm experiencing, but my setup is different. I'm streaming from a 3440x1440 display to a 4K TV through a NVIDIA Shield. My moonlight is setup to receive 1080p 120fps. I launch my stream into Playnite (a game launcher) which successfully prompts the resolution switch to 1080p. Launching a game retains the correct resolution, however whenever I close said game my resolution reverts to 3440x1440 - I would like to remain in 1080p within Playnite, in case I want to switch to another game.

Not sure if this issue is related to your script, or if Playnite somehow forces my monitors native res. Would appreciate some advice. :)

KlosiakMK commented 1 month ago

Same here and as above. I am using the Sunshine + Moonlight combo to stream games in 4K resolution. I have 3840x1600 monitor connected to my host PC and custom resolution of 3840x2160 120Hz added because this is the stream parameters that I am using for my 4K TV. I am streaming my host PC desktop and running all the games from the streamed desktop. When starting desktop stream everything works fine and 3840x1600 resolution is switched to 3840x2160. The problem is when game/app use fullscreen mode. After closing game/app resolution of a streamed desktop is reverted to 3840x1600 and I have black bars on the top/bottom of my TV. I can set 4K resolution manually and this still works but I am wondering why script is behaving in such a way. The issue can be easily recreated using Heaven/Valley benchmarks in fullscreen setting on a streamed desktop.

Nonary commented 1 month ago

Same here and as above. I am using the Sunshine + Moonlight combo to stream games in 4K resolution. I have 3840x1600 monitor connected to my host PC and custom resolution of 3840x2160 120Hz added because this is the stream parameters that I am using for my 4K TV. I am streaming my host PC desktop and running all the games from the streamed desktop. When starting desktop stream everything works fine and 3840x1600 resolution is switched to 3840x2160. The problem is when game/app use fullscreen mode. After closing game/app resolution of a streamed desktop is reverted to 3840x1600 and I have black bars on the top/bottom of my TV. I can set 4K resolution manually and this still works but I am wondering why script is behaving in such a way. The issue can be easily recreated using Heaven/Valley benchmarks in fullscreen setting on a streamed desktop.

Without the logs I can't really troubleshoot your issue please upload them

KlosiakMK commented 1 month ago

Same here and as above. I am using the Sunshine + Moonlight combo to stream games in 4K resolution. I have 3840x1600 monitor connected to my host PC and custom resolution of 3840x2160 120Hz added because this is the stream parameters that I am using for my 4K TV. I am streaming my host PC desktop and running all the games from the streamed desktop. When starting desktop stream everything works fine and 3840x1600 resolution is switched to 3840x2160. The problem is when game/app use fullscreen mode. After closing game/app resolution of a streamed desktop is reverted to 3840x1600 and I have black bars on the top/bottom of my TV. I can set 4K resolution manually and this still works but I am wondering why script is behaving in such a way. The issue can be easily recreated using Heaven/Valley benchmarks in fullscreen setting on a streamed desktop.

Without the logs I can't really troubleshoot your issue please upload them

Hi Nonary. Sure thing about the logs. Which one are needed and how to do them?

Caspium commented 1 month ago

Here to report the same issue. Here's my logs: log.txt

Using Sunshine+Moonlight from Windows PC to Moonlight on Google TV When streaming via moonlight, resolution successfully changes Upon exiting game, resolution reverts and I'm in Steam Big Picture with my ultrawide resolution

rocktale commented 3 weeks ago

Seems like I have the same issue with Steam Big Picture mode. After playing a game that I started from within Big Picture mode the resolution reverts back from the 4k (on my AppleTV) to the Ultrawide that I usually use from my computer. Closing Big Picture and restarting it (from Moonbeam) solves this issue but it would be nice if the resolution was just kept. What about an option to skip reverting back altogether? My sunshine host is only used remotely without a real monitor attached, thus there is no native / real resolution anyway.

Nonary commented 3 weeks ago

I’m not able to replicate this issue on my machine so I don’t have any idea why people are experiencing a resolution revert before the stream gets terminated because every log that gets posted is showing that it’s not being reverted before they ended the stream

xDaveN commented 3 weeks ago

Not gonna post my log because it's just as inconclusive as the others. But hey, now you know your logging method is somewhat faulty. Where does the script grab the current resolution from?

Seems like many people in here having this issue are using a non 16:9 native res on their monitors, so maybe that's related.

Quick question to the others having this issue. Are you guys running some kind of a G-Sync/FreeSync setup - potentially with FPS cap or other changes in Nvidia control panel/AMD equivalent?