haimgel / display-switch

Turn a $30 USB switch into a full-featured multi-monitor KVM switch
https://haim.dev/posts/2020-07-28-dual-monitor-kvm/
MIT License
2.86k stars 112 forks source link

Did not detect any DDC-compatible displays #60

Closed bigfoote closed 1 year ago

bigfoote commented 3 years ago

First of all, I want to say how great this project is, and I'm really excited just at the idea of getting it working!

Steps to reproduce:

[monitor1] monitor_id = "27" on_usb_connect = "DisplayPort2" on_usb_disconnect = "Hdmi1"

[monitor2] monitor_id = "3220" on_usb_connect = "DisplayPort2" on_usb_disconnect = "Hdmi1"

- build the program per the instructions; run it from the terminal

Expected outcome: pressing the button on the KVM switch when the monitors are set to the laptop causes the Ubuntu machine to detect the USB device change and switch from the HDMI input to the DisplayPort input

Actual outcome: the log (~/.local/share/display-switch/display-switch.log) seems to say that it gets the config, but that the monitors aren't DDC-compatible. The research I did online seemed to say that these monitors support DDC, but I also saw that sometimes monitors only do it over certain ports.

21:11:34 [INFO] Configuration loaded... 21:11:34 [ERROR] Did not detect any DDC-compatible displays! ... 21:12:28 [INFO] Monitored device is ("0bda:5411") is disconnected 21:12:28 [ERROR] Did not detect any DDC-compatible displays! ... 21:13:00 [INFO] Monitored device ("0bda:5411") is connected 21:13:00 [ERROR] Did not detect any DDC-compatible displays!

haimgel commented 3 years ago

Hello, thanks for the detailed report! I'd suggest:

  1. Check the Linux-specific config, see the project's README. You need to add your user to a certain group, or run it as root to be able to communicate via DDC.
  2. See if the issue with your hardware, or with this app specifically. I'd recommend using ddcutil to query your DDC devices, and see if it can see them or not. E.g. ddcutil detect. See here for more examples.
bigfoote commented 3 years ago

Success! ddcutil confirmed that both monitors are indeed DDC devices, so it made sense that following your instructions in point #1 got everything working. I just didn't realize that setting it up as a service included getting the permissions the way they need to be even if just running it myself. Not sure if there's any way to add a log message if access is denied to that directory.

bigfoote commented 1 year ago

Hmmm...my setup had been stable for over a year, and suddenly I started getting this problem again. I checked that my user is in fact in the group i2c and that my monitors (at /dev/i2c-4 and /dev/i2c-5) have the correct permissions (crw-rw---- 1 root i2c...), and running display-switch as root doesn't solve the problem. Any ideas?! I wonder if something changed in the Nvidia driver so that the monitors no longer are showing up as DDC-enabled, but 'ddcutil detect' still finds them...

bigfoote commented 1 year ago

Swapped my Nvidia card for an AMD one, and the problem went away. I don't know why, but closing for now.