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

Switches to Wrong Monitor Upon Connect #20

Closed
jet082 opened this issue Jan 12, 2024 · 1 comment
Closed

Switches to Wrong Monitor Upon Connect #20

jet082 opened this issue Jan 12, 2024 · 1 comment

Comments

@jet082
Copy link

jet082 commented Jan 12, 2024

I have two real monitors and one dummy monitor.

The script does disable two monitors when I connect... But the wrong two. See below, but the one left enabled during connection is \\.\DISPLAY7 and not \\.\DISPLAY11. It re-enables everything upon disconnect just fine.

Here are my files:

Dummy.cfg

[Monitor0]
Name=\\.\DISPLAY7
MonitorID=MONITOR\AUS17E0\{4d36e96e-e325-11ce-bfc1-08002be10318}\0005
SerialNumber=
BitsPerPixel=0
Width=0
Height=0
DisplayFlags=0
DisplayFrequency=0
DisplayOrientation=0
PositionX=0
PositionY=0
[Monitor1]
Name=\\.\DISPLAY8
MonitorID=MONITOR\AUS17E0\{4d36e96e-e325-11ce-bfc1-08002be10318}\0000
SerialNumber=
BitsPerPixel=0
Width=0
Height=0
DisplayFlags=0
DisplayFrequency=0
DisplayOrientation=0
PositionX=0
PositionY=0
[Monitor2]
Name=\\.\DISPLAY11
MonitorID=MONITOR\LNX0000\{4d36e96e-e325-11ce-bfc1-08002be10318}\0001
SerialNumber=
BitsPerPixel=32
Width=2732
Height=2048
DisplayFlags=0
DisplayFrequency=120
DisplayOrientation=0
PositionX=0
PositionY=0

primary.cfg

[Monitor0]
Name=\\.\DISPLAY7
MonitorID=MONITOR\AUS17E0\{4d36e96e-e325-11ce-bfc1-08002be10318}\0005
SerialNumber=
BitsPerPixel=32
Width=1920
Height=1080
DisplayFlags=0
DisplayFrequency=240
DisplayOrientation=0
PositionX=0
PositionY=0
[Monitor1]
Name=\\.\DISPLAY8
MonitorID=MONITOR\AUS17E0\{4d36e96e-e325-11ce-bfc1-08002be10318}\0000
SerialNumber=
BitsPerPixel=32
Width=1920
Height=1080
DisplayFlags=0
DisplayFrequency=240
DisplayOrientation=0
PositionX=-1920
PositionY=95
[Monitor2]
Name=\\.\DISPLAY11
MonitorID=MONITOR\LNX0000\{4d36e96e-e325-11ce-bfc1-08002be10318}\0001
SerialNumber=
BitsPerPixel=0
Width=0
Height=0
DisplayFlags=0
DisplayFrequency=0
DisplayOrientation=0
PositionX=0
PositionY=0

settings.json

{
    "startDelay": 4,
    "gracePeriod": 60,
    "configSaveLocation": "%TEMP%",
    "dummyMonitorId": "MONITOR\\LNX0000\\{4d36e96e-e325-11ce-bfc1-08002be10318}\\0001"
}

log.txt

**********************
Windows PowerShell transcript start
Start time: 20240112223751
Username: JETPC\jet082
RunAs User: JETPC\jet082
Configuration Name: 
Machine: JETPC (Microsoft Windows NT 10.0.22635.0)
Host Application: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -File E:\Supplemental\Tools\MonitorSwapper\MonitorSwapper.ps1 -async True
Process ID: 35008
PSVersion: 5.1.22621.2706
PSEdition: Desktop
PSCompatibleVersions: 1.0, 2.0, 3.0, 4.0, 5.0, 5.1.22621.2706
BuildVersion: 10.0.22621.2706
CLRVersion: 4.0.30319.42000
WSManStackVersion: 3.0
PSRemotingProtocolVersion: 2.3
SerializationVersion: 1.1.0.1
**********************
Transcript started, output file is .\log.txt

Id     Name            PSJobTypeName   State         HasMoreData     Location             Command
--     ----            -------------   -----         -----------     --------             -------
1      MonitorSwapp... BackgroundJob   Running       True            localhost            ...
3      MonitorSwapp... BackgroundJob   Running       True            localhost            ...
Waiting for the next event to be called... (for starting/ending stream)
Processing event: Start
Dummy plug activated
Still waiting for the next event to fire...
Still waiting for the next event to fire...
Still waiting for the next event to fire...
Still waiting for the next event to fire...
Still waiting for the next event to fire...
Still waiting for the next event to fire...
Still waiting for the next event to fire...
Still waiting for the next event to fire...
@jet082 jet082 changed the title Does not Switch to Dummy Monitor Switches to Wrong Monitor Upon Connect Jan 12, 2024
@jet082
Copy link
Author

jet082 commented Jan 13, 2024

Okay it turns out this was a problem with my dummy monitor. I was using https://github.com/itsmikethetech/Virtual-Display-Driver which advertised higher refresh rate options at a variety of resolutions, but these were not enabled by default. Therefore, MultiMonitorTool was trying to set the dummy monitor to a refresh rate that was not enabled. My guess is that MultiMonitorTool's fallback/failsafe option is to always keep one monitor enabled and it defaulted to the 'primary' one.

Oddly, in my experiments, I switched all the uses of MultiMonitorTool to MonitorSwitcher (due to reading #9) and the failsafe for that was much safer - it worked properly and simply used the existing 60hz option as its fallback/failsafe.

What I ended up doing to fix things was editing the file C:\IddSampleDriver\option.txt to add my intended resolution+refresh rate combo (in this case 2732, 2048, 120) and then uninstalling and reinstalling the device (via device manager, right clicking IDDSampleDriver Device HDR and saying Uninstall Device and then reinstalling via the same method I originally did). Once the 120hz option was available, the existing MultiMonitorTool option worked fine.

Since a good amount of people use virtual dummy devices (like https://github.com/itsmikethetech/Virtual-Display-Driver) it might be nice to have a little 'make sure your refresh rate/resolution is enabled by checking in the display properties' in the troubleshooting section. Given #9 it might also be nice to make a move to MonitorSwitcher since it seems like it more elegantly handles failures.

@jet082 jet082 closed this as completed Jan 13, 2024
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

1 participant