by ohazi · 5y ago · 0 comments
In order to make the switch, I push one button on the USB switch, and then select the next input on my monitor (four button presses using the monitor's OSD). There's a great little tool called ddcutil [1] that allows you to send commands to your monitor via the i2c bus embedded in your HDMI/DisplayPort connection, so I tried to write a script to do the monitor input swap on either a key binding or after detecting the appropriate USB event.
It almost worked. My monitor only listens to the i2c bus of the selected input, so I need to run this script on both my desktop and laptop rather than just on the desktop. But apparently there was a bug in the way my (TB3) dock handled forwarding of the DP i2c data to the docking host. And by bug, I mean write forwarding was just not implemented in the kernel driver. So ddcutil would work on my laptop with a direct HDMI connection, but not when it was connected via the dock.
Anyway, long story short:
5.10 fixes this [2], so I'm particularly excited about this release.
[0] https://www.amazon.com/Cable-Matters-Sharing-Computers-Perip...
Only issue I have with it is that it doesn't run as a Windows service - so you have to manually switch the monitor the first time so you can login and start display-switch. I see someone else has opened an issue in the github repo, so hopefully it gets resolved.
I'm happy with the ddccontrol based switching with 2 computers (linux desktop + mbp), but I want to add an additional computer (mbp) to the mix, so my workflow won't work anymore.
Does anyone know of dual head DP KVM switches that work reliability? Googling shows a few options, but the they are old posts and things may have changed. Single head (1 DP monitor + MST) works for the linux desktop but Apple does not support MST on macbooks it seems like[1][2] (I can't even find an official page on apple.com with relevant details).
I have tried [3] but it is quite buggy with displays blanking out once every few minutes even with higher quality, DP 1.2 compliant cables (cable length < 1.2m).
[1] https://www.dell.com/community/Monitors/P2720DC-use-MST-func...
[2] https://old.reddit.com/r/MacOS/comments/gliki5/in_2020_why_d...
[3] https://www.amazon.com/gp/product/B089LY4S63/ref=ppx_yo_dt_b... (select the 2 monitor x 4 computers DP model)
I always wondered if such things are unique features of Linux or available on Windows and Mac as well.
Windows should have something similar.
So I got a USB switch and that worked well for a while with multiple monitors (Dell) that you could assign shortcut keys to the buttons to switch inputs with 2 presses.
Now I have a curved Dell and it has a built-in USB switch that works really well that you can assign to inputs. It's a bit slow, switching USB takes as long as it does to switch video inputs, but it appears to be rock solid.
The other features, side-by-side and PiP are kind of a joke.
High-end KVMs get around this with virtual usb devices. Instead of switching the actual USB devices between computers A and B, they instead create a separate virtual USB device for each computer that always stays connected to each computer and is never switched. When you push the button on the KVM, you are not actually switching between computers, the KVM reads the USB input from the device and then recreates it on the appropriate virtual usb output device.
These KVMs are pretty costly. There are some complicated DIY solutions involving arduinos, but a software "KVM" (really just the KM, no V) like https://github.com/debauchee/barrier in most situations works just as well, and if the computers are connected via wired ethernet, is rock-solid and adds no perceptible latency.
To work around it I have to use a second hdmi cable directly connected. It defeats the purpose of having the single dock cable that I was hoping for when I bought it. :-/
Good news though. Maybe when 21.04 (Hirsute Hippo :) comes out I can finally get rid of the second cable.
[1] https://gitlab.freedesktop.org/drm/intel/-/issues/37
You might try anyway. Believe I use the thunderbolt connection for my monitor, the second direct hdmi connection is used only for sending ddc commands. In other words, both inputs seem to be listened to with my Dell monitor.
Your monitor must listen to DDC commands from inactive inputs. I think mine doesn't, because this whole problem came about when I realized that my desktop could ask the monitor to switch to the other input, but couldn't ask it to switch back.
Apparently a lot of computer monitors only listen to DDC commands coming from the selected input, while TVs almost always listen to them from all inputs, because they often need to do things like "switch to Roku input when the Roku asks, even if some other set-top box is driving the display."
If my monitor could do this, I could just run the input switching script entirely on my desktop (based on whether the keyboard has just appeared or just disappeared), and I wouldn't have to send DDC commands via the dock at all.
If anyone's interested, my script is here: https://github.com/liskin/dotfiles/blob/home/bin/liskin-brig... Lets me interactively adjust the brightness using a very simple gui: https://twitter.com/Liskni_si/status/1320698852970778627
For keyboard/mouse I use Barrier ( https://github.com/debauchee/barrier ) which works great for sharing keyboard/mouse between my laptop and desktop.
The USB switch electrically disconnects and reconnects any attached USB devices, moving them between a USB port on my desktop and a USB port on my docking station. I have a keyboard and a Logitech receiver connected to this switch. The advantage of doing it this way is that it works on any operating system without any additional software. Things that might not make it through a HID emulation layer (e.g. scroll sensitivity, firmware updates, RGB LED control(?), etc.) just work the way they would if the peripherals were connected directly (because they are connected directly). You could also add other USB devices to the switch if you wanted, like an audio interface, drawing tablet, thumbdrive, etc. (although you'd want to be careful about unmounting any drives).
The video source is set by the monitor. Doing this via the monitor's OSD menu works, and also doesn't require any software, but is annoying. So the small bit of optional software that I've added is a script that waits for the keyboard to disappear (which happens after I press the button on the USB switch), and then tells the monitor to change input. It saves me four button presses when it works, but I can still perform the switch manually if it doesn't.
The no-software approach allows this setup to work even if a friend shows up with a TB3 laptop without any special software and wants to work at my desk.
Is that even doable? It's the type of setup I want.
In any case, my desktop is old and doesn't speak Thunderbolt. I'm not sure whether I can bolt it on with a PCIe card, but even if I could, configuring an nvidia card to reroute output from its own ports to a Thunderbolt add-on card sounds... not fun. And then you'd have to deal with the fact that the longest passive cable that the TB3 spec allows for is like, 2 feet long, and I have a standing desk...
It's certainly an interesting idea, and pulling it off would be an impressive technical feat.
Wonder if it will work with my desktop and raspberry pi.