Hardware Setup
I have a 2020 MacBook Pro and a Windows machine plugged into a USB switcher with an external 5v power supply. The cable from the switcher to the MacBook is plugged into a the 3.0 port on a Belkin dock, which the MacBook is plugged into. The keyboard is a Massdrop CTRL.
The keyboard in questions works perfectly in the this setup when the switcher is set to the Windows machine, but not when it's switch to the Mac.
I've test all cables as well. The cable between the switcher and dock works fine when the dock is skipped and it gets plugged into the MacBook (the keyboard works).
I've narrowed the issue down to something to do with the dock and the switcher together. The keyboard works perfectly well when either only the dock or the switcher is used with the MacBook, but not when both are used. Other USB keyboards work just fine with both the dock and switcher used.
Debugging
Here are some additional debugging details that I've gathered so far:
$ system_profiler SPUSBDataType
when keyboard plugged into dock:
CTRL Keyboard:
Product ID: 0xeed2
Vendor ID: 0x04d8 (Microchip Technology Inc.)
Version: 1.01
Serial Number: 1608915629
Speed: Up to 12 Mb/s
Manufacturer: Massdrop Inc.
Location ID: 0x01420000 / 7
Current Available (mA): 500
Current Required (mA): 500
Extra Operating Current (mA): 0
And when plugged into switcher:
Hub:
Product ID: 0xeec5
Vendor ID: 0x04d8 (Microchip Technology Inc.)
Version: 1.01
Location ID: 0x01330000
$ dmesg | grep USB
before and after plugging the keyboard into the switcher and diffed:
[3366142.613770]: 978319.845701 AppleUSB20HubPort@01330000: AppleUSBHostPort::terminateDevice: destroying 0x04d8/eec5/0101 (IOUSBHostDevice): connect change interrupt
[3366142.615398]: 978319.847330 AppleUSB20HubPort@01330000: AppleUSBHostPort::enumerateDeviceComplete_block_invoke: enumerated stale device
[3366142.615419]: 978319.847352 IOUSBHostDevice@01330000: IOUSBHostDevice::start_block_invoke: device will not be registered for matching
[3366142.672090]: AppleUSBHostRequestCompleter::clearPipeStallThreadCall: clearStall for pipe <ptr> failed (0xe00002bc)
[3366144.672617]: 978321.904549 AppleUSB20HubPort@01330000: AppleUSBHostPort::terminateDevice: destroying 0x04d8/eec5/0101 (IOUSBHostDevice): connect change interrupt
[3366144.674165]: 978321.906097 AppleUSB20HubPort@01330000: AppleUSBHostPort::enumerateDeviceComplete_block_invoke: enumerated stale device
[3366144.674183]: 978321.906116 IOUSBHostDevice@01330000: IOUSBHostDevice::start_block_invoke: device will not be registered for matching
[3366144.731852]: AppleUSBHostRequestCompleter::clearPipeStallThreadCall: clearStall for pipe <ptr> failed (0xe00002bc)
$ ioreg -p IOUSB
with the keyboard plugged into the dock (working):
+-o Root <class IORegistryEntry, id 0x100000100, retain 26>
+-o AppleUSBVHCIBCE Root Hub Simulation@80000000 <class AppleUSBRootHubDevice, id 0x1000003e3, registered, matched, active, busy 0 (7 ms), retain 15>
| +-o Headset@80400000 <class AppleUSBDevice, id 0x1000003e5, registered, matched, active, busy 0 (0 ms), retain 11>
| +-o Apple T2 Controller@80100000 <class AppleUSBDevice, id 0x1000003eb, registered, matched, active, busy 0 (0 ms), retain 13>
| +-o Touch Bar Backlight@80700000 <class AppleUSBDevice, id 0x1000003f1, registered, matched, active, busy 0 (0 ms), retain 13>
| +-o FaceTime HD Camera (Built-in)@80200000 <class AppleUSBDevice, id 0x1000003f8, registered, matched, active, busy 0 (0 ms), retain 13>
| +-o Touch Bar Display@80600000 <class AppleUSBDevice, id 0x100000401, registered, matched, active, busy 0 (0 ms), retain 13>
| +-o Ambient Light Sensor@80300000 <class AppleUSBDevice, id 0x10000040f, registered, matched, active, busy 0 (0 ms), retain 11>
| +-o Apple Internal Keyboard / Trackpad@80500000 <class AppleUSBDevice, id 0x100105c59, registered, matched, active, busy 0 (2 ms), retain 19>
+-o AppleUSBXHCI Root Hub Simulation@00000000 <class AppleUSBRootHubDevice, id 0x10008f0dc, registered, matched, active, busy 0 (0 ms), retain 8>
+-o AppleUSBXHCI Root Hub Simulation@14000000 <class AppleUSBRootHubDevice, id 0x10009c5ff, registered, matched, active, busy 0 (1 ms), retain 8>
+-o AppleUSBXHCI Root Hub Simulation@01000000 <class AppleUSBRootHubDevice, id 0x100105acb, registered, matched, active, busy 0 (1 ms), retain 11>
+-o USB3.1 Hub@01100000 <class AppleUSBDevice, id 0x1001064ee, registered, matched, active, busy 0 (0 ms), retain 11>
+-o USB2.1 Hub@01300000 <class AppleUSBDevice, id 0x100106505, registered, matched, active, busy 0 (0 ms), retain 14>
| +-o Razer Naga Pro@01340000 <class AppleUSBDevice, id 0x10010651d, registered, matched, active, busy 0 (3 ms), retain 19>
| +-o G533 Gaming Headset@01310000 <class AppleUSBDevice, id 0x10010655a, registered, matched, active, busy 0 (1 ms), retain 17>
| +-o KM360 MX@01320000 <class AppleUSBDevice, id 0x100106594, registered, matched, active, busy 0 (1 ms), retain 13>
+-o IOUSBHostDevice@01400000 <class AppleUSBDevice, id 0x1001071a9, registered, matched, active, busy 0 (0 ms), retain 12>
+-o CTRL Keyboard@01420000 <class AppleUSBDevice, id 0x1001071ba, registered, matched, active, busy 0 (3 ms), retain 17>
And when plugged into the switch hub:
+-o Root <class IORegistryEntry, id 0x100000100, retain 26>
+-o AppleUSBVHCIBCE Root Hub Simulation@80000000 <class AppleUSBRootHubDevice, id 0x1000003e3, registered, matched, active, busy 0 (7 ms), retain 15>
| +-o Headset@80400000 <class AppleUSBDevice, id 0x1000003e5, registered, matched, active, busy 0 (0 ms), retain 11>
| +-o Apple T2 Controller@80100000 <class AppleUSBDevice, id 0x1000003eb, registered, matched, active, busy 0 (0 ms), retain 13>
| +-o Touch Bar Backlight@80700000 <class AppleUSBDevice, id 0x1000003f1, registered, matched, active, busy 0 (0 ms), retain 13>
| +-o FaceTime HD Camera (Built-in)@80200000 <class AppleUSBDevice, id 0x1000003f8, registered, matched, active, busy 0 (0 ms), retain 13>
| +-o Touch Bar Display@80600000 <class AppleUSBDevice, id 0x100000401, registered, matched, active, busy 0 (0 ms), retain 13>
| +-o Ambient Light Sensor@80300000 <class AppleUSBDevice, id 0x10000040f, registered, matched, active, busy 0 (0 ms), retain 11>
| +-o Apple Internal Keyboard / Trackpad@80500000 <class AppleUSBDevice, id 0x100105c59, registered, matched, active, busy 0 (2 ms), retain 19>
+-o AppleUSBXHCI Root Hub Simulation@00000000 <class AppleUSBRootHubDevice, id 0x10008f0dc, registered, matched, active, busy 0 (0 ms), retain 8>
+-o AppleUSBXHCI Root Hub Simulation@14000000 <class AppleUSBRootHubDevice, id 0x10009c5ff, registered, matched, active, busy 0 (1 ms), retain 8>
+-o AppleUSBXHCI Root Hub Simulation@01000000 <class AppleUSBRootHubDevice, id 0x100105acb, registered, matched, active, busy 0 (1 ms), retain 10>
+-o USB3.1 Hub@01100000 <class AppleUSBDevice, id 0x1001064ee, registered, matched, active, busy 0 (0 ms), retain 11>
+-o USB2.1 Hub@01300000 <class AppleUSBDevice, id 0x100106505, registered, matched, active, busy 0 (0 ms), retain 14>
+-o Razer Naga Pro@01340000 <class AppleUSBDevice, id 0x10010651d, registered, matched, active, busy 0 (3 ms), retain 19>
+-o G533 Gaming Headset@01310000 <class AppleUSBDevice, id 0x10010655a, registered, matched, active, busy 0 (1 ms), retain 17>
+-o KM360 MX@01320000 <class AppleUSBDevice, id 0x100106594, registered, matched, active, busy 0 (1 ms), retain 13>
Taking the hub to dock cable and putting it directly in the MacBook in place of the dock (keyboard works in this configuration):
+-o Root <class IORegistryEntry, id 0x100000100, retain 25>
+-o AppleUSBVHCIBCE Root Hub Simulation@80000000 <class AppleUSBRootHubDevice, id 0x1000003e3, registered, matched, active, busy 0 (7 ms), retain 15>
| +-o Headset@80400000 <class AppleUSBDevice, id 0x1000003e5, registered, matched, active, busy 0 (0 ms), retain 11>
| +-o Apple T2 Controller@80100000 <class AppleUSBDevice, id 0x1000003eb, registered, matched, active, busy 0 (0 ms), retain 13>
| +-o Touch Bar Backlight@80700000 <class AppleUSBDevice, id 0x1000003f1, registered, matched, active, busy 0 (0 ms), retain 13>
| +-o FaceTime HD Camera (Built-in)@80200000 <class AppleUSBDevice, id 0x1000003f8, registered, matched, active, busy 0 (0 ms), retain 13>
| +-o Touch Bar Display@80600000 <class AppleUSBDevice, id 0x100000401, registered, matched, active, busy 0 (0 ms), retain 13>
| +-o Ambient Light Sensor@80300000 <class AppleUSBDevice, id 0x10000040f, registered, matched, active, busy 0 (0 ms), retain 11>
| +-o Apple Internal Keyboard / Trackpad@80500000 <class AppleUSBDevice, id 0x100105c59, registered, matched, active, busy 0 (2 ms), retain 19>
+-o AppleUSBXHCI Root Hub Simulation@00000000 <class AppleUSBRootHubDevice, id 0x10008f0dc, registered, matched, active, busy 0 (0 ms), retain 8>
+-o AppleUSBXHCI Root Hub Simulation@14000000 <class AppleUSBRootHubDevice, id 0x10009c5ff, registered, matched, active, busy 0 (1 ms), retain 8>
At this point I'm not familiar enough with USB to know how to proceed further.