Cynary / sunshine-virtual-monitor

Scripts and instruction for automatically setting up a lone virtual monitor to stream from sunshine.
GNU General Public License v3.0
42 stars 4 forks source link

Fail to disable displays on Win11 24H2 #16

Open mikef0 opened 5 days ago

mikef0 commented 5 days ago

Hi. I was previously using the script without issues on my Windows 10 machine. I recently switched to a new PC running the latest version of Windows 11 and get the following error.

I have tried different resolutions, HDR and non HDR versions of the virtual display driver. Nothing seems to work.

Setting up a moonlight monitor with 3840x2160@60 with hdr on Enabling the virtual display. Setting up the virtual display and disabling other displays. Disabling all other displays. Failed to disable all other displays. At C:\Sunshine_Scripts\tools\sunshine-virtual-monitor-main\setup_sunvdm.ps1:109 char:9

mikef0 commented 5 days ago

I should have noted. The virtual display driver works fine if I don't use the script. There are no errors or anything of interest in the Sunshine logs except simply informing me that it is running your start and termination scripts as expected.

dismantlethedictator commented 3 days ago

yes - same issue on my end. I recently reinstalled windows and the scripts are popping an identical error in the log. replicated the error with multiple clients. Was able to stream to clients once i deleted the sunshine scripts

Cynary commented 3 days ago

Hi, Thanks for the report - this seems really similar to #9 Can you confirm that you were running the most recent version of the scripts?

Also, can you share the output of the following when the virtual display is enabled:

Get-PnpDevice -Class Display

Thanks!

dismantlethedictator commented 3 days ago

yes running the most recent version of the scripts and just tried the fix from the thread you linked and it doesnt seem to help. sorry what output specifically?

Cynary commented 3 days ago

HI @dismantlethedictator I messed up the formatting in my previous comment; I have fixed it now - please run the command:

Get-PnpDevice -Class Display

Thanks!

mikef0 commented 3 days ago

Sorry for the formatting, I keep editing this comment to fix it but can't figure out how to make it look right.

Please see below.

`PS C:\Users\mikef> get-PnpDevice -Class Display

Status Class FriendlyName InstanceId


OK Display NVIDIA GeForce GTX 1070 PCI\VEN_10DE... OK Display Virtual Display with HDR ROOT\DISPLAY... Unknown Display Microsoft Remote Display Adapter SWD\REMOTEDI...`

dismantlethedictator commented 3 days ago

HI @dismantlethedictator I messed up the formatting in my previous comment; I have fixed it now - please run the command:

Get-PnpDevice -Class Display

Thanks!

Status Class FriendlyName InstanceId


OK Display IddSampleDriver Device HDR ROOT\DIS... OK Display AMD Radeon RX 6700 XT PCI\VEN_...

dismantlethedictator commented 3 days ago
Get-PnpDevice -Class Display | Where-Object {$_.FriendlyName -like "*idd*" -or $_.FriendlyName -like "*mtt*"}

Status     Class           FriendlyName                                                                     InstanceId
------     -----           ------------                                                                     ----------
OK         Display         IddSampleDriver Device HDR                                                       ROOT\DIS...

as a heads up, cmd is able to locate my virtual display using friendlyname like "idd" or "mrt"

Cynary commented 2 days ago

Yeah, this is likely some different issue. Would you be able to help debug by running the script one line at a time, and reporting:

A few things it could be: WindowsDisplayManager may have some issue, and is unable to delete the display. We're not properly enabling the virtual display.

Not sure what else, but running the script one line at a time, and checking the status of displays etc. should hopefully help.

mikef0 commented 1 day ago

It never disables the virtual monitor. I have seen it randomly behave in 2 different ways and I can't account for what causes the difference in behavior.

  1. I try to connect with sunshine -> My SECONDARY monitor goes blank, virtual monitor stays disabled. (sunshine times out and is no longer part of the equation. From this point, my secondary monitor is still disabled and I can't even see it in windows display manager to turn it on. If I ENABLE the virtual monitor, my secondary monitor comes back on but if I then disable the virtual monitor, I lose my secondary monitor again. I have to restart to get my secondary monitor back

  2. Similar to above, except my secondary monitor position in relation to my primary monitor changes. Sunshine times out, virtual monitor is still disabled and I have to go in windows display manager to fix the position of my secondary monitor.