-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Stream does not start on hybrid AMD/NVIDIA laptop using HDMI dummy plug #1664
Comments
Hybrid graphic setups have this issue, pretty sure there is no way around this problem other than disabling hybrid GPU in BIOS. |
Can you try my script and see if it works though? I wonder if monitor switcher just causes problems in Sunshine https://github.com/Nonary/MonitorSwapAutomation/releases |
I've already tried this script before and it works the same as monitorswitcher. |
It seems this issue hasn't had any activity in the past 90 days. If it's still something you'd like addressed, please let us know by leaving a comment. Otherwise, to help keep our backlog tidy, we'll be closing this issue in 10 days. Thanks! |
If anyone is still having this issue. I have found a work around. This work around is also able to be done remotely. Create a batch file called "Stream Setup" The name does not matter and can be named anything just keep track of its location and name as this will be the batch file that will be started by sunshine. Stream Setup should contain this code.
Replace "path to" with the path of Stream Setup Tasks.bat. Now create the batch file Stream Setup Tasks.bat. Once again name does not matter as long as you keep track of the location and name. Stream Setup Tasks Should contain this code.
Copy Stream Setup and name it "Stream End". Change "Path to\Stream Setup Tasks.bat" To Path to\Stream End Tasks.bat". Copy "Stream Setup Tasks". Change "DisplaySwitch 4" to "DisplaySwitch 1" or "DisplaySwitch 3" depending on your setup. DisplaySwitch 3 is extend. DisplaySwitch 1 is only the internal screen. Now go into the sunshine UI. And add a new app. Call it whatever you want. For this guide we will call it Stream Setup. Make sure that this app is run as admin and that global prep commands are disabled. In the commands section put Path to\Stream Setup.bat" without the "". Leave everything else blank. Then Add a new global prep command. Leave the do section blank. In the undo section put "Path to\Stream End.bat". Run this command as admin. Make sure you have nothing set for either the graphics card or the output screen. This only works on windows. To use, run the app Stream Setup before starting your stream. Sadly this app will have to be run every time you stream. It will then Run "Stream Setup.bat". That bat File will then run. "Stream Setup Tasks.bat". "Stream Setup Tasks.bat" will stop sunshine, then change the display to the dummy plug and restart sunshine. This will allow sunshine to use the dummy plug. Wait for sunshine to restart. Then you are free to launch whatever app you want. When you end the stream, it will run "Stream End.bat". That will then run "Stream End Tasks.bat" Which will restart sunshine and change back to your primary monitor. The reason you have to have the batch file referenced by sunshine only open another batch file is otherwise the batch file will end when sunshine restarts. Hope this helps. |
Finally I've managed to solve this problem even without using HDMI dummy stick. For this you should use one of the "virtual monitor" drivers. Personally I recommend this one - https://www.amyuni.com/forum/viewtopic.php?t=3030 as it allows "hotplugging" and "unplugging" by executing shell commands. So to use it with sunshine you have to:
I don't know why but when I execute "enableidd 1" command - display output changes automatically to virtual display (if resolution is set to 1280*800 for it). If that doesn't happen for you - create a bat file and add "DisplaySwitch 4" after "enableidd 1" command. Of course then use this bat file as "do" command in sunshine. |
I tried that originally but for me the screen kept being assigned to the internal intel card. So I could never use that option unless I had a dummy plug attached to my nvidia card no amount of screen switching would work for me when I tried that. |
Is there an existing issue for this?
Is your issue described in the documentation?
Is your issue present in the nightly release?
Describe the Bug
I have a Lenovo Legion 5 15ACH6H laptop.
It has hybrid AMD/NVIDIA graphics (Radeon integrated in Ryzen 5800H cpu and dedicated RTX 3060). In BIOS settings hybrid graphics setting is turned ON.
What I'm trying to achieve is to turn off the laptop monitor and switch the video output to the dummy HDMI plug when stream is started. So when stream ends - laptop monitor should be enabled again and HDMI plug disabled.
So I've installed monitorswitcher app (https://sourceforge.net/projects/monitorswitcher/) and created 2 profiles for laptop screen only (saved in main.xml file) and hdmi plug output only (streaming.xml file).
Also I've set do/undo commands in sunshine settings:
So the problem is when I try to stream any game in moonlight client (on a steam deck) - laptop monitor turns off as expected, default video output switches to HDMI plug (I've checked that for sure via VNC), stream starts for 1 second and then immediately stops with an error (Connection terminated). While in sunshine logs I see these lines:
I think the problem is that sunshine continues trying to use AMD GPU to capture the stream while HDMI plug is actually connected to NVIDIA GPU directly and stream goes there bypassing AMD GPU after the switch. Maybe it's because the capturing GPU is selected once on sunshine service start, but I think it should be dynamically selected before every stream start and AFTER prep commands execution (of course in case that there is no specific GPU/monitor set in sunshine settings).
Expected Behavior
Stream should start without any errors
Additional Context
I've managed to somehow bypass this bug by disabling sunshine service automatic startup on system start.
So at first I switch the monitor output to HDMI plug and only after that start sunshine service manually.
I use this bat script for that purpose:
Only in this case sunshine correctly detects connected HDMI plug and streaming works well. But it's an ugly solution IMO because after streaming I have to connect to laptop via VNC and manually execute another bat file which reverts monitor config and stops sunshine service.
Also I know that I can fully disable integrated AMD GPU in BIOS and use only dedicated NVIDIA gpu and that can probably fix the issue (I didn't check it though). But that's also not a good solution because of increased power consumption while not streaming.
Host Operating System
Windows
Operating System Version
11
Architecture
64 bit
Sunshine commit or version
0.20.0
Package
Windows - installer
GPU Type
Nvidia
GPU Model
RTX 3060 Mobile
GPU Driver/Mesa Version
537.34
Capture Method (Linux Only)
No response
Config
Apps
No response
Relevant log output
The text was updated successfully, but these errors were encountered: