itsmikethetech / Virtual-Display-Driver

Add virtual monitors to your windows 10/11 device! Works with VR, OBS, Sunshine, and/or any desktop sharing software.
3.01k stars 125 forks source link

Remote desktop - \\.\DisplayXX #19

Closed Death666Machine closed 9 months ago

Death666Machine commented 9 months ago

Greetings, thank you for your contribution this driver is great! However with that said I am encountering an issue with my current setup.

Currently the driver assigns a random Display Number when a Virtual Display is created, the problem I am having is I would like moonlight to always default to this Virtual display so I have manually set the display within sunshine and this works great. However when I connect to my computer via remote desktop it seems as if the Virtual display is assigned a new display number. Which unfortunately means that I have to reset the chosen display within sunshine which is unfavorable.

Would it be / is it possible to hard set the display number within the driver so that when connecting via remote desktop I do not have to manually set the display to the new display number assigned?

For reference by display numerous I am referring to the \.\DisplayXX name value.

Death666Machine commented 9 months ago

Just a quick update I did find this tool https://github.com/WeebLabs/Virtual-Monitor-Helper/releases which should fit my needs in this situation I'll give it a shot and see if it fixes the issue that I am having.

SavageTheUnicorn commented 8 months ago

I'm also experiencing this, upon restarting. I've tried using the project mentioned by @Death666Machine but it doesnt seem to be detecting the drivers as it isn't updating the display name within the sunshine config file. There's no logs that I can see so I'm unsure how far the Virtual Monitor Helper is getting anyways.

I believe this is because the project mentioned above targets specifically the device "IddSampleDriver Device" instead of "Virtual Display Driver by MTT", I've opened an issue on their github but I'd also like to ask here, if it is possible to add an option to change the name of the device (as seen in Device Manager), from the default "Virtual Display Driver by MTT" to a customized one to allow for functionality with this tool, or build a seperate version with that name for the public. I appreciate the time spent reading this!

Death666Machine commented 8 months ago

@SavageTheUnicorn this is the solution I have found https://github.com/Nonary/MonitorSwapAutomation basically I have it setup to swap the primary monitor to be the virtual display driver 😉 hope this helps!

SavageTheUnicorn commented 8 months ago

@SavageTheUnicorn this is the solution I have found https://github.com/Nonary/MonitorSwapAutomation basically I have it setup to swap the primary monitor to be the virtual display driver 😉 hope this helps!

@Death666Machine Do you have the virtual display set to extend, duplicate, or show only on 1? I assume the main monitor is the primary in windows settings and sunshine config is left blank? I saw this project yesterday but I was a bit skeptical of it providing valuable results so I'll look into it again now. Thanks! 😊

Edit: I feel like this wouldn't help my issue still as the device name Display\.\XX is still randomizing upon boot and the configuration that project makes saves the current name into the file. I worry it would be rendered useless upon reboot again.

Death666Machine commented 8 months ago

@SavageTheUnicorn In my current configuration I have mine setup to extend. I only have my main monitor active until a connection to sunshine is made, then the virtual display is activated, set as primary. then I move the position of my primary monitor to the right of virtual display monitor. When connection is terminated the virtual display monitor gets deactivated, my monitor is set to primary, and moved mack to the left of the virtual Display monitor. In my sunshine configuration I have it set to primary monitor instead of setting a display name. This way it doesn't matter what the name of the display is, it just chooses the primary monitor at the time of connection. Hope this is understandable and makes sense 😁 I've had absolutely 0 issues with this setup.

SavageTheUnicorn commented 8 months ago

@Death666Machine this works to swap the monitor, but the functionality I'm looking for is different. I'm attempting to stream ONLY the second virtual display adapter while retaining function on my host pc. I can use DisplayFusion to allow simultaneous mouse and controller input. My only issue is the randomizing display name, I can easily set it every session (disregarding the fact i cant really see my main screen while streaming the second monitor to move the apps and lock input)

Death666Machine commented 8 months ago

@SavageTheUnicorn This is exactly how my setup works, the primary goal being to retain function of the physical monitor durring streaming, the difference being is that I set the virtual display monitor to be disabled so I don't run my mouse off screen when not streaming but thats purely preference as you can adjust the script to do exactly what you are looking for. 😁 when streaming you just have to move apps and lock input as you say. I haven't found a way to simply that process as the primary monitor gets switched to be the virtual display monitor during streaming.

SavageTheUnicorn commented 8 months ago

Ahh. I'm lacking knowledge of how to reliably get the result I want so I'm just resorting to leaving it as is, but using TeamViewer to view the main desktop remotely when needed for changing the display name. I've got a batch script set to run at boot that will autorun the dxgi-info.exe, so I just have to scroll up and read it and enter it into the web page that also is set to auto start. At that point sunshine can be restarted to allow functionality between both desktops (the mouse running off doesn't bother me, DisplayFusion also allows locking the mouse to a seperate window as well as allowing "unfocused" controller inputs to games, but I'm unsure about entire displays). It's just a huge pain caused by specifically the driver having a randomized display name upon reboots. If this could be set to a static number somehow it would solve everything.

If you could share your primary.cfg and dummy.cfg somehow so I could use it as reference that would be great as I just need to not disable the primary - monitor when sunshine start, only connect to the virtual display driver.