News for hackers. Stuff that matters.
Re:I2c-USB-hub: An i2C Controllable USB 2.0 Hub by brunorsini on Tuesday September 12, 2023 @04:20AM (#37478157)
Last year I bought a second computer for my music studio. I wanted to use the same set of 2 monitors and wired keyboard + trackpad on both machines.

I wrote simple scripts to switch my monitor inputs with keyboard shortcuts (even simpler with Lunar, amazing new Mac app — https://lunar.fyi), which saved me from having to press annoying input-source buttons.

But I couldn't for the life of me find a simple, suitable software controllable KVM switch. That still requires the hardware button to be controlled, so frustrating.

Re:I2c-USB-hub: An i2C Controllable USB 2.0 Hub by boffinAudio on Tuesday September 12, 2023 @04:41AM (#37478287)
I am constantly on the lookout for a monitor that has a USB port/KVM switch built in - it seems like such a no-brainer, but alas there are very few options like this available out there .. I do recall someone making an open-source KVM switcher design some time ago, will have to try and dig it out of the archives ..
Re:I2c-USB-hub: An i2C Controllable USB 2.0 Hub by Hendrikto on Tuesday September 12, 2023 @04:49AM (#37478338)
> I am constantly on the lookout for a monitor that has a USB port/KVM switch built in

Dough (formerly Eve) Spectrum monitors have this feature. They are also great all-round monitors.

Re:I2c-USB-hub: An i2C Controllable USB 2.0 Hub by the_pwner224 on Tuesday September 12, 2023 @06:45AM (#37479121)
Lots of Dell monitors support this - probably every single currently-in-production Ultrasharp supports it, and I think some of the lower tier non-Ultrasharps may support it as well.

Dell monitors all support DDC, I'm not sure if KVM switching can be controlled over DDC but it's likely.

Somewhat unrelated, but some of the Dell monitors also have USB-C support, where a single USB-C cable connects to your laptop and: charges it (Power Delivery from the monitor), hooks up the display (DP alt mode), and connects to the USB hub on the monitor. So if you use a wireless kb/mouse with receivers plugged into the monitor, you'll have literally just 2 cables on your desk - a power cable for your monitor, and a USB-C cable between the monitor and laptop.

Re:I2c-USB-hub: An i2C Controllable USB 2.0 Hub by bazzargh on Tuesday September 12, 2023 @07:48AM (#37479615)
For me, you want 2 more wires:

- the laptop to the side is awkwardly positioned for zoom chat, so you probably want a webcam as well

- audio is a problem. If you use bluetooth and swap lots of things over then you keep needing to re-pair which is a pain. The model I have (Dell UltraSharp 27 USB-C Hub Monitor - U2722DE) has an audio jack but this is for connecting to soundbars not headphones, and the soundbars Dell offered that are compatible with that monitor don't support headphones. So, I ended up using a USB headset. You can use bluetooth with a usb soundcard dongle to avoid swapping, but bidirectional sound is an issue with that so you'll want to use the mic on the webcam (if you got one like that)

My keyboard/trackball are wired to the monitor, there doesn't seem to be much point to having wireless to attach something that's only a foot away anyway.

Either way, it's one connection to the laptop, but 4-5 other things need to connect to the monitor too. Still pretty good and not too much clutter tho

Re:I2c-USB-hub: An i2C Controllable USB 2.0 Hub by hamandcheese on Tuesday September 12, 2023 @11:04AM (#37482383)
+1, I recently got a Dell and it works great.

I have a desktop Linux PC but I often need to switch to my MacBook. If I plug the MacBook in, all my peripherals automatically switch to it. If I unplug, everything switch he's back to the Linux PC.

You can definitely use DDC to switch inputs, and the KVM is linked to the selected input. On MacOS I use Better Display which lets me switch inputs from a menu bar app. On linux there is ddcui (which is more like a proof of concept than a polished app, but it works). It's rare that I need to use this though since the auto-switching is usually all I need.

Re:I2c-USB-hub: An i2C Controllable USB 2.0 Hub by bdd on Tuesday September 12, 2023 @02:57PM (#37486058)
> I'm not sure if KVM switching can be controlled over DDC but it's likely.

They do. Here's my shell function that helps me switch between DisplayPort-1 + USB uplink cable to the host AND USB-C cable with DisplayPort Alt Mode+Charging+uplink to display's USB hub.

  # x0f: DisplayPort-1
  # x1b: USB-C
  DDC_SOURCES=("x0f" "x1b")

  switchkvm() {
    local vcp_input_src="x60"
    local current next src
    current=$(ddcutil -t getvcp ${vcp_input_src} | awk '{ print $4 }')
    for src in "${DDC_SOURCES[@]}"; do
      if [[ ${src} != "${current}" ]]; then
        next=${src}
      fi
    done
  
    if [[ -z ${next} ]]; then
      echo "No eligible alternate input in \$DDC_SOURCES" >&2
      echo "\$DDC_SOURCES=(${DDC_SOURCES[*]}); current=${current}"
      return 1
    fi

    ddcutil setvcp "${vcp_input_src}" "${next}"
  }
Re:I2c-USB-hub: An i2C Controllable USB 2.0 Hub by boffinAudio on Monday September 18, 2023 @05:12AM (#37553936)
Thanks for sharing that - its very useful to know that there is a way to do this, I just need to select the right hardware ..
Re:I2c-USB-hub: An i2C Controllable USB 2.0 Hub by edualm on Tuesday September 12, 2023 @10:44AM (#37482094)
Some exist. I have the Philip 279M1RV, which is 4K 144Hz with a built-in KVM. It's not a perfect monitor, but was the best one I could find for my needs, spec-wise.
Re:I2c-USB-hub: An i2C Controllable USB 2.0 Hub by kjs3 on Wednesday September 13, 2023 @08:21AM (#37495758)
I have a pair of Gigabyte M32U monitors that have an integrated KVM, which I confess I don't use (they're on a discrete KVM). Nice monitors.
Re:I2c-USB-hub: An i2C Controllable USB 2.0 Hub by rft on Tuesday September 12, 2023 @05:06AM (#37478461)
If you are up for some hardware tinkering, you might be able to modify an existing KVM switch to add remote control.

I had a KVM switch with a wired button (place KVM out of the way, put small button on your desk). The button was connected via a 3.5mm "audio" jack. I never measured the interface, but I bet it just connected two rings of the jack.

Using a switch like that, you can build your own control for it without opening the KVM. Either with an ESP for wifi control (MQTT would be my choice) or a smaller board for USB/serial control (Cortex-M dev board). Short the proper rings via an optocoupler controlled by the MCU and it will behave as if you pressed the button.

Re:I2c-USB-hub: An i2C Controllable USB 2.0 Hub by ARob109 on Tuesday September 12, 2023 @08:03AM (#37479772)
For full software no hardware kvm solution, there is Microsoft Garage Mouse Without Borders. Wish it was open source. Mostly useful for multi monitor setup where you don’t need to change sources just change keyboard and mouse. For soft switching source I use a script to send DDC commands to the monitor
Re:I2c-USB-hub: An i2C Controllable USB 2.0 Hub by thetoon on Tuesday September 12, 2023 @08:18AM (#37479938)
Isn't that functionnaly the same as Synergy (which was opensource but isn't anymore), and it's opensource fork Barrier (https://github.com/debauchee/barrier) ?
Re:I2c-USB-hub: An i2C Controllable USB 2.0 Hub by alanbernstein on Tuesday September 12, 2023 @08:49AM (#37480352)
What monitor model do you have? I want the same thing, and the Samsung monitor I bought previously doesn't support very much.

Like sibling comment, I have a 4-port USB switch with a remote that connects via micro-usb, it was quite easy to hack a custom remote that I keep next to my keyboard.

Re:I2c-USB-hub: An i2C Controllable USB 2.0 Hub by liminalsunset on Tuesday September 12, 2023 @11:33AM (#37482816)
If you or anyone else is still looking for a programmable or controllable USB KVM, though this also comes with a HDMI 2.0 4K 60hz switcher and is accordingly more expensive,

https://www.aliexpress.com/item/1005005149590635.html

is probably what you need. It has a USB port linked to a USB serial internally that you send strings to switch. It was designed to be used with the Pi KVM/BLIKVM KVM over IP solution but works for other things as well.