PSA: Many 4K Dell monitors (like my Dell UltraSharp U3219Q ) have a built-in KVM switch and they support full DDC commands for switching the input as well (over HDMI, DP and USBC). I can control them from Mac and Linux with hot keys that trigger the appropriate ddc commands.
Wow! Thanks for that comment, I have a Dell U3818DW with a KVM switch and I didn't know you could control it with DDC commands!
So for linux (e.g. fedora):
dnf install ddcutil
ddcutil capabilities -d 1 # show the available commands
ddcutil setvcp 60 0x11 # for example switch to HDMI 1
# assign a global shortcut key to the `ddcutil setvcp` command you need
And for windows:
- download the "Dell Display Manager" software from their support site
- assign a shortcut key in the Dell Display Manager: "Input Manager" tab => "Favourite Input Shortcut Key"
I used the same shortcut (Ctrl-Alt-ScrollLock) for both linux(kde)/windows
I have a shortcut on my Linux desktop to switch my Dell U3818DW display to its HDMI input where a second graphics card passed through to Windows is running on as a KVM guest.
#!/bin/bash
ddcutil setvcp 60 0x11
On my Windows guest desktop, I set up a shortcut for Dell Display manager to switch back to my Linux host and primary graphics card on my display's DisplayPort input
Well, 4K is not exactly a requirement. And while most older don't have the ability to swithc USB my U2415 displays (released in 2014) supports switching input over DDC. And honestly, I'd expect any half-decent display sold in the last decade to support it as well. But I could be very wrong. The samsung and AOC display I have connected at work also supports them and the samsung is quite old. For USB though I have to press a button. Or use the excellent virtualhere software for connecting USB over the network (that I could easily script to switch over usb as well).
I have a short script that will allow me to change input on a specific display. Very handy. However please note, that while this does work for HDMI, DVI and Displayport only DVI/HDMI seems to have an active connection when another input has been selected.
That means that while I can switch to another input I can not switch back from the same computer but must install something on the other machine to give it back. This is of course exactly what the linked article is doing, but with HDMI/DVI I don't have to have that requirement. And on top of that, operating systems in general seem to believe that, when using displayport, switching to another input is equivalent to disconnecting the display altogether and thus remove it and rearrange windows etc. Insanely frustrating.
Again, no problem with HDMI/DVI. So although Displayport is a much better interface and I've been a strong advocate for it, these issues makes me hate it with passion.
DDC can also be used to change display brightness, which in my opinion is way too cumbersome to do manually (especially if you have more than one display).
I'm not sure why people are responding telling me that random monitors are available. Do they have built-in KVMs? If not, they aren't what I'm looking for.
Lunar worked great for me on MacBook Pro 2020 (2 monitors, one connected over USB-C to USB-C cable, another one over USB-C to DisplayPort), but doesn’t work on for the same monitors connected to MacPro via 2 HDMI cables…
The HDMI port on most recent Mac devices uses a converter chip inside to convert the signal to DisplayPort internally. That chip has DDC/CI blocked in its firmware and there's no way to enable it.
An alternative approach that I've taken is to have the HDMIs from my work desktop plugged into a capture card on my main Windows desktop. I then use the preview from OBS to see the display and also hear the audio. Still need a separate keyboard + mouse, but I like being able to move/minimize my work OBS window off to the side when I'm not actively working.
I also use this setup with gaming consoles so that I don't have to dedicate an entire monitor.
I wrote a very simple html5 webapp which does this
http://webcam.apps.gbraad.nl never got around to mute the audio or so, but patches welcome!
I use two capture cards and them on th bottom monitors when needed (use 4 screens). This way I can also easily stream and records the screens when on a meeting that is on another machine.
I don't notice it when using it for work. I barely notice it when using it for console games. Probably wouldn't want to use it for competitive shooters, but non-issue for most other games.
Few more notes:
- I use PCIE rather than USB for the capture card
- Can be costly if you need 4k + multiple inputs (for multiple "monitors" as different OBS windows)
- I had issues getting the capture card to recognize scaled HiDPI resolutions from my work Mac
You can do this without a capture card using https://ndi.tv/tools/ - other clients on your LAN can view in OBS or with the included program. I'm yet to try it with 4k.
No help with consoles of course, and perhaps not an option for a work machine.
edit: feature list also mentions "KVM remote control of any workstation running Scan Converter from NDI Studio Monitor"
I use NDI a lot, but with a phone as webcam, or from obs to obs, scan converter, audio stream between devices like ipad/iphone/Android to desktop... But it is demanding to encode this way. HDMI capture does only use bandwidth over the USB or pcie bus, while ndi uses cpu or gpu.
HDMI capture cards can definitely use CPU, and this is the case for most USB capture cards as USB does not have enough bandwidth to send an entire raw stream in realtime.
Fair warning to others, this project has no license, is Windows only and also requires an external closed-source/proprietary binary that is included in the repo.
Thanks ranger, I had completely forgotten about ControlMyMonitor.exe. That's how the program originally switched inputs, but was since replaced by win32 calls in MonitorController.cs.
I've removed that external dependency and published a new release.
Yes Windows only; I'll add mac & linux when I get a bit more time.
This looks fantastic, I was recently disappointed to learn that there don't seem to be any good KVMs under ~$200, that support anything higher than 4k@60Hz.
Apparently Thunderbolt/DisplayPort are not really a thing yet for some reason, so I ended up getting a USB (KM) switch instead. With this project, it looks like I'll be able to have my cake and eat it too.
I've managed to find a cheap 2-port DP KVM that pretends it's able to do DP 1.4 / 8k @ 60 Hz. I can only confirm it works well at 4k@60 Hz, since that's the best my screen can do.
One pro is that it's able to get power from any of the USB inputs, so no extra cable!
One con is that for some reason it only does USB 2...
I found the same problem roughly a couple years ago. I ended up building a very specific solution (switch input mode based on specific USB changes) that is more or less a subset of of the functionality here. I am now having near daily issues with the KM (a ~$30 one that was the only one I could find that really meet my needs) box. There is tons of room on the market for a good prosumer solution to this problem.
Make sure that the monitor you are using actually supports input management through DDC. I have seen some monitors that expose only the color management.
I have addressed this problem by using a 4x4 USB switcher from Rosewill and an HDMI matrix, such as those used by broadcasting or A/V signage industries. I started with an 8x8 matrix and now have a 16x16. It’s dead simple to give each of the 4 or so computers I have hooked up to them 3 or so monitors, and I can swap any video source to any sink using a web interface. The matrix isn’t cheap (approximately $1200) but after using it for around 4 years, I honestly couldn’t think of using my workstation any other way.
Does it support 4k@60? Can you configure EDID handling, or any potential HDCP issues (and stuff like HDR, ethernet-over-HDMI, etc)? Would be curious what make/model of matrix you're using.
There's plenty of different hardware out there but not a whole lot of reviews; and my experience with the HDMI interface has, on the whole, not been the best.
HDMI is great for consumer stuff, and for plugging in a generic source to a screen (AppleTV, Firestick, Xbox, cable box, etc) -- but, as soon as you want to do anything even slightly more advanced, you often run into hiccups quite rapidly (EDID & handshake/negotiation issues, cable & port quality, HDCP, etc).
I have several 'screens' (TVs) and I wanted to be able to mirror my 'main' display to other screens on occasion, for instance. It's easy to do that with a cheap-ish "splitter" [though they are finnicky), but if you want to "scale" that at all then you rapidly run into proprietary and/or high-cost solutions or have to make substantial quality & capability concessions (and >=10G LAN connectivity is pre-existing).
I was annoyed by the lack of good options & and the extreme prices and/or the limitations of the options that do exist -- enough so that I'm working on (and already actively using) my own IP-based "video distribution" solution, heh.
The 16x16 one I bought does. It supports (some form of) HDMI 2.1. The EDID management for all matrices I’ve tested is a bit odd. Pass through doesn’t always work with most monitors, and you can specify a generic EDID from a preconfigured list, upload your own (only one) EDID file, or select “COPY_FROM_INPUT_1” for any or all outputs. The problem is that sometimes you might want input 1 to go to output 2, despite normally sending it to output 1. I have to manually change the EDID profile.
I can’t say how well a balun/extender setup will work but I believe they make boxes that specifically do that - a combination matrix and extender. I have no issues with HDCP. Happy to answer any other questions.
Search Monoprice for Audio/Video splitters but pay very close attention to the description. Make sure you understand the number of sources and sinks it offers.
Also please let me know if you find or know of a better USB switcher! I want one that supports 4 inputs but can handle more than 4 outputs to switch between. 6 or 8 would be great. It’s very handy because I frequently have client laptops or I’m working on another computer or RPi, so a spare USB input that I could leave on my desk would be great.
I bought the 8x8 matrix from Monoprice - they have a category for audio/video splitters. They brand it as the “Blackbird” line, but note that they rotate and update the OEM/manufacturer fairly regularly. They’re clearly rebranded OEM units with a very cheap web interface and IR remote.
The 16x16 I bought from a small online company called “HDTV Supply” - model number HDCVT4K1616. They were a pleasure to work with.
(Mods please let me know if there are any issues sharing these vendors.)
I bought a fantastic curved Samsung monitor and it supports reading from the port that tells you the current input but not setting it. It also has the worst possible input switcher that cycles until it finds a valid input.
I wish it were easier to hack on monitor firmware. I'd love to improve it.
It's quite infuriating when you have a display that changes input if it's not receiving and a source that switches off unless it's told the display is showing. You end up having to play a timing game to get both devices on at the same time before one of them turns off or changes.
The phones are terrible too, these days. I bricked a phone and lost access to all data on it by trying to back it up. Every Galaxy generation has gotten worse and worse in terms of preinstalled malware that takes a lot of effort and care to disable (if possible at all).
The only thing I would still buy from Samsung these days is storage devices.
The least-horrible (but still not great) monitor firmwares I had so far were Eizo, followed by Dell.
I will never buy Samsung or LG again - the displays themselves were great but the UI/UX for switching inputs and brightness etc are simply too excruciating.
Neat! Similarly, I've been using ddcutil on Linux and a stupid python script on Windows to switch video inputs. Janky as it is, it's more reliable than any KVM I've ever used, and I've tested quite a few.
Now for my 2022 project I want to build one those promicro/QMK based custom keyboards with a direct I2c connection to my monitor and control it via hot keys. Eventually I'd add promicros for each computer all talking I2c and the keyboard is smart enough to forward keypresses to the active computer. That's my idea anyway.
Can anyone concisely explain how this hack works, as if one were to introduce it to a five year old?
I'm having a hard time understanding how a USB switch can manipulate a monitor, directly or indirectly, to behave as an alternative to a KVM switch. The project README fails to provide practical examples and detail this hack in the simplest way possible. I'd love to have this solution working for a personal homelab, as prices for KVM switches are too high to financially bear.
If I get this solution working, I will contribute back to the README to address this issue.
the general concept is you could have 2, 3, 4 or more individual desktop PCs at one desk, each connected to their own displays, and one keyboard and one mouse. The keyboard and mouse are on the primary workstation, you can roll the mouse off the edge of one screen and onto another.
The secondary and tertiary workstation PCs have no keyboard/mouse i/o plugged into them, just power, ethernet and display.
I use this and it works very well. I also want to add that it shares the clipboard across all of the PCs. In fact I can even copy from my iPhone and paste into a windows PC, via my MacBook.
I also have a few PCs and use the input selection on my monitor to achieve the KVM aspect. The only issue I found is that if no monitor is actively connected to a windows machine, barrier server doesn’t work well, and also you can’t Remote Desktop to it. I solved both of these by adding a dummy HDMI dongle, set to a low resolution so application windows can’t get stuck there.
Not a perfect solution but the best I’ve found since my goals were: to use a Bluetooth keyboard and mouse, and not worry about limitations to refresh rate, etc.
I'm still waiting for https://github.com/debauchee/barrier/issues/567 to get fixed. Right now, Barrier (and possibly Synergy) creates zombie processes and leaks handles on Windows, causing the kernel to burn CPU trying to free up memory.
Barrier is almost perfect for my use, with one big flaw. It has no concept of individual displays. For most setups, it probably isn't a big deal. For me, I am back to a hardware KVM.
Won’t this have a painfully long delay as the monitor negotiates the different input port?
Not only does every monitor I’ve owned take seconds to do this, it often screws with the desktop layout and such when display devices seemingly come and go. Or am I misunderstanding this?
Speaking from experience, download a program that can show what DDC commands your monitor supports before you bother. Mine supports many except… switching inputs (0x60 if I recall).
Documentation for most consumer monitors is pretty lacking in this regard, it seems to be a feature mostly on monitors targeted to the professional market.
I was pretty shocked that most of the ddcutil & other similar programs on Linux weren't working for two of my monitors. The utils couldn't even detect the DDC display. But I told it what i2c bus to send to & what commands to issue, and it turns out my monitors had a pretty wide range of commands.
Reminds me of an i2c motor controller I bought years ago, based off some avr microcontroller. I spent an afternoon trying to understand how I'd hooked things up wrong, trying to understand why I couldn't read the control values. Turns the soft i2c interface just didn't implement reading values off the controller at all, but served ok if I treated it as a write-only device. Frustrating tricky devices. Sometimes they lie.
But yeah, also a >15% chance your monitor doesn't support switching inputs via DDC/CI. Would be so nice if review sites would cover this sort of thing. As it is, it's just a tech-secret, something invisible to the market, no push to include it, no points deducted for getting it wrong/bad. It leaves a lot of room for the situation to sit & not improve. Better reviewing would help move things along.
Sometimes it also the availability of commands depends on the cable/adapter used.
If I connect my monitor directly via HDMI to my laptop I can send all the DDC commands I want, but when I use an USB-C -> DisplayPort cable ddcutil couldn't event detect the monitor. Sadly I must use this cable, because it's the only way I can get 4K@60FPS.
Probably that cable contains a set of EDID chips to fool your laptop and the monitor - and as EDID works over DDC, obviously no DDC commands will pass.
I connected a Raspberry Pi I keep under the desk as a server via HDMI and I could easily issue commands. Wanted to write a deamon that translates MQTT -> DDC, but never got to that and I removed the cable last time i needed it for something else.
I couldn’t even find any documentation for my monitor. ddcutil worked great for everything it did support, just not the one thing I actually cared about.
I know! All sunglasses are polarized the same way. Gadgets seem to not be consistently designed to work with that polarization and review sites don't tell you. Phones are often diagonally polarized to work around this regardless of landscape/portrait viewing. But you don't swap orientation on a laptop.
My corporate Dell XPS 13 is completely useless outdoors because it's incompatible with sunglasses.
Another commenter mentioned ddcutil which had forgotten about but did use. In my case I used it in a MacBook (Computer #1) and used a different GUI program I can’t remember the name of on my v windows machine (Computer #2).
In my case (Samsung), only HDMI supports 0x60 to switch input. DisplayPort had DDC support for many things but strangely switching inputs does not work.
This is a fantastic project. I'm using it with a cheap usb switch to share screen, keyboard and mouse between my work laptop and home desktop.
My only gripe is that when I press the USB switch to change inputs, I must follow with a press on the keyboard to wake up the other computer, otherwise the monitor sees that the new input has no signal and switches back to the previous input. In which case I must either manually change inputs on the screen, or press the usb switch a couple more things to try again. But I guess there's not much display-switch can do about that..
I have a $250 TESmart HDMI/keyboard/mouse switch, after 6 months I have to power cycle it each time when I woke up the computer. Unreliable.
Also bought Synergy that works fine but I need keep the software running(a wifi switch will lose the connection, so it's not the same as the hardware kvm switch).
I now use usb-switch for keyboard/mouse only, and use my monitor's own button to switch displays, so far it is not convenient but "works".
If you bought the switch from them, their support is pretty good. I would recommend reaching out to them. Otherwise I guess reach out to who you bought it from.
Away from home at the moment, but this looks like it will “complete” my current set up very nicely.
I have 2x Dell P2319H (1080p) monitors and have my work laptop connected via DP with my gaming desktop connected via HDMI. Then I have a dumb USB switch with a button on it to switch my USB devices between the two computers.
If the other computer is off/sleeping the screens most of the time automatically switch to the correct inputs, but sometimes I need to use the screen controls to do it.
This set up cost 10s of dollars as opposed to 100s for a proper KVM switch and it’s worked pretty well for the last 2.5 years.
I’ll try this utility when I get home and it will hopefully make it so the USB switch’s button is all I’ll need to press and it will work, even if both the computers are turned on.
This is really similar to my own setup, only difference being my monitors are 3k and a portrait 1200p. Been using Display-switch for something like 2.5 years too, and never had an issue with it!
I kind of feel disappointed of myself for not hearing of it before although I have searched for a way to script brightness control of my monitors and ended up using suboptimal xrandr for it
It's cool but it only works if you have a rust compiler that can actual compile this (1.55.0) and no one does. That means you have to install a compiler from outside of your system repositories 100% of the time. Is suggesting everyone,
... really such a great idea? Even ignoring the curl | sh it's going to bork many systems now having two rusts. Rust projects you're supposed to compile are not ready for use by anyone but other bleeding edge Rust devs.
I'd argue that that is a failure install and failure to compile. You don't have a binary that can run on your actual system. When I run MS Office in a Windows virtual machine I am running it but it is not cross-platform or running on Linux. I'm virtualizing it. The same applies here.
I control my monitor from a pi zero hooked up to a cheap vga/usb switch. If your monitor supports ddc/ci, ddcutil makes communicating over hdmi dead simple. The button from the usb switch, as well as a wire from the switch's chopped off vga cable is fed into gpio, as is a 4x4 input pad I use to control it from. Pressing D on the pad toggles displays and triggers the USB switch, A50# sets the volume to 50%, B50# brightness to 50%.
The big downside is that switching inputs on my monitor takes ~5 seconds where a proper kvm would be instant.
What does this even mean, turn an already switch to... a switch? Isn't an "USB switch", whatever that means, that can connect to multiple monitors (type C?), already a KVM switch?
> the app only switches monitors "one way" and relies on itself running on the other computers to switch it "the other way" as needed.
Too bad, I often need a KVM switch exactly when I'm installing a new OS on an embedded system (and from that point on I don't need the switch because I can just use the network to log in and install software).
So this solution doesn't work for me at precisely the moment I need it.
I use a similar setup with a hotkey, but the downside is that my monitors take about 5 seconds to switch, which in my case is a serious slow down.
I do not know if other monitors would be faster. I looked at KVM that support high resolution, but they are insanely expensive and I am not even sure they would not introduce any latency.
Can anyone recommend hardware for this? I have a cheap powered USB switch from Amazon I was using but it’s been giving me stuttering issues with my mouse which is a nonstarter for use with a gaming desktop. I’ve also had to unplug and reply my usb DAC each time I switch to get it to work properly.
PSA: if you look in many shops, you can find a number of cheap usb switches and a number of cheap HDMI switches. Buying those two pieces will save money if compared to an integrated kvm switch.
I've been using this since it was created and it works fantastic. The only problem is my bad monitor has like a 5 second timeout if no input is detected!
I've read the project's description and failed to figure what it does.
What's a 'USB switch'?
Where should this device be connected to?
"press one button on your USB switch and all your monitors connect to a different input." - if the USB switch has buttons - why would I even disconnect/reconnect it?
The project's description is shit.
So here is how it works: The program runs on each computer. You plug your USB devices (presumably, a keyboard and a mouse) into a USB switch and then plug that into each computer. Then you plug each computer into each monitor (so you're limited by the minimum total number of inputs on the monitor(s) for how many computers you can switch).
When you press the button on the USB switch to go to another PC, the software detects this and sends data commands over the monitor connection (using DDC standard) to trigger the monitors to switch inputs. You can use this same data communications standard to do things like adjust the brightness of your display. For example, I have these setup on my Mac to adjust the brightness of my two attached displays (complexity increased with multiple displays and desire for each to change at same time, simpler commands with a single display):
alias day="seq 3 | xargs -n 1 -P 3 sh -c 'ddcctl -d \$1 -b 80' sh"
alias evening="seq 3 | xargs -n 1 -P 3 sh -c 'ddcctl -d \$1 -b 32' sh"
alias night="seq 3 | xargs -n 1 -P 3 sh -c 'ddcctl -d \$1 -b 10' sh"
Does that make sense? As mentioned earlier, you're limited by the minimum number of inputs on the monitor(s) and/or the minimum number of computers the USB switch can be connected to. The simplicity of this system is that the display connections do not go through any switching layer and are instead directly connected to the computers (which avoids a number of compatibility issues).
I should be clear that I haven't used this yet but I'm going to try it. The Acer monitors I'm using have two HDMI ports and 1 DisplayPort so I can in practice attach 3 computers assuming I buy a USB switch which can connect to 3 or more computers.
A USB switch is a device that allows you to share USB devices among different computers. For instance, suppose you need to control 2 PCs. Rather than having 2 keyboards and 2 mice, a USB switch allows you to use a single keyboard and a single mouse to control both computers. You press a button on the switch to select which PC you want to control. But you still need 2 monitors...
If you only want a single monitor, there are switches that also switch between different video inputs. These are commonly referred to as "KVM switches" (KVM being Keyboard, Video, Mouse.) But KVM switches cost more money...
My understanding is this project allows you to use a plain USB switch and the multiple video inputs on your monitor to simulate a full blown KVM switch.
Oh, so this software is for the case when your 'USB switch' can be connected to multiple PCs but lacks video input interfaces so you normally have to switch active video input on the monitor yourself, but since your monitor supports DDC/CI you could run the program to automatically send DDC/CI command when needed to the monitor to tell it to switch the active input to the one that is connected to the PC you told your 'USB switch' to make active?
Plug in a device & switches to hdmi1. Unplug & it switches to hdmi2. A USB switch is optional, one could just move where they plug their mouse into by hand, for example. But you don't seem to be interested in helping fill yourself in on anything here, on learning, on using search engines to find anything out. Honestly filling in the neophyte knowledge like that is not what project descriptions are for, in my book.
Generally, dude: relax, chill out. Most everything on this planet could use better description. But this seemed pretty clear & simple to me, at least. I think it'll work for a lot a lot of people as is. No need to be aggressively rude. Have you ever dealt with any kind of soft-kvm like technology before? Perhaps people would more self-select into this kind of project, versus rando's walking in on the street. I think that's ok.
Nothing was clear unless you already knew enough not to need the description at all.
A "USB switch" reads like a switch with a USB cable on it, that the computer it is plugged into can see when it changes. Which is fine, except the fact that a keyboard and mouse are also presumed to be plugged in is not said or hinted.
"DDC/CI" is similarly undefined. A program switching video inputs makes no sense: a computer produces video output, not input. You would need to know the program is sending commands to the monitor to tell that to switch to a different input.
Both of these facts could easily have been in the first sentence. Without, the whole article is noise.
I presume USB switch refers to a USB hub with two "output" USB cables, one of which is active at a time. One can toggle the active by pressing a physical button on the switch. Use case: keyboard and mouse are plugged into the switch and you can quickly toggle them between two laptops without messing with the cables.
Yes, this is exactly what it is. Basically a KVM switch without the V. I've been using the display-switch software for months and it's fantastic. Using the inputs on the monitors to do the video switching instead of an external KVM switch means that you don't have to worry about finding a KVM switch that can handle the signal bandwidth required (in my case, three 4K60 HDR DisplayPort monitors, which is not a use case for which most KVM switches are designed).
When you use a switching USB hub to switch your USB peripherals from one device to another, it detects the change and uses DDC to also change your monitor’s input setting.
It needs to run on each computer in the setup since it watches for the USB devices to connect.
The first result for USB switch on amazon[0] is the descriptively-titled USB 3.0 Switcher Selector 2 Computers Sharing 4 USB Devices KVM Switch Hub Adapter for Keyboard Mouse Printer Scanner U-Disk, Hard Drives, Headsets, KVM Console Box Compatible with Mac/Windows/Linux.
This device switches your keyboards and mice and so on between two computers. The software in OP reacts to these events and switches monitor inputs using some equivalent of HDMI CEC called DDC/CI.
If you actually sat and read it, you'd see that it's a piece of software that sits on each device connected to the USB switch and detects the USB disconnect/reconnect events which trigger when the USB switch is triggered and uses them to detect that the device should try to take control of the display devices.
I sat and read it and I had the same confusion. I've used a KVM before, but never knew that was some version of a KVM without the "V" called a USB switch. It seems like that peripheral must be less common than both USB hubs and real KVMs.
Thanks for posting this! I did not know that I had control of my monitor features this way. My LG 27UK850-W reports the following capabilities when queried.
(First I ran "ddcutil detect" to see what it said.)
Invalid display
I2C bus: /dev/i2c-15
EDID synopsis:
Mfg id: LGD
Model:
Serial number:
Manufacture year: 2013
EDID version: 1.4
DDC communication failed
This is an eDP laptop display. Laptop displays do not support DDC/CI.