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

Struggling to configure #62

Closed
lhavelund opened this issue Jun 2, 2021 · 7 comments
Closed

Struggling to configure #62

lhavelund opened this issue Jun 2, 2021 · 7 comments

Comments

@lhavelund
Copy link

lhavelund commented Jun 2, 2021

Hi everyone,

It feels like this is the perfect tool to help me manage my set up (one desktop, one laptop and two screens), but I'm struggling to get this configured correctly. I'll set the scene with the configuration.

Desktop: Connected to a 32" AOC monitor (DP) and a 24" Dell monitor (HDMI)
Laptop: Connected - via a USB-C dock - to the same monitors. The 32" is connected via HDMI and the 24" via DP.

What I'm trying to do is to check if 7844:6868 is connected (my mouse), then connect both monitors to the respective PCs, but getting to a bit of an impasse.

Here are my config files:
Laptop:

usb_device = "7844:6868"

[monitor1]
monitor_id = 
on_usb_connect = 0x12

[monitor2]
monitor_id = 
on_usb_connect = 0xf0f

When checking the log, I see the following output:

12:34:32 [INFO] Configuration loaded ("C:\\Users\\LHA8713\\AppData\\Roaming\\display-switch\\display-switch.ini"): Configuration { usb_device: "7844:6868", input_sources: InputSources { on_usb_connect: None, on_usb_disconnect: None }, monitor1: Some(PerMonitorConfiguration { monitor_id: "", input_sources: InputSources { on_usb_connect: Some(Hdmi1(0x11)), on_usb_disconnect: None } }), monitor2: Some(PerMonitorConfiguration { monitor_id: "", input_sources: InputSources { on_usb_connect: Some(DisplayPort1(0xf)), on_usb_disconnect: None } }), monitor3: None, monitor4: None, monitor5: None, monitor6: None }
12:34:32 [INFO] Display 'Generic PnP Monitor' is currently set to Hdmi2(0x12)
12:34:32 [INFO] Display 'Generic PnP Monitor' is currently set to Custom(0xf0f)

I've updated the config to use the raw values per the documentation - so 0x12 is the HDMI output, and 0xf0f is the Custom input (i.e. DisplayPort is what I think is safe to assume).

Switching looks OK too in the log too, although I'm not seeing a reference to 0xf0f (the 2nd monitor) - first oddity.

12:45:50 [DEBUG] (1) display_switch::app: Detected device change. Added device: "046d:082d"
12:45:50 [DEBUG] (1) display_switch::app: Detected device change. Added device: "7844:6868"
12:45:50 [INFO] Monitored device ("7844:6868") is connected
12:45:50 [DEBUG] (1) display_switch::display_control: Setting display 'Generic PnP Monitor' to Hdmi2(0x12)
12:45:50 [INFO] Display 'Generic PnP Monitor' set to Hdmi2(0x12)
12:45:50 [DEBUG] (1) display_switch::display_control: Setting display 'Generic PnP Monitor' to Hdmi2(0x12)
12:45:50 [INFO] Display 'Generic PnP Monitor' set to Hdmi2(0x12)

Switching again (away) gives me this output:

12:47:55 [DEBUG] (1) display_switch::app: Detected device change. Removed device: "046d:c07d"
12:47:55 [DEBUG] (1) display_switch::app: Detected device change. Removed device: "046d:082d"
12:47:55 [DEBUG] (1) display_switch::app: Detected device change. Removed device: "7844:6868"
12:47:55 [INFO] Monitored device is ("7844:6868") is disconnected
12:47:55 [INFO] Display 'Generic PnP Monitor' is not configured to switch on USB disconnect
12:47:55 [INFO] Display 'Generic PnP Monitor' is not configured to switch on USB disconnect
12:47:55 [DEBUG] (1) display_switch::app: Detected device change. Removed device: "0bda:5411"

The desktop config is somewhat more problematic, I think.

The config looks like this:

usb_device = "7844:6868"

[monitor1]
monitor_id = 
on_usb_connect = 0xf

[monitor2]
monitor_id =
on_usb_connect = 0x110f

Initial output - which is a little concerning - looks like this:

12:40:39 [INFO] Configuration loaded ("C:\\Users\\user\\AppData\\Roaming\\display-switch\\display-switch.ini"): Configuration { usb_device: "7844:6868", input_sources: InputSources { on_usb_connect: None, on_usb_disconnect: None }, monitor1: Some(PerMonitorConfiguration { monitor_id: "", input_sources: InputSources { on_usb_connect: Some(DisplayPort1(0xf)), on_usb_disconnect: None } }), monitor2: Some(PerMonitorConfiguration { monitor_id: "", input_sources: InputSources { on_usb_connect: Some(Custom(0x110f)), on_usb_disconnect: None } }), monitor3: None, monitor4: None, monitor5: None, monitor6: None }
12:40:39 [INFO] Display 'Generic PnP Monitor' is currently set to DisplayPort1(0xf)
12:40:39 [INFO] Display 'Generic PnP Monitor' is currently set to Custom(0x1111)
12:40:39 [ERROR] Failed to get current input for display 'GP102-A/2147881091:SVideo': Ddc(InvalidChecksum)
12:40:39 [INFO] Display 'GP102-A/2147881094:Lvds' is currently set to DisplayPort1(0xf)

Finally, this is what happens when I switch to the desktop:

12:47:52 [DEBUG] (1) display_switch::app: Detected device change. Added device: "0bda:0411"
12:47:52 [DEBUG] (1) display_switch::app: Detected device change. Added device: "0bda:5411"
12:47:53 [DEBUG] (1) display_switch::app: Detected device change. Added device: "7844:6868"
12:47:53 [INFO] Monitored device ("7844:6868") is connected
12:47:53 [DEBUG] (1) display_switch::display_control: Setting display 'Generic PnP Monitor' to DisplayPort1(0xf)
12:47:53 [INFO] Display 'Generic PnP Monitor' set to DisplayPort1(0xf)
12:47:53 [DEBUG] (1) display_switch::display_control: Setting display 'Generic PnP Monitor' to DisplayPort1(0xf)
12:47:53 [INFO] Display 'Generic PnP Monitor' set to DisplayPort1(0xf)
12:47:53 [DEBUG] (1) display_switch::display_control: Setting display 'GP102-A/2147881091:SVideo' to DisplayPort1(0xf)
12:47:53 [INFO] Display 'GP102-A/2147881091:SVideo' set to DisplayPort1(0xf)
12:47:53 [DEBUG] (1) display_switch::display_control: Setting display 'GP102-A/2147881094:Lvds' to DisplayPort1(0xf)
12:47:53 [INFO] Display 'GP102-A/2147881094:Lvds' set to DisplayPort1(0xf)
12:47:53 [DEBUG] (1) display_switch::app: Detected device change. Added device: "046d:082d"
12:47:53 [DEBUG] (1) display_switch::app: Detected device change. Added device: "046d:c07d"

And when I switch away from the desktop:

12:48:19 [DEBUG] (1) display_switch::app: Detected device change. Added device: "0000:0000"
12:48:19 [DEBUG] (1) display_switch::app: Detected device change. Removed device: "046d:c07d"
12:48:19 [DEBUG] (1) display_switch::app: Detected device change. Removed device: "0bda:5411"
12:48:19 [DEBUG] (1) display_switch::app: Detected device change. Removed device: "7844:6868"
12:48:19 [INFO] Monitored device is ("7844:6868") is disconnected
12:48:19 [INFO] Display 'Generic PnP Monitor' is not configured to switch on USB disconnect
12:48:19 [INFO] Display 'Generic PnP Monitor' is not configured to switch on USB disconnect
12:48:19 [INFO] Display 'GP102-A/2147881091:SVideo' is not configured to switch on USB disconnect
12:48:19 [INFO] Display 'GP102-A/2147881094:Lvds' is not configured to switch on USB disconnect
12:48:19 [DEBUG] (1) display_switch::app: Detected device change. Removed device: "0bda:0411"
12:48:19 [DEBUG] (1) display_switch::app: Detected device change. Removed device: "046d:082d" 

Now the real weird part is that the monitors alternate.

For example, if I switch my input to the desktop, then the 32" shows my desktop, while the 24" shows my laptop's second screen. If I switch inputs to the laptop - the 32" shows my laptop's main screen, while the 24" shows my desktop's second screen.

I can't work out why, but I suspect it's somehow related to the error on the desktop (failing to get the checksum for the display). I'm at my wits end - any input would be highly appreciated.

I'm using 0.3.0.

@haimgel
Copy link
Owner

haimgel commented Jun 13, 2021

Hmm... I don't have a good suggestion here, other than the following:

  1. Please update to 1.0 (I just merged it) from 0.3.0. There are some improvements in there w.r.t. retrying failed DDC/CI transactions, which might help.

  2. You did not specify the OS on both machines: is it Windows, Mac, or Linux? This could be important, especially if we get more reports like yours.

@lhavelund
Copy link
Author

lhavelund commented Jun 13, 2021

Hmm... I don't have a good suggestion here, other than the following:

  1. Please update to 1.0 (I just merged it) from 0.3.0. There are some improvements in there w.r.t. retrying failed DDC/CI transactions, which might help.
  2. You did not specify the OS on both machines: is it Windows, Mac, or Linux? This could be important, especially if we get more reports like yours.

Thanks for the reply - it's been a while since I've submitted any kind of bug report, so I've left out the most basic thing! I'm running Windows 10 20H2, build 19042.985, and the 0.3.0 build was compiled from source.

I've upgraded to the pre-built binaries on my desktop and I'm getting the following output:

21:03:09 [INFO] Configuration loaded ("C:\\Users\\user\\AppData\\Roaming\\display-switch\\display-switch.ini"): Configuration { usb_device: "7844:6868", input_sources: InputSources { on_usb_connect: None, on_usb_disconnect: None }, monitor1: Some(PerMonitorConfiguration { monitor_id: "", input_sources: InputSources { on_usb_connect: Some(DisplayPort1(0xf)), on_usb_disconnect: None } }), monitor2: Some(PerMonitorConfiguration { monitor_id: "", input_sources: InputSources { on_usb_connect: Some(Custom(0x110f)), on_usb_disconnect: None } }), monitor3: None, monitor4: None, monitor5: None, monitor6: None }
21:03:09 [INFO] Display 'Generic PnP Monitor #1' is currently set to DisplayPort1(0xf)
21:03:09 [INFO] Display 'Generic PnP Monitor #2' is currently set to Custom(0x1111)
21:03:09 [ERROR] Failed to get current input for display 'GP102-A/2147881091:SVideo #3': Ddc(InvalidChecksum)
21:03:09 [INFO] Display 'GP102-A/2147881094:Lvds #4' is currently set to DisplayPort1(0xf)

I've also ordered a USB-C to DisplayPort cable I plan to test once it arrives.

Thanks.

@haimgel
Copy link
Owner

haimgel commented Jun 13, 2021

OK, so I think the issue is that your monitor_id values are empty, so these match anything, and could be the reason monitors "alternate" as you say. The app detects 4 monitors, and with these empty monitor_id values, it switches all four, to both values, one after another (in your first log). Also, since you only have 2 monitors connected, I'd say the error about Svideo input is not important. I'd suggest trying with this config:

[monitor1]
monitor_id = "#1"
on_usb_connect = 0xf

[monitor2]
monitor_id = "#2"
on_usb_connect = 0x110f

See if Generic PnP Monitor #1 and ... #2 are indeed the two you need to switch, and if not, adjust monitor_id values to match other monitors as reported by the app. It matches by a substring.

P.S.: Configuration parser in the app should ideally balk on such a config, and not do a stupid confusing thing above... So this is something I'd try to fix.

@lhavelund
Copy link
Author

Thanks for the reply. I've updated my config and will give it a whirl in the morning once my work laptop goes on - thanks for the help! It might be a really simple tool, but if I get this working as it's intended, then it's a massive productivity aid. Thank you!

@lhavelund
Copy link
Author

Right, some progress. Monitor 1 (my 32") seems to be switching fine - monitor 2 (the 24") seems to want to stay on my laptop at all times. It turns off each time I press the switch, but very shortly after loads up my laptop (which one a DP input). I've also swapped my DisplayPort lead to a USB-C -> DisplayPort lead, since I didn't have enough bandwidth to run 2 high resolution monitors on a single USB-C link.

I've tried cycling through #2, #3# and #4 with no success... not quite sure where to go from here.

@haimgel
Copy link
Owner

haimgel commented Jun 16, 2021

I'd say, if ithe second monitor does not switch, then probably the on_usb_connect = 0xf0f setting is incorrect (but you can confirm in the logs what exactly does it say). I'd start by using some known-good values, e.g. DP, HDMI1, etc., and see if that works.

Another avenue to explore would be to try some other DDC/CI controlling software and try switching with that (sorry I cannot recommend anything on windows specifically). This way you'd know if this is some kind of misconfiguration or an issue with your hardware specifically... Some monitors have a buggy or incomplete DDC/CI implementations.

@lhavelund
Copy link
Author

And just like that, setting Monitor 2 to "Hdmi1" has done the trick - which is odd, since there isn't a single mention of Hdmi1 in the logs!

Thanks for your help @haimgel - from my side the issue is closed; let me know if my updated configs, logs, etc. would be of help in any way.

@haimgel haimgel closed this as completed Jun 20, 2021
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