Skip to content
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

Toggle HDR off #20

Open
Maz111111 opened this issue Oct 6, 2022 · 7 comments
Open

Toggle HDR off #20

Maz111111 opened this issue Oct 6, 2022 · 7 comments

Comments

@Maz111111
Copy link

There is the option "toggle HDR = 1" which will turn the HDR mode on the host Monitor to "on" when the stream starts and switches it back to "off" when the stream ends.
In my case the host monitor is set to HDR "on" all the time and I want to stream to non HDR clients.
Is there i comand like "toggle HDR off = 1" or similar, which disable HDR on the host system when the stream starts and enables it again when the stream ends.

By now I use a solution via powershell script which sends the keys "win" + "alt" + "b" when the stream starts and sends it again when i close playnite. this works.

But maybe it would be more confortable with an option within your litte tool.

@ReenigneCA
Copy link
Contributor

unless you rely on other functionality if you just stream games without the launcher or using something like steam or playnite it will turn HDR off when you stream them. The default with gamestream is hdr off which is why hdr_launcher is needed for games that aren't specifically supported in hdr mode.

@Maz111111
Copy link
Author

Maz111111 commented Oct 11, 2022

Thank you very much for your reply.
Unfortunately, it doesn't quite address the problem. I permanently turned on HDR on the host PC in windows/system, because my monitor on my host PC is HDR capable and HDR looks good on it. Sometimes I stream to a HDR-capable device (my TV in the living room). But if I now stream to a device that is not HDR-capable (e.g. steam deck or a tablet), HDR is not switched off on the host in the system and an HDR image is streamed. On the client, the colors are completely distorted and the image is much too bright.
Before the stream, I first have to switch off HDR in the system in order to get a normal image on the client. I am currently doing this with a Powershell script and a seperate batch file (not with HDR Launcher - it's programmed by myself with some massive help from the moonlight discord channel) which sends the keyboard command "win" + "Alt" + "b", then waits until Playnit is closed and then first ends the stream with Killtask and then sends the key combination again so that after the stream the system sends an HDR signal to the monitor again.
This works quite well, but "killtask" means that it takes forever until the stream is actually ended and a pop-up message appears that the stream has ended, which you have to confirm.
On the one hand, HDR Launcher manages to switch the HDR setting in the system and also to end the stream quickly without a pop-up. That's why a Toggle HDR off command would be beneficial. I just wanted to know if there is such a command undocumented. It wasn't meant as an issue.
In order not to open a new issue, I'll ask something here. When I stream to my HDR capable TV with HDR Launcher and end the stream by closing Playnite, I still have to turn on mouse in moonlight and click and focus on the minimized window in the windows tskbar for HDR Launcher to actually end the stream. This happens automatically on all other devices. I can not understand the error. Can someone help with this? Thanks

@ReenigneCA
Copy link
Contributor

Can you confirm which operating system you're using? Also can you confirm you're using GeForce Experience on the host machine and moonlight on the devices you're streaming to and you aren't using moonlight_hdr_launcher but HDR still remains on?

For your other question, you're using moonlight_hdr_launcher and running playnite through the launcher? What have you tried that didn't work? The intended approach is that you quit playnite which will cause hdr_launcher to quit and the stream to end.

@Maz111111
Copy link
Author

Maz111111 commented Oct 11, 2022

Hey,
I am on windows 11 on the Host. On the Host geforce experience is installed on the clients I use moonlight. When I start a stream to any client (shield, tablet, steam deck) - not using moonlight HDR Launcher - HDR remains on in the system settings of the host pc. When i stream to my tv i have to use either steam big picture or hdr launcher for it to switch to hdr. Or I have to use the trick with Mass effect andromeda (rename the .exe).

If I turn off HDR in the host's system and use moonlight HDR Launcher, Win11's settings automatically turn HDR on when the stream starts (and my TV also gets a signal to switch to HDR) and turn it off automatically when the stream ends . That's why I thought you could do it the other way around and turn HDR off automatically when the stream starts in the win11 system and turn it back on automatically after the stream ends.

The other Question,
Yes, I am using moonlight_hdr_launcher and running playnite through the launcher.
I am using:
[options]
launcher_exe = gamestream_launchpad.exe playnite.ini --no-nv-kill
toggle_hdr = 1
wait_on_process = 1
compatibility_window = 1

Normally the stream should end automatically as soon as I close Playnite. This works on all clients (I streamed to non-HDR capable devices with moonlight HDR launcher for test purposes). Only when I stream to the shield (shield sends a signal to the audio receiver and this sends a signal to the TV) does it not work. When I exit Playnite, the stream persists and I see the desktop on my TV. In the taskbar, the window (tooltip is "do not close this window" or something) is minimized. I need to turn on mouse support in moonlight. and then click on the minimized window in the taskbar. This is then opened and the stream is ended immediately without the "Connection terminated" message after quitting. On the other clients it works automatically with the same host and the same configuration without having to click on the window. It's hair-pulling :)

@ReenigneCA
Copy link
Contributor

I'll take a look at your first issue when I get a chance (will likely be a few days at least,) I've never seen this before it might be related to a change in the latest versions of either windows 11 or geforce experience.

For your second issue unfortunately it is likely a steam deck thing and I don't have one to test with. gamestream detects the window created by a program and shuts down the stream gracefully once the window closes. moonlight_hdr creates such a window and then waits for the program you open with it to close at which point it closes its window and the stream ends. I really have no idea why this would be different on a steam deck. It might be something related to the moonlight client on steam deck for all I know. It might also be fixable from within moonlight_hdr but it would be a nightmare to figure out without having my hands on one of them for a while. I added the patch to shut the stream down gracefully but maybe the maintainer has a steam deck or there is another out there who could do it.

@Maz111111
Copy link
Author

Before it comes to useless work. It's not the Steam Deck that's my problem. The stream does not end when I stream from Host PC to TV via Shield. When I stream to the Steam Deck it works great. Don't put too much energy into it now. In the end your tool works.
However, I am surprised that you think that HDR should be switched off automatically when I stream to a non-HDR capable device. That would mean that the host would somehow be able to recognize whether the client can do HDR or not, or whether the client in turn sends a corresponding signal to the host. In the Moonlight Discord Channel, a mod claims that moonlight is unable to do this.

@ReenigneCA
Copy link
Contributor

ReenigneCA commented Oct 11, 2022

sorry I don't know why I misread the part about the shield. I was close to the wire on leaving for work and had just done a heavy upper body workout so probably that :P I actually use shields at home the auto disconnection was built and tested initially with both an original and the new shield tv (not the pro the tube one.) I just confirmed and it works correctly for me. My moonlight_hdr_launcher.ini file is:

[options]
 # command to launch when the launcher is executed  
 #launcher_exe=notepad.exe
 #launcher_exe=gamestream_launchpad.exe 2560 1440 -r 120 --skip-res-reset --no-nv-kill gamestream_playnite.ini
 launcher_exe=C:\Users\username\AppData\Local\Playnite\Playnite.FullscreenApp.exe
 #remote_desktop=1
 res_x=2560
 res_y=1440
 refresh_rate_use_max=1
 disable_reset_display_mode=1
 hdr_bpc=10 #my dev branch supports 10 bit colour channels I'm not sure if this pull request is in yet
 # wait for the launcher process to exit or detach immediately
 # useful with gamestream_launchpad to close the connection
 # and with toggle_hdr=1
 wait_on_process = 1
 
 # enable HDR on all supported monitors 
 # only works with wait_on_process=1
 enable_hdr = 1

Unless you're running other custom programs I'd just remove gamestream_launchpad. I actually added a bunch of functionality to it and then just ported it to moonlight_hdr_launcher because I couldn't deal with the slow startup times. I'm guessing it has something to do with your issue, it might just be taking a really long time to quit and if you just leave things and sit and wait they might work eventually.

As for detecting and switching off HDR that's not what I was getting at. moonlight_hdr_launcher tricks gamestream into going into HDR mode even if the game you want to play isn't supported. So the other side of that is that if you play a non-hdr supported game (which is almost all of them and includes playnite,) HDR will not be on when you establish a gamestream connection. So when you want to play in HDR use moonlight_hdr_launcher, when you want SDR just pick the game directly in gamestream or add playnite manually and choose playnite directly (ie without the launcher in between). This should solve the problem for games that actually do support gamestream hdr but you want to play in SDR. With some modern games you might find they toggle hdr on themselves and you might have to tweak their settings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants