Hacker News new | ask | show | jobs
by mathfailure 1639 days ago
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.
10 comments

Asking sincere questions is fine but please don't call names or post putdowns.

https://news.ycombinator.com/newsguidelines.html

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.

Great description, thanks.
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?

Now I got it, thanks!

> The project's description is shit.

I dunno man, this worked pretty ok for me:

> This utility watches for USB device connect/disconnect events and switches monitor inputs via DDC/CI.

And then a couple lines latter, a sample config that makes it pretty obvious how simple this goes:

> usb_device = "1050:0407" \ on_usb_connect = "Hdmi1" \ on_usb_disconnect = "Hdmi2"

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).

This is the USB switch I use with it: https://www.iogear.com/product/GUS402/

I didn't get it at first either. You need a DDC/CI enabled monitor, which means it can switch input via software. Plug one input on each computer.

The USB switch button will send a connect/disconnect event to both computers and they will then react accordingly.

The button doesn't actually send an event

I wrote a similar program, you just listen for something connected to the hub disappearing

  if mouse no longer connected:

    tell monitor to switch output via DDC

  else if mouse now connected:

    tell monitor to switch back via DDC
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.

https://duckduckgo.com/?q=usb+switch

Came to make the same comment. Read it twice and am still in the dark.
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.

[0]: https://smile.amazon.com/Switcher-Selector-Computers-Keyboar...

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.
> If you actually sat and read it, you'd see that

Without this phrase, your comment would be far friendlier and also not break the HN guidelines.

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.
The “$30 switch” part lead me into thinking it’ll be about controlling some specific hardware in undocumented ways.

A project about cooperatively switching display inputs to get rid of a video switcher should say so in the title.

Not being able to figure out what it does is reasonable if they have no idea what KVM or a USB switch is.