lyckantropen / moonlight_hdr_launcher

Launch anything in HDR mode using Moonlight
MIT License
73 stars 5 forks source link

Shut down gamestream session upon exit #9

Closed ReenigneCA closed 2 years ago

ReenigneCA commented 2 years ago

I'm currently using moonlight hdr launcher with gamestream_launcher (with some modifications I haven't pushed yet,) to launch playnite. When playnite exits gamestream launcher exits and hdr launcher exits but the gamestream session remains open. This is because I disabled the part of gamestream_launcher that kills the nvidia streamer process. What I'm wondering is why gamestream doesn't shut down gracefully when the fake mass effect andromeda game process ends. I tried fiddling with the StreamSettings.json file with no luck. My best guess at this point is that gamestream is looking for a win32 GUI window maybe? I might eventually look a bit deeper was wondering if there is any experience with this issue already.

ReenigneCA commented 2 years ago

After posting the above I did a quick test. I replaced the MassEffectAndromeda.exe file in my moonlight_hdr_launcher folder with the compiled version of the sample win32 app from visual studio 2022. The app just creates an empty window. When I do this if I close the window the stream ends automatically and gracefully. I plan on doing a pull request to add an option to create and later close an empty window gotta get to some regular life stuff first.

lyckantropen commented 2 years ago

Thanks for looking at this. Unfortunately I can't spare the time right now to try and address this so feel free to poke around and create a PR.

ReenigneCA commented 2 years ago

here is the pull request This appears to work perfectly for me. I don't bother to error check window creation because 1 it seems to work and 2 if it doesn't best we can do is just press on anyway. Rather than make a flag for this it seems to me it always makes sense when we're waiting on a process and never otherwise.

lyckantropen commented 2 years ago

I've merged the PR into develop and made some of my own changes. There's a new release. Have a look.