hrvach / deskhop

Fast Desktop Switching Device
GNU General Public License v3.0
5.96k stars 166 forks source link

Non-functioning keyboard #71

Open p3lim opened 3 months ago

p3lim commented 3 months ago

I have a custom keyboard running the QMK firmware, and it's not recognized by my deskhop.

I tested with 3 other keyboard that worked fine:

All of these reports multiple HID interfaces when connected directly to my host, e.g:

kernel: usb 1-4: new low-speed USB device number 24 using xhci_hcd
kernel: usb 1-4: New USB device found, idVendor=20a0, idProduct=4246, bcdDevice= 2.00
kernel: usb 1-4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
kernel: usb 1-4: Product: B.face
kernel: usb 1-4: Manufacturer: Winkeyless
kernel: input: Winkeyless B.face as /devices/pci0000:00/0000:00:08.1/0000:04:00.3/usb1/1-4/1-4:1.0/0003:20A0:4246.0019/input/input58
kernel: hid-generic 0003:20A0:4246.0019: input,hidraw2: USB HID v1.01 Keyboard [Winkeyless B.face] on usb-0000:04:00.3-4/input0
kernel: input: Winkeyless B.face Keyboard as /devices/pci0000:00/0000:00:08.1/0000:04:00.3/usb1/1-4/1-4:1.1/0003:20A0:4246.001A/input/input59
kernel: input: Winkeyless B.face Mouse as /devices/pci0000:00/0000:00:08.1/0000:04:00.3/usb1/1-4/1-4:1.1/0003:20A0:4246.001A/input/input60
kernel: hid-generic 0003:20A0:4246.001A: input,hidraw3: USB HID v1.01 Keyboard [Winkeyless B.face] on usb-0000:04:00.3-4/input1

kernel: usb 1-4: new full-speed USB device number 23 using xhci_hcd
kernel: usb 1-4: New USB device found, idVendor=1532, idProduct=025d, bcdDevice= 2.00
kernel: usb 1-4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
kernel: usb 1-4: Product: Razer Ornata V2
kernel: usb 1-4: Manufacturer: Razer
kernel: input: Razer Razer Ornata V2 as /devices/pci0000:00/0000:00:08.1/0000:04:00.3/usb1/1-4/1-4:1.0/0003:1532:025D.0015/input/input53
kernel: hid-generic 0003:1532:025D.0015: input,hidraw2: USB HID v1.11 Keyboard [Razer Razer Ornata V2] on usb-0000:04:00.3-4/input0
kernel: input: Razer Razer Ornata V2 Keyboard as /devices/pci0000:00/0000:00:08.1/0000:04:00.3/usb1/1-4/1-4:1.1/0003:1532:025D.0016/input/input54
kernel: input: Razer Razer Ornata V2 as /devices/pci0000:00/0000:00:08.1/0000:04:00.3/usb1/1-4/1-4:1.1/0003:1532:025D.0016/input/input55
kernel: hid-generic 0003:1532:025D.0016: input,hidraw3: USB HID v1.11 Keyboard [Razer Razer Ornata V2] on usb-0000:04:00.3-4/input1
kernel: input: Razer Razer Ornata V2 as /devices/pci0000:00/0000:00:08.1/0000:04:00.3/usb1/1-4/1-4:1.2/0003:1532:025D.0017/input/input56
kernel: hid-generic 0003:1532:025D.0017: input,hidraw4: USB HID v1.11 Mouse [Razer Razer Ornata V2] on usb-0000:04:00.3-4/input2
kernel: input: Razer Razer Ornata V2 Consumer Control as /devices/pci0000:00/0000:00:08.1/0000:04:00.3/usb1/1-4/1-4:1.3/0003:1532:025D.0018/input/input57
kernel: hid-generic 0003:1532:025D.0018: input,hiddev1,hidraw5: USB HID v1.11 Device [Razer Razer Ornata V2] on usb-0000:04:00.3-4/input3

kernel: usb 1-4: new low-speed USB device number 25 using xhci_hcd
kernel: usb 1-4: New USB device found, idVendor=17ef, idProduct=6099, bcdDevice= 1.02
kernel: usb 1-4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
kernel: usb 1-4: Product: Lenovo Traditional USB Keyboard
kernel: usb 1-4: Manufacturer: LiteOn
kernel: input: LiteOn Lenovo Traditional USB Keyboard as /devices/pci0000:00/0000:00:08.1/0000:04:00.3/usb1/1-4/1-4:1.0/0003:17EF:6099.001B/input/input61
kernel: hid-generic 0003:17EF:6099.001B: input,hidraw2: USB HID v1.11 Keyboard [LiteOn Lenovo Traditional USB Keyboard] on usb-0000:04:00.3-4/input0
kernel: input: LiteOn Lenovo Traditional USB Keyboard Consumer Control as /devices/pci0000:00/0000:00:08.1/0000:04:00.3/usb1/1-4/1-4:1.1/0003:17EF:6099.001C/input/input62
kernel: input: LiteOn Lenovo Traditional USB Keyboard System Control as /devices/pci0000:00/0000:00:08.1/0000:04:00.3/usb1/1-4/1-4:1.1/0003:17EF:6099.001C/input/input63
kernel: hid-generic 0003:17EF:6099.001C: input,hidraw3: USB HID v1.11 Device [LiteOn Lenovo Traditional USB Keyboard] on usb-0000:04:00.3-4/input1

kernel: usb 1-4: new full-speed USB device number 26 using xhci_hcd
kernel: usb 1-4: New USB device found, idVendor=3434, idProduct=0610, bcdDevice= 1.02
kernel: usb 1-4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
kernel: usb 1-4: Product: Keychron Q1 Pro
kernel: usb 1-4: Manufacturer: Keychron
kernel: input: Keychron Keychron Q1 Pro as /devices/pci0000:00/0000:00:08.1/0000:04:00.3/usb1/1-4/1-4:1.0/0003:3434:0610.001D/input/input64
kernel: hid-generic 0003:3434:0610.001D: input,hidraw2: USB HID v1.11 Keyboard [Keychron Keychron Q1 Pro] on usb-0000:04:00.3-4/input0
kernel: hid-generic 0003:3434:0610.001E: hiddev1,hidraw3: USB HID v1.11 Device [Keychron Keychron Q1 Pro] on usb-0000:04:00.3-4/input1
kernel: input: Keychron Keychron Q1 Pro Mouse as /devices/pci0000:00/0000:00:08.1/0000:04:00.3/usb1/1-4/1-4:1.2/0003:3434:0610.001F/input/input65
kernel: input: Keychron Keychron Q1 Pro System Control as /devices/pci0000:00/0000:00:08.1/0000:04:00.3/usb1/1-4/1-4:1.2/0003:3434:0610.001F/input/input66
kernel: input: Keychron Keychron Q1 Pro Consumer Control as /devices/pci0000:00/0000:00:08.1/0000:04:00.3/usb1/1-4/1-4:1.2/0003:3434:0610.001F/input/input67
kernel: input: Keychron Keychron Q1 Pro Keyboard as /devices/pci0000:00/0000:00:08.1/0000:04:00.3/usb1/1-4/1-4:1.2/0003:3434:0610.001F/input/input68
kernel: hid-generic 0003:3434:0610.001F: input,hidraw4: USB HID v1.11 Mouse [Keychron Keychron Q1 Pro] on usb-0000:04:00.3-4/input2

The only real difference I see between them are the USB HID version they report, all 3 of the keyboards that work report USB HID v1.11, while my QMK-based keyboard report v1.01.

hrvach commented 3 months ago

I don't think it's related to HID version, most likely QMK is nkro and doesn't support boot mode?

Try building QMK without NKRO_ENABLE and check if it works.

p3lim commented 3 months ago

Tried disabling NKRO and it didn't really help.

I have another keyboard, also running QMK (nothing is similar between this one and the one I have issues with other than QMK, they have different controllers, architectures etc), with NKRO enabled, and it works fine. This one is also HID v1.11.

I'm not saying the HID version is necessarily the fault here, but it's the only real difference I can see between all these boards.

hrvach commented 3 months ago

Maybe the keyboard is also a mouse, and moving the mouse out of the boot protocol mode also reconfigures the keyboard. Can you provide its usb hid report? It might provide some more info.

p3lim commented 3 months ago

I've also disabled mousekeys on it, even bootmagic and mediakeys was removed to test. I'm unsure how to generate a usb hid report, if you could provide some clarity on that.

hrvach commented 3 months ago

If you have Linux, try using "usbhid-dump" and paste the output. Package would be usbutils.

p3lim commented 3 months ago

Here you go:

001:042:001:DESCRIPTOR         1711234394.703242
 05 01 09 80 A1 01 85 03 19 01 2A B7 00 15 01 26
 B7 00 95 01 75 10 81 00 C0 05 0C 09 01 A1 01 85
 04 19 01 2A A0 02 15 01 26 A0 02 95 01 75 10 81
 00 C0

001:042:000:DESCRIPTOR         1711234394.717223
 05 01 09 06 A1 01 05 07 19 E0 29 E7 15 00 25 01
 95 08 75 01 81 02 95 01 75 08 81 03 05 07 19 00
 29 FF 15 00 26 FF 00 95 06 75 08 81 00 05 08 19
 01 29 05 15 00 25 01 95 05 75 01 91 02 95 01 75
 03 91 03 C0
hrvach commented 3 months ago

Looks normal, report matches the "usual" format (modifiers, reserved, 6 keys). It could be something simple, but it's very hard to debug remotely. I'll be trying to implement the hid report mode for keyboards soon, perhaps that will fix it.

hrvach commented 3 months ago

@p3lim can you please also try test_fw.zip and let me know if this fixes anything?

p3lim commented 3 months ago

No change.

p3lim commented 2 months ago

With the latest commits and back at the office after easter break the Lenovo keyboard (3rd in the original post) no longer works as well.

p3lim commented 2 months ago

A little more testing, it seems that the keyboard port doesn't work at all with the latest commits. Putting the Lenovo keyboard in the mouse slot and it works fine.

hrvach commented 2 months ago

A little more testing, it seems that the keyboard port doesn't work at all with the latest commits. Putting the Lenovo keyboard in the mouse slot and it works fine.

Can you try rebuilding with enforce_ports to 1 in user config? Any difference?

p3lim commented 2 months ago

Same issue with ENFORCE_PORTS set to 1, except now port 1 doesn't take the keyboard any more (as expected).

p3lim commented 2 months ago

Oh that was just me being (kind of) stupid; I have both of the host ports connected to monitors, both of which are USB-C docks, and the computer in one of them had gone to sleep, which turned the USB hub in the monitor off, thus one of the picos were not powered.

That is kind of a fault with the design though, ports not working unless both hosts are connected and powered.

hrvach commented 2 months ago

It is a crappy trade-off to make it simple, affordable and galvanically isolated. If one side powered both, then some keyboards/mice would not work because the cumulative power draw would be too large. If you provided an external PS, then we all would use whatever we had on hand to connect 230V on one side, and an expensive laptop on the other side. Not all chargers are good like this:

https://www.righto.com/2012/05/apple-iphone-charger-teardown-quality.html

I could redesign the board to provide external power if somebody really wants to do this :)

hrvach commented 1 month ago

@p3lim any change with the latest experimental beta

https://github.com/hrvach/deskhop/releases/tag/v0.60

?

p3lim commented 1 month ago

Still no :frowning_face:

jalmeroth commented 1 month ago

@hrvach I'm sorry for this stupid comment, but v0.60 is the same commit as v0.52, right? :see_no_evil: swappy-20240524_160710

hrvach commented 1 month ago

Changes not committed yet, under (heavy) construction but lack devices to test...

hrvach commented 1 month ago

cc: @jalmeroth @p3lim apologies to bug you, I'd appreciate some help with testing something else if you have a moment?