0
\$\begingroup\$

In the past year of working from home I grew tired of a ritual that I have to do every morning and every afternoon, the usb peripheral change.

I have tried different solutions multiple keyboards/mices/webcams but its a waste, keyboards and mouses that connect to different devices but this normally are good for work however not so good for my hobbies.

So I decided to look out for a usb switch that would meet my necessities, however I didn't found it or maybe I'm just searching for the wrong thing.

I grew to the conclusion then to search if it would be possible to make my own device with my requirements and who knows maybe help others out there that want to get rid of the extra peripherals and extra cables laying on top of their desks.

So I want to create a USB switch that enables 3 computers to share USB devices, such as keyboard, mouse, camera and other peripherals.

  • The switch will have 3 USB "output" ports that will be used to connect to 3 computers.
  • The switch will have 4 USB ports that will be shared by the 3 computers connected to the switch.
  • The switch will share by the 3 computers the information that the device X is connected, however only I push the button to switch the usb source to that output is when the computer will receive instructions from that device. The idea here is if I connect a mouse to the switch all 3 computers will know that a mouse is connect and ready to use however only the chosen computer will actually receive the data send by the mouse, avoiding this way extra awaiting time when switching a device between computers. This could be also done in another way where all usb are shared by the computers and I choose if some computer should not receive info from usb source port X.
  • The higher the usb specification the better, 3.1 would be ideal.
  • Dedicated power source.
  • Low latency, < 1ms.

The best scenario would be to create something that anyone at home with little knowledge could assemble in their homes, by using certain parts from user friendly providers such as arduino/adafruit.

Would be possible to put together something like this?

Edit:

Regarding the usb3.1 is not something that I'm looking forward to, just wanted to see if possible then other users that might be in need could use the knowledge I have gathered.

Kvm's seems like a possibility however they seem to introduce latency, it could work between computers where latency is not a problem, however I want to have the less delays possible between my personal computer.

Emulation is a field to discover, the reason I want all connected computers to have the a "ghost" from the connected device is because sometimes work computers have software where when you plug in any usb/hid device you have to go and accept it as a trusted device for the session, so every time I switched a device I would have to still do a lot of actions to make the device working on that pc. I assume that if the computer thought the device was always connected this will be a lot less hassle.

Thanks for your time reading this.

Best,

\$\endgroup\$
4
  • 3
    \$\begingroup\$ It sounds like a KVM (keyboard, video, mouse) switch. These are readily available and cheap. What do you need that they don't do? Why do you need USB 3.1 for a keyboard and mouse? (Fast typist?) \$\endgroup\$ – Transistor Jan 23 at 11:16
  • 1
    \$\begingroup\$ So with what do you need help with, to make this a question that can be answered? \$\endgroup\$ – Justme Jan 23 at 11:20
  • \$\begingroup\$ Why can you not just have two keyboards and two mice? That seems easier... \$\endgroup\$ – Hearth Jan 23 at 15:35
  • 2
    \$\begingroup\$ By the way, "<1ms" makes literally no sense. That's not even possible with anything attached via USB as long it's not a pure HiSpeed bus (or SS), let alone low-speed devices like keyboards. Have you been reading gamer forums? There's a certain type of gamers that believe everything a vendor will put on their website and expect it from real devices, so be careful whose benchmarks you read. \$\endgroup\$ – Marcus Müller Jan 23 at 15:42
3
\$\begingroup\$

The idea here is if I connect a mouse to the switch all 3 computers will know that a mouse is connect and ready to use however only the chosen computer will actually receive the data send by the mouse, avoiding this way extra awaiting time when switching a device between computers.

That is not as easy as you think: A host polls every USB device several times a second. It has to respond, otherwise it's proclaimed dead and the bus is reset.

So, you need to have something between computer and, say, mouse that emulates an idling mouse "upwards" for all but the one PC that's "active". Problem is that a mouse, a keyboard, generally devices, are stateful things, so you need to really be continuous in your emulation.

In other words: there needs to be a computer sitting in your "switch" that looks like the specific USB input devices to one side, and like a host computer to the other, and does all this handling.

avoiding this way extra awaiting time when switching a device between computers.

Software problem. Solve in Software. Plugging in a mouse into a computer has never took longer than a second for me until it was ready to be used – are you perhaps using Windows XP or something?

The higher the usb specification the better, 3.1 would be ideal.

Absolutely not. Either you emulate mice, or you pass through USB 3.1. Also, the devices that actually use USB 3.1 are almost all large mass storage media. You can't just "unplug and replug", you need to unmount/"safely remove" or this will, very soon, end in a big disappoointment when you notice there's write caches on your computers. If you want one place to plug in your USB3.1 storage media (external SSD/hard drive/thumb drives) and access them everywhere, that would simply be some network-attached storage. Seeing that USB 3.1 is significantly faster than Gigabit Ethernet, this might need some requirements modelling. I'm sure there's companies willing to sell you 10 Gbit Ethernet NAS systems...

There might be a couple USB2 Hi-Speed, maybe even USB3 SuperSpeed cameras, but they have complex firmware, meaning complex state. You can't just "switch over" these, either.

So, what you want (USB input device emulation in parallel to USB3.1 10Gb/s passthrough) is impossible. What can be done, and is done by the better KVM switches, is emulating input devices upstream; that can be bought. But honestly, the problem you're describing sounds like you should use an operating system that doesn't make you wait after it detected a mouse that it saw yesterday already.

By the way, for "quick" changes between computers, people tend to just have one workstation and use remote desktop methods to log into the others. Unless your PCs differ by hardware very much, I'd also recommend looking into what modern Virtualizers can do – there's no reason you'd need a separate PC to run a Windows for your bookkeeping software on your Mac, for example, or boot into Linux just to get a proper development environment.

\$\endgroup\$
9
  • 2
    \$\begingroup\$ Given the context, virtualization is probably not a help, as the reason for switching PCs sounds like an ownership one. The PC owned by your employer and the PC owned by you are different machines and it is hard to combine them. \$\endgroup\$ – user1937198 Jan 23 at 12:13
  • 2
    \$\begingroup\$ @user1937198 that's true; the remote desktop thing does solve a lot of problems, even if it's just "quickly opening private accounting sheets on my private computer without unplugging keyboards" \$\endgroup\$ – Marcus Müller Jan 23 at 12:15
  • \$\begingroup\$ It feels like I opened a Pandora box, it seems like this will not be achievable. Yes usb 3.1 is something I don't need, I just wanted to make it suitable for other people interests. Remote desktop is not possible has there is the question about accessing from a private computer to a company computer. Reading about kvm seems like a new world to me and from what I read could introduce to much latency between devices. About the emulation part would there be possible to have a controller like pi that emulates the signal to the other pc's, and a pass trough to the pc in use? \$\endgroup\$ – Jose Rocha Jan 23 at 15:26
  • \$\begingroup\$ The reason in emulation is because normally work computers have software where when you plug in any usb/hid device you have to go and accept it as a trusted device for the session, so every time I switched a device I would have to still do a lot of actions to make the device working on that pc. I assume that if the computer thought the device was always connected this will be a lot less hassle. Sorry to write in 2 different comments. \$\endgroup\$ – Jose Rocha Jan 23 at 15:33
  • \$\begingroup\$ @JoseRocha I've never seen such software. Are you able to disable it? \$\endgroup\$ – Hearth Jan 23 at 15:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.