ckb-next / ckb-next

RGB Driver for Linux
GNU General Public License v2.0
3.21k stars 267 forks source link

K65 RGB MINI 60% Mechanical Keyboard - 1baf #721

Open jasonwitty opened 3 years ago

jasonwitty commented 3 years ago

Request to add K65 mini. please let me know if there is anything I can do to help. report is attached.

https://www.corsair.com/us/en/Categories/Products/Gaming-Keyboards/RGB-Mechanical-Gaming-Keyboards/K65-RGB-MINI-60%25-Mechanical-Gaming-Keyboard/p/CH-9194014-NA

this is a badass little keyboard. running on Linux Mint 20.1 Cinnamon / 5.8.0-53-generic

https://termbin.com/jitg

ckb-next-report-1622866167.gz

jasonwitty commented 3 years ago
Generated Report ``` Bus 001 Device 010: ID 1b1c:1baf Corsair Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 2.00 bDeviceClass 0 bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 64 idVendor 0x1b1c Corsair idProduct 0x1baf bcdDevice 0.0c iManufacturer 1 Corsair iProduct 2 CORSAIR K65 RGB MINI 60% Mechanical Gaming Keyboard iSerial 3 F50019005F74B0BFABA86D261000B034 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 0x005b bNumInterfaces 3 bConfigurationValue 1 iConfiguration 0 bmAttributes 0xa0 (Bus Powered) Remote Wakeup MaxPower 500mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 1 bInterfaceClass 3 Human Interface Device bInterfaceSubClass 1 Boot Interface Subclass bInterfaceProtocol 1 Keyboard iInterface 0 HID Device Descriptor: bLength 9 bDescriptorType 33 bcdHID 1.00 bCountryCode 0 Not supported bNumDescriptors 1 bDescriptorType 34 Report wDescriptorLength 154 Report Descriptors: ** UNAVAILABLE ** Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN can't get debug descriptor: Resource temporarily unavailable bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0010 1x 16 bytes bInterval 4 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 1 bAlternateSetting 0 bNumEndpoints 2 bInterfaceClass 3 Human Interface Device bInterfaceSubClass 0 bInterfaceProtocol 0 iInterface 0 HID Device Descriptor: bLength 9 bDescriptorType 33 bcdHID 1.00 bCountryCode 0 Not supported bNumDescriptors 1 bDescriptorType 34 Report wDescriptorLength 29 Report Descriptors: ** UNAVAILABLE ** Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x82 EP 2 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0400 1x 1024 bytes bInterval 4 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x01 EP 1 OUT bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0400 1x 1024 bytes bInterval 4 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 2 bAlternateSetting 0 bNumEndpoints 1 bInterfaceClass 3 Human Interface Device bInterfaceSubClass 0 bInterfaceProtocol 0 iInterface 0 HID Device Descriptor: bLength 9 bDescriptorType 33 bcdHID 1.00 bCountryCode 0 Not supported bNumDescriptors 1 bDescriptorType 34 Report wDescriptorLength 21 Report Descriptors: ** UNAVAILABLE ** Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x83 EP 3 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0040 1x 64 bytes bInterval 4 Device Qualifier (for other device speed): bLength 10 bDescriptorType 6 bcdUSB 2.00 bDeviceClass 0 bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 64 bNumConfigurations 1 Device Status: 0x0000 (Bus Powered) ```
Supercip971 commented 2 years ago

I can also help if you need support for the k65 rgb mini.

xtien commented 2 years ago

Has K65 rgb mini been added? If not, can I help?

jasonwitty commented 2 years ago

It is not supported yet, at least on the main branch. my device is still not detected.

kontroll commented 2 years ago

Is there anything us mere mortals can do to help this along? :)

tatokis commented 2 years ago

You can try replacing the USB IDs in src/daemon/usb.h for either the K95 Platinum XT or the K100 (in the k100 branch) and see if any of them do anything (with --enable-experimental). Be prepared for keyboard input to stop working if something isn't right, so it's best not to install ckb-next-daemon while testing, and also have a secondary keyboard plugged in.

JOT85 commented 2 years ago

@tatokis does the software do anything that would be likely to brick the device if something wasn't quite as expected?

tatokis commented 2 years ago

Typically, no. I haven't had anything like that happen before, but even on the remote chance it'd happen, these devices are usually pretty easily recoverable (unless they're wireless). That said, I do not guarantee anything, and the usual GPL disclaimer applies.

JOT85 commented 2 years ago

Cool, sounds good! How do you go about recovering them? Factory reset or using software?

tatokis commented 2 years ago

If it's behaving weird, holding down esc while plugging it in should factory reset it. If the firmware gets corrupt, it either goes into a "safe mode" where you can normally flash new firmware, or it shows up as a usb flash drive where you can, again, copy the firmware over.

You can manually trigger the latter mode by holding down the reset switch that's usually hidden under one of the legs on the keyboard while plugging it in, and then back up the firmware for later use. If you don't have the reset hole anywhere, then this might not apply. I haven't messed with firmware on devices that don't have it.

But again, it's very likely that the daemon will temporarily break input if it's not set correctly, so just having another keyboard and stopping the daemon (either through systemctl if installed system wide, or killall if ran locally) and a replug should bring it back.

GinjNTonic commented 2 years ago

You can try replacing the USB IDs in src/daemon/usb.h for either the K95 Platinum XT or the K100 (in the k100 branch) and see if any of them do anything (with --enable-experimental). Be prepared for keyboard input to stop working if something isn't right, so it's best not to install ckb-next-daemon while testing, and also have a secondary keyboard plugged in.

Pardon my noobness, I'm trying to get the K55 Pro XT detected by following this advice. What do you mean by "--enable-experimetnal"? @tatokis

antonio-guillen commented 2 years ago

Same problem here, K55 Pro XT is not detected by version 0.4.4 image

mlemiam commented 2 years ago

Same problem here, K55 Pro XT is not detected by version 0.4.4 image

same :/

Alyx-LeGuen commented 1 year ago

You can try replacing the USB IDs in src/daemon/usb.h for either the K95 Platinum XT or the K100 (in the k100 branch) and see if any of them do anything (with --enable-experimental). Be prepared for keyboard input to stop working if something isn't right, so it's best not to install ckb-next-daemon while testing, and also have a secondary keyboard plugged in.

I tested this just now and on the k95 Platinum XT, I 've got an error with the keyboard disconnecting in a loop

# ckb-next-daemon log
[I] Connecting CORSAIR K65 RGB MINI 60% Mechanical Gaming Keyboard at /dev/input/ckb1
[I] Starting input thread for /dev/input/ckb1
[I] Found EP 0x81 at /sys/devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3:1.0/ep_81
[I] Found EP 0x82 at /sys/devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3:1.1/ep_82
[I] Found EP 0x83 at /sys/devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3:1.2/ep_83
[E] os_usb_interrupt_out (via bragi_common.c:9): No such file or directory, res = 0xffffffff
[F] start_bragi_common (device_bragi.c:109): ckb1: Couldn't get bragi device mode. Aborting
[I] Attempting reset...
[E] os_usb_interrupt_out (via bragi_common.c:9): No such file or directory, res = 0xffffffff
[F] start_bragi_common (device_bragi.c:109): ckb1: Couldn't get bragi device mode. Aborting
... loop with the same message

No logs from ckb-next app

And with k100-v2 branch, the keyboard works but it is not possible to modify the keys and the leds are off with the following logs:

# ckb-next log
Starting "/.../ckb-next/build/bin/gradient"
qt.gui.icc: Unsupported ICC profile class 70727472
QPngHandler: Failed to parse ICC profile
qt.gui.icc: Unsupported ICC profile class 70727472
QPngHandler: Failed to parse ICC profile
qt.gui.icc: Unsupported ICC profile class 70727472
QPngHandler: Failed to parse ICC profile
# ckb-next-daemon log
[I] Connecting CORSAIR K65 RGB MINI 60% Mechanical Gaming Keyboard at /dev/input/ckb1
[I] Starting input thread for /dev/input/ckb1
[I] Found EP 0x81 at /sys/devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3:1.0/ep_81
[I] Found EP 0x82 at /sys/devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3:1.1/ep_82
[I] Found EP 0x83 at /sys/devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3:1.2/ep_83
[W] bragi_get_property (bragi_common.c:13): Failed to get property 0x15. Device said it's not supported.
[W] bragi_get_property (bragi_common.c:13): Failed to get property 0x16. Device said it's not supported.
[I] ckb1: Pairing id: 00 00 00 00 00 00 00 00 
[I] Setup finished for /dev/input/ckb1
[E] bragi_open_handle (bragi_common.c:193): Failed to open handle 0x0. Error was 0x1

Hoping it can help : └─$ lsusb |grep Corsair Bus 003 Device 027: ID 1b1c:1baf Corsair CORSAIR K65 RGB MINI 60% Mechanical Gaming Keyboard

tatokis commented 1 year ago

@Alyx-LeGuen Thank you for testing. Can you re-check that your k100-v2 branch is up to date? Make sure it contains this commit https://github.com/ckb-next/ckb-next/commit/cc5ee4704f8cb669c1058c79d95a30150591f8e4 .

It looks like the K100 and the K65 RGB mini are extremely similar, and some of the K100s fail setting up the lights in the same way without the changes in that commit.

Alyx-LeGuen commented 1 year ago

@tatokis Thanks for the quick response, I do have the latest version of branch k100-v2 but unfortunately the lights are still off.

And also, I can modify the bindings it works but I have to redo all the mapping of the secondary keys (FN key). (ALT and ALT GR are OK)

# From ckb-next-daemon
ckb-next: Corsair RGB driver 0.5.0-32-gcc5ee47
[I] Root controller ready at /dev/input/ckb0
[I] Connecting CORSAIR K65 RGB MINI 60% Mechanical Gaming Keyboard at /dev/input/ckb1
[I] Starting input thread for /dev/input/ckb1
[I] Found EP 0x81 at /sys/devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3:1.0/ep_81
[I] Found EP 0x82 at /sys/devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3:1.1/ep_82
[I] Found EP 0x83 at /sys/devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3:1.2/ep_83
[W] bragi_get_property (bragi_common.c:13): Failed to get property 0x15. Device said it's not supported.
[W] bragi_get_property (bragi_common.c:13): Failed to get property 0x16. Device said it's not supported.
[I] ckb1: Pairing id: 00 00 00 00 00 00 00 00 
[I] Setup finished for /dev/input/ckb1

# And when opening ckb-next app
[E] bragi_open_handle (bragi_common.c:193): Failed to open handle 0x0. Error was 0x1
[W] setactive_bragi (device_bragi.c:95): ckb1: Bragi light init returned not supported
[E] bragi_open_handle (bragi_common.c:193): Failed to open handle 0x0. Error was 0x1
[W] setactive_bragi (device_bragi.c:95): ckb1: Bragi light init returned not supported
tatokis commented 1 year ago

@Alyx-LeGuen What I'm confused about is that in both cases it says "Bragi light init returned not supported". The second time it should say "Bragi alt light init returned error..." instead.

Can you build with cmake .. -DDEBUG_USB_SEND=1 -DDEBUG_USB_RECV=1 and (making sure the brightness in the GUI is set to 0%) attach the daemon log? If the brightness is not 0, it'll spam the logs with RGB data.

Alyx-LeGuen commented 1 year ago

@tatokis I modified in quickinstall file, line 51 :

cmake -H. -Bbuild -DCMAKE_BUILD_TYPE=Release -DSAFE_INSTALL=ON -DSAFE_UNINSTALL=ON -DDEBUG_USB_SEND=1 -DDEBUG_USB_RECV=1

That's it ?

And I generated a report from the application (with 0% brightness) : ckb-next-report-1663148797.gz

Deamon logs seems very similar to the last one

tatokis commented 1 year ago

@Alyx-LeGuen Interesting, it's not actually failing. Can you try changing the number 193 to 123 in: https://github.com/ckb-next/ckb-next/blob/cc5ee4704f8cb669c1058c79d95a30150591f8e4/src/daemon/led_bragi.c#L41

So that it reads:

    LED_CASE_K(P_K100, 123);

and then see if the lighting works (make sure the brightness is not set to 0, and that you have undone the changes in quickinstall).

Alyx-LeGuen commented 1 year ago

@tatokis It works ! 😄 🎉 I've pulled latest version from the k100-v2 branch (d05de233f90656a881db1114f465b2df084770ee) and modified led_bragi.c (193 to 123).

I still have this logs from daemon :

[E] bragi_open_handle (bragi_common.c:193): Failed to open handle 0x0. Error was 0x1
[W] setactive_bragi (device_bragi.c:95): ckb1: Bragi light init returned not supported
tatokis commented 1 year ago

@Alyx-LeGuen Perfect! Those errors are expected.

There are a few things I need to fix first, and then I'll merge support for the K100 and add support for the K65 Mini.

Alyx-LeGuen commented 1 year ago

@tatokis Cool, let me know if you need to do more tests. Thank you very much and have a nice day!

tatokis commented 1 year ago

@Alyx-LeGuen please give the latest code from k100-v2 a try. You should not need to modify anything.

Alyx-LeGuen commented 1 year ago

@tatokis Tested just now with commit e0b1ff19b1d6e7021c32ffc17612264fe7e944e8 and the keyboard restarts in a loop

From the daemon log

ckb-next: Corsair RGB driver 0.5.0-66-ge0b1ff1
[I] Root controller ready at /dev/input/ckb0
[I] Connecting CORSAIR K65 RGB MINI 60% Mechanical Gaming Keyboard at /dev/input/ckb1
[E] os_usb_interrupt_out (via bragi_common.c:9): No such file or directory, res = 0xffffffff
[F] start_bragi_common (device_bragi.c:154): ckb1: Couldn't get bragi device mode. Aborting
[I] Attempting reset...
[I] Starting input thread for /dev/input/ckb1
[I] Found EP 0x81 at /sys/devices/pci0000:00/0000:00:14.0/usb3/3-1/3-1:1.0/ep_81
[I] Found EP 0x82 at /sys/devices/pci0000:00/0000:00:14.0/usb3/3-1/3-1:1.1/ep_82
[I] Found EP 0x83 at /sys/devices/pci0000:00/0000:00:14.0/usb3/3-1/3-1:1.2/ep_83
[E] os_usb_interrupt_out (via bragi_common.c:9): No such file or directory, res = 0xffffffff
[F] start_bragi_common (device_bragi.c:154): ckb1: Couldn't get bragi device mode. Aborting
[E] os_usb_interrupt_out (via bragi_common.c:9): No such file or directory, res = 0xffffffff
[F] start_bragi_common (device_bragi.c:154): ckb1: Couldn't get bragi device mode. Aborting
[E] os_usb_interrupt_out (via bragi_common.c:9): No such file or directory, res = 0xffffffff
[F] start_bragi_common (device_bragi.c:154): ckb1: Couldn't get bragi device mode. Aborting
[E] os_usb_interrupt_out (via bragi_common.c:9): No such file or directory, res = 0xffffffff
[F] start_bragi_common (device_bragi.c:154): ckb1: Couldn't get bragi device mode. Aborting
[E] os_usb_interrupt_out (via bragi_common.c:9): No such file or directory, res = 0xffffffff
[F] start_bragi_common (device_bragi.c:154): ckb1: Couldn't get bragi device mode. Aborting
[E] os_usb_interrupt_out (via bragi_common.c:9): No such file or directory, res = 0xffffffff
[F] start_bragi_common (device_bragi.c:154): ckb1: Couldn't get bragi device mode. Aborting
^C
[I] Caught signal 2
[E] os_usb_interrupt_out (via bragi_common.c:9): No such file or directory, res = 0xffffffff
[F] start_bragi_common (device_bragi.c:154): ckb1: Couldn't get bragi device mode. Aborting
[E] usb_tryreset (usb.c:645): Reset failed. Disconnecting.
[I] Disconnecting /dev/input/ckb1
[I] Caught internal signal SIGUSR2
[I] Closing root controller
[I] Stopping indicator thread for ckb1 (0)
[I] Removed device path /dev/input/ckb0
tatokis commented 1 year ago

@Alyx-LeGuen Sorry, forgot to add it in one place. Try again please. I force pushed.

Alyx-LeGuen commented 1 year ago

@tatokis Everything seems to be working fine, thank you very much.

I just "lost" the functionality of the "function" keys. For example, I can't do "function+J" keys to have an arrow down or do "function+^" to go to the beginning of the line. Can I configure this in the software?

tatokis commented 1 year ago

Unfortunately multi key bindings are not supported. If you can give me a list of the expected Fn shortcuts, I can hardcode them in the daemon until such support is added.

Alyx-LeGuen commented 1 year ago

That would be really cool, thks a lot I have the azerty version, I hope it's not annoying for you (The Fn key can be activated on almost any key, as you can see in the picture) k65mini_azerty

The keys I used the most : " Fn+u " = Up arrow " Fn+h " = Left arrow " Fn+j " = Down arrow " Fn+k " = Right arrow " Fn+^ " = LineStart " Fn+ù " = LineEnd " Fn+& " = F1 " Fn+é " = F2 " Fn+" " = F3 " Fn+' " = F4 " Fn+( " = F5 " Fn+- " = F6 " Fn+è " = F7 " Fn+_ " = F8 " Fn+ç " = F9 " Fn+à " = F10 " Fn+) " = F11 " Fn+= " = F12 " Fn+i " = Sound OFF " Fn+o " = Increase sound " Fn+l " = Decreases sound

rapha-pereira commented 1 year ago

Hey guys, any updates on this?

thelabcat commented 1 year ago

Another plea for support for this device. Not for me, but for someone I'm helping out.

Thanks for all the work so far, BTW!

devincurrie commented 8 months ago

Please add support for K65 Pro Mini as well? Thanks!

https://www.corsair.com/us/en/p/keyboards/ch-91a401a-na/k65-pro-mini-rgb-65-optical-mechanical-gaming-keyboard-ch-91a401a-na

flukejones commented 8 months ago

I recently picked up this keyboard, but mine has an ID of 0x1bc3 as opposed to 0x1baf. I tried adding next to 0x1baf but I get no input and no dev.

Nov 29 12:44:19 fedora systemd[1]: Started ckb-next-daemon.service - Corsair Keyboards and Mice Daemon.
Nov 29 12:44:19 fedora ckb-next-daemon[76393]: ckb-next-daemon 0.6.0-33-gaaf48a03afb0
Nov 29 12:44:19 fedora ckb-next-daemon[76393]: [I] Root controller ready at /dev/input/ckb0
Nov 29 12:44:19 fedora ckb-next-daemon[76393]: [I] Connecting CORSAIR K65 RGB MINI 60% Mechanical Gaming Keyboard at /dev/input/ckb1
Nov 29 12:44:19 fedora ckb-next-daemon[76393]: [I] Starting input thread for /dev/input/ckb1
Nov 29 12:44:19 fedora ckb-next-daemon[76393]: [I] Found EP 0x81 at /sys/devices/pci0000:00/0000:00:14.0/usb3/3-1/3-1.4/3-1.4.2/3-1.4.2.4/3-1.4.2.4:1.0/ep_81
Nov 29 12:44:19 fedora ckb-next-daemon[76393]: [F] os_inputmain (usb_linux.c:164): Unable to read wMaxPacketSize for /sys/devices/pci0000:00/0000:00:14.0/usb3/3-1/3-1.4/3-1.4.2/3-1.4.2.4/3-1.4.2.4:1.1/ep_83, >
Nov 29 12:44:19 fedora ckb-next-daemon[76393]: [I] Found EP 0x83 at /sys/devices/pci0000:00/0000:00:14.0/usb3/3-1/3-1.4/3-1.4.2/3-1.4.2.4/3-1.4.2.4:1.2/ep_83
Nov 29 12:44:19 fedora ckb-next-daemon[76393]: [E] getfwversion (firmware.c:48): Bad input header
Nov 29 12:44:19 fedora ckb-next-daemon[76393]: [W] _start_dev (device.c:151): Unable to load firmware version/poll rate
Nov 29 12:44:19 fedora ckb-next-daemon[76393]: [I] Setup finished for /dev/input/ckb1
Nov 29 12:44:21 fedora ckb-next-daemon[76393]: [E] handle_nkro_key_input (keymap.c:852): Invalid length 16 legacy 0
Nov 29 12:44:21 fedora ckb-next-daemon[76393]: [E] handle_nkro_key_input (keymap.c:852): Invalid length 16 legacy 0
Nov 29 12:44:21 fedora ckb-next-daemon[76393]: [E] handle_nkro_key_input (keymap.c:852): Invalid length 16 legacy 0
Nov 29 12:44:21 fedora ckb-next-daemon[76393]: [E] handle_nkro_key_input (keymap.c:852): Invalid length 16 legacy 0
Nov 29 12:44:22 fedora ckb-next-daemon[76393]: [E] handle_nkro_key_input (keymap.c:852): Invalid length 16 legacy 0
Nov 29 12:44:22 fedora ckb-next-daemon[76393]: [E] handle_nkro_key_input (keymap.c:852): Invalid length 16 legacy 0
Nov 29 12:44:22 fedora ckb-next-daemon[76393]: [E] handle_nkro_key_input (keymap.c:852): Invalid length 16 legacy 0
Nov 29 12:44:22 fedora ckb-next-daemon[76393]: [E] handle_nkro_key_input (keymap.c:852): Invalid length 16 legacy 0
Nov 29 12:44:23 fedora ckb-next-daemon[76393]: [I] Caught signal 15
MarieTired commented 1 month ago

Sorry to post here so long after the issue here has been solved but I'm looking for help with a similar issue. I have a K65 mini as well and tried following the same steps as Alyx but it hasn't worked. The keyboard does not show up in the GUI and input stops working. Interestingly, modifying the ID in line 73 in usb.h to the one that shows up when I run lsusb makes it so that the keyboard is detected in the GUI but won't have input. The code in question is

#define P_K65_MINI 0x1baf

Where I changed 0x1baf to 1bd7

I know that the K65 mini is technically not supported yet, but I saw it working for someone else and started tinkering. Any help would be greatly appreciated and while I'm here, huge thanks to the devs of ckb-next.

ioletsgo commented 3 weeks ago

is there any potential ETA for support for this keyboard?