FrogTheFrog / moondeck-buddy

A server-side part of the MoonDeck plugin for the SteamDeck.
GNU Lesser General Public License v3.0
151 stars 9 forks source link

Streaming at resolution higher than host, MoonDeckStream.exe issue & g-sync request #51

Closed philhzss closed 1 year ago

philhzss commented 1 year ago

Hi FrogTheFrog it's me again,

I tried something that I didn't even think possible, it worked, but I ran into minor issues so I wanted to ask you about it. Although this is maybe pushing it, perhaps Moondeck isn't intended for this.

My main PC has a 1440p @ 144hz monitor. My TV is a rather cheap but 4k @ 60hz panel. I've been docking my Deck to the TV and streaming games from the PC with Moondeck for a while, but I was always doing it at 2560 x 1440, I assumed I could never go above my host's resolution. Well it turns out I can, using NVIDIA control panel -> Change resolution -> Customize, I was able to add a "fake" resolution of 3840 x 2160 at 60hz. Now, my games show that resolution in their settings, and if I configure MoonDeck to have 3840 x 2160 as a custom resolution and launch a game; I can play in 4k! Even though my PC is only 1440p.

I noticed 2 problems:

  1. GSYNC. My PC's monitor has G-SYNC, I always leave it on, but as I was streaming I was noticing some weird framerates.. I tried turning G-sync off and suddenly the FPS was fluid. So my request is this; would it be possible to make MoonDeckBuddy automatically disable G-Sync when streaming, and then re-enable it when finished streaming? I had never really noticed the issue before, so maybe this only affected me at 4k... but maybe it's always "somewhat" slowing the stream down?

  2. Not sure if game specific (Hogwarts Legacy) or MoonDeck specific.. but when I was streaming Hogwarts Legacy in 4k, I was generally getting fairly decent framerates (45-60 most of the time), and everything was fine. However, in some occasions the image would completely freeze, yet sound would continue. I could then go directly into the MoonLight app on the Deck, and if I selected "resume MoonDeckStream"; I had the same frozen image. However, if I selected any other app in Moonlight (such as "Desktop"), I would see the game running and I could keep playing. I noticed the MoonDeckStream.exe was stuck, I had to end the process in task manager and then it would work again if I selected the MoonDeck shortcut.

This specific problem seemed to occur when I was in a "GPU intensive scene" if it helps? I had just entered a new room, or something like that. Depending on what I was doing in game, sometimes I could go 30 mins without a freeze, and sometimes it would freeze every 2 mins. Weirdly, it only happens with MoonDeckStream.exe. If I play using MoonLight's "Desktop" shortcut, it doesn't freeze. I don't have any logs for this because I'm not sure what you need, and if you want them, but if you'd like I should be able to reproduce this fairly easily.

Thank you!

FrogTheFrog commented 1 year ago

Heyo,

I think what you're asking is a little out of scope for MoonDeck :/.

The 1st problem I can also replicate. I don't know how to disable it manually via cmd, but if you find a way then you can do it via the do/undo commands in Sunshine.

As for the 2nd problem, I think you might be encountering this issue https://github.com/LizardByte/Sunshine/issues/1031 ? It is specific for NVidia and I also encounter that. The problem here lies in the drivers and to recover you need to restart the stream. It also happened from time to time for me, also in the same game :D, but also with the Desktop mode.

However, let's say it is a MoonDeckStream specific issue, then I have no idea what to do. If you look at the code (https://github.com/FrogTheFrog/moondeck-buddy/blob/main/src/stream/main.cpp), you will see that is a very simple process. It simply check where it needs to shutdown or not every second or so.

The Sunshine actually always streams the "Desktop", however if you provide an executable it will additionally monitor the lifetime of the executable and will terminate the "Desktop" stream once the executable is dead. This is the only purpose of MoonDeckStream - to die so that Sunshine can now when to stop streaming.

philhzss commented 1 year ago

Hey, Thank you for being so generous with your time. You're right it is a little out of scope, so I will close the issue and update if ever I have any noteworthy updates.

Noted for g-sync, I haven't messed with the do/undo commands in Sunshine, good idea. I will do a bit of research and see if this is possible.

As for 2nd problem... well now that you mention it. I didn't really play a long time using the "Desktop" shortcut (everything looked weird on my TV, but with MoonDeckStream and MoonDeck launcher it was all good, probably something to do with the custom resolution being passed by MoonDeck). Point is, perhaps the issue would actually have happened, if I had waited long enough on Desktop.

Now that I think of it... since I only play at 1440p on my main PC. And this game is quite demanding. I suppose it is very possible that at 4k, I know have high VRAM usage. I think you're right, I'll monitor that issue you linked. Thank you!!

I'll close this, thanks a lot for your suggestions and help!!!

FrogTheFrog commented 1 year ago

@philhzss Regarding the gsync request. I also needed this for do/undo command, so...

image

https://github.com/FrogTheFrog/gsync-toggle

philhzss commented 1 year ago

Oh damn. Really!!! I'm not home right now, but I spent 2h looking for a way to do this earlier. I will def try your script/app when I get home. Thank you!!!!!!

FrogTheFrog commented 1 year ago

@philhzss For this tool to work properly with MoonDeck, you'll need to upgrade it to 1.5.4 for reasons you can read in the changelog :/

philhzss commented 1 year ago

@FrogTheFrog You are a genius. It works PERFECTLY.

THANK YOU!!!!

And no need to say "you'll need to upgrade :/" I am always upgrading to the latest versions of your stuff because your stuff is amazing.

FrogTheFrog commented 1 year ago

@philhzss Thanks for the kind words :D