The Corsair User Forums  

Go Back   The Corsair User Forums > Corsair Product Discussion > Keyboards and Mice

Reply
 
Thread Tools Rating: Thread Rating: 128 votes, 5.00 average. Display Modes
  #1  
Old 10-28-2014, 05:10 AM
MSC's Avatar
MSC MSC is offline
Linux/OSX driver
 
Join Date: Oct 2014
Posts: 247
POST ID # = 738353
MSC Reputation: 10
Default (Unofficial) Linux / OSX Driver

Download + Source code: https://github.com/ccMSC/ckb

Supported devices:
K65 RGB keyboard
K70 RGB and non-RGB keyboards
K95 RGB and non-RGB keyboards
Strafe RGB and non-RGB keyboards
M65 RGB mouse
Scimitar RGB mouse
The "Gaming" and "Vengeance" models are both supported.

Supported operating systems:
Linux (Ubuntu, Mint, etc)
Mac OS X v10.9 - v10.11 (Mavericks, Yosemite, El Capitan)

Currently SUPPORTED features:
RGB lighting and animations
Reactive lighting
Key rebinding (with a limited number of special functions)
K95 G-key support
Multiple independent binding and lighting modes
Customizable mouse DPI

Currently UNSUPPORTED features:
Advanced key macros
Importing and exporting of profiles (including CUE profiles)


-----------------------------


Update 2015/01/08:
New video showing off some of the more advanced animation development.


Original post:
Here's a short sample video:

I'm building a driver for the RGB keyboards so that us Linux users don't miss out on the cool features. Many thanks to CalcProgrammer1 and others (link to his thread here) for decoding the LED messages - wouldn't have gotten this far without them. I really liked the music visualizer and wanted to restructure it into more of a generic driver, so here's my attempt.

It's very incomplete at the moment, needs more fine-tuning and it's still missing major features like key rebinding or the use of the G-keys, but if anyone else out there uses one of these keyboards with Linux I'd love some testing/feedback. It *should* work with the K70 as well as the K95, although I only have a K95 so I can't test the former. Might be possible to run it under OSX as well. I'll keep the GitHub posted as I make progress.

Last edited by MSC; 11-11-2015 at 03:54 AM. Reason: Updated support list
Reply With Quote


3 members found this post helpful.
  #2  
Old 10-28-2014, 02:08 PM
CalcProgrammer1 CalcProgrammer1 is offline
Registered User
CalcProgrammer1's PC Specs
 
Join Date: Oct 2014
Posts: 119
POST ID # = 738422
CalcProgrammer1 Reputation: 20
Default

Nice work! I like the daemon idea. Can you write LED patterns directly to the dev node? If so, programs like my music visualizer could write to that rather than handling the USB connection directly.
Reply With Quote


  #3  
Old 10-28-2014, 04:21 PM
Corsair James's Avatar
Corsair James Corsair James is offline
CUE Product Manager
 
Join Date: Oct 2013
Location: Fremont, CA
Posts: 4,121
POST ID # = 738455
Corsair James Reputation: 41
Default

This is impressive - how long did it take you to create this driver?
Reply With Quote


  #4  
Old 10-28-2014, 11:17 PM
SpeedFreak01 SpeedFreak01 is offline
Registered User
SpeedFreak01's PC Specs
 
Join Date: Oct 2014
Posts: 17
POST ID # = 738557
SpeedFreak01 Reputation: 10
Default

Thanks for the work MSC, when i can get my RGB K95 to work correctly under linux i will do more testing and offer some feedback.
Reply With Quote


  #5  
Old 10-29-2014, 02:29 AM
MSC's Avatar
MSC MSC is offline
Linux/OSX driver
 
Join Date: Oct 2014
Posts: 247
POST ID # = 738580
MSC Reputation: 10
Default

Thanks. I'm still trying to figure out these mysterious G-keys...there doesn't seem to be any special response to them. I really hope this isn't going to require a custom kernel driver.
EDIT: Scratch that, I just figured it out!

Quote:
Originally Posted by CalcProgrammer1 View Post
Nice work! I like the daemon idea. Can you write LED patterns directly to the dev node? If so, programs like my music visualizer could write to that rather than handling the USB connection directly.
Yep! You can see this in action in the animation demo - it basically just builds up a string of key/color combinations and sends that to the device. You should be able to implement the visualizer in the same way.

Quote:
Originally Posted by Corsair James View Post
This is impressive - how long did it take you to create this driver?
Couple of days. I got the keyboard in on Friday and started working on it once I realized it didn't work on Linux. Having the LED messages already decoded was a big help.

Last edited by MSC; 10-29-2014 at 03:01 AM.
Reply With Quote


  #6  
Old 10-29-2014, 09:56 AM
SpeedFreak01 SpeedFreak01 is offline
Registered User
SpeedFreak01's PC Specs
 
Join Date: Oct 2014
Posts: 17
POST ID # = 738632
SpeedFreak01 Reputation: 10
Default

Ok, now that i have basic typing functionality back with the keyboard, time to test this driver :P

Unfortunately i haven't had much luck with this either, keeps throwing the error "Failed to get device info"

Code:
root @ # ckb-daemon
ckb Corsair Keyboard RGB driver v0.1
Root controller ready at /dev/input/ckb0
Detected K95 keyboard
Failed to get device info
Is there any info i can provide that might help with debugging that?
Reply With Quote


  #7  
Old 10-29-2014, 10:17 AM
galen104 galen104 is offline
Registered User
galen104's PC Specs
 
Join Date: Oct 2014
Posts: 7
POST ID # = 738635
galen104 Reputation: 10
Default

I have the same issue (with arch linux) but with a K70 RGB

I have set the BIOS switch to 8ms and now it works.

Last edited by galen104; 10-29-2014 at 02:14 PM. Reason: solved
Reply With Quote


  #8  
Old 10-29-2014, 07:29 PM
MSC's Avatar
MSC MSC is offline
Linux/OSX driver
 
Join Date: Oct 2014
Posts: 247
POST ID # = 738769
MSC Reputation: 10
Default

Interesting...that's been happening to me sometimes, but so far I've been able to fix it by unplugging the keyboard and plugging it back in. Have you tried using a different USB port? If you're able, can you test it on Windows just to make sure it's working correctly there?

For right now, PM me the output of "dmseg | tail -100" when you see the error and I'll see if I can make anything of it. I'll try to implement better debugging soon.
Reply With Quote


  #9  
Old 10-29-2014, 11:11 PM
SpeedFreak01 SpeedFreak01 is offline
Registered User
SpeedFreak01's PC Specs
 
Join Date: Oct 2014
Posts: 17
POST ID # = 738798
SpeedFreak01 Reputation: 10
Default

Will try unplugging it again when i get home later today. But the only real messages im seeing are

Code:
usbhid 5-2:1.1: can't add hid device: -110
usbhid: probe of 5-2:1.1 failed with error -110
The message pops up as soon as i run the daemon.

I really cant find much info on this error or what causes it.
Seems others indicate this might be a power supply issue to the device, or possibly a faulty device. Im hesitant to think its a problem with the USB ports given i have tested a range of other spare USB keyboards at home and all work instantly with no issues or errors.

Given a few people seem to be having the same issues, i suspect this has more to do with the k95 keyboard and dodgy firmware than anything.

The keyboard works fine in windows, although im testing that on a completely different PC.
I might be game to install windows on my linux box, but would rather not.
Reply With Quote


  #10  
Old 10-29-2014, 11:56 PM
MSC's Avatar
MSC MSC is offline
Linux/OSX driver
 
Join Date: Oct 2014
Posts: 247
POST ID # = 738810
MSC Reputation: 10
Default

The firmware is definitely flakey, but I think it's the driver's fault in this case. I managed to reproduce your problem in a VM (same dmesg output as well). I just pushed a commit that, at least in my case, allows it to connect the device anyway. Unfortunately the LED controller still doesn't work when this happens. I'll keep working on it.

Edit: It seems the keyboard really hates the linux HID driver. I think the best route is to disable it entirely and implement all key binding in the custom driver, even when keys aren't reassigned.

Last edited by MSC; 10-30-2014 at 02:36 AM.
Reply With Quote


  #11  
Old 10-30-2014, 07:45 AM
SpeedFreak01 SpeedFreak01 is offline
Registered User
SpeedFreak01's PC Specs
 
Join Date: Oct 2014
Posts: 17
POST ID # = 738904
SpeedFreak01 Reputation: 10
Default

Well, pulled down the latest commit, managed to get a little further this time in the log output, but unfortunately the keyboard died again. All the lights are on, but it just doesn't accept any key presses.

Looks like the driver did a rest or something on the usb interface?
I haven't really had much luck getting this keyboard to consistently initialise in linux so its in no way your drivers fault.

Here are the logs, certainly seems like usbhid has issues with something.

Code:
[76655.903992] hid-generic 0003:1B1C:1B11.0001: usb_submit_urb(ctrl) failed: -1
[76657.068766] usb 5-2: reset full-speed USB device number 2 using uhci_hcd
[76657.991910] input: Corsair Corsair K95 RGB Gaming Keyboard as /devices/pci0000:00/0000:00:1a.2/usb5/5-2/5-2:1.0/0003:1B1C:1B11.0007/input/input20
[76657.992365] hid-generic 0003:1B1C:1B11.0007: input,hidraw0: USB HID v1.11 Keyboard [Corsair Corsair K95 RGB Gaming Keyboard] on usb-0000:00:1a.2-2/input0
[76692.957553] usbhid 5-2:1.1: can't add hid device: -110
[76692.957575] usbhid: probe of 5-2:1.1 failed with error -110
[76751.133606] usb 5-2: USB disconnect, device number 2
[76781.806411] usb 5-2: new full-speed USB device number 3 using uhci_hcd
[76782.479678] usb 5-2: New USB device found, idVendor=1b1c, idProduct=1b11
[76782.479683] usb 5-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[76782.479687] usb 5-2: Product: Corsair K95 RGB Gaming Keyboard
[76782.479689] usb 5-2: Manufacturer: Corsair
[76782.479692] usb 5-2: SerialNumber: <removed>
[76782.688907] input: Corsair Corsair K95 RGB Gaming Keyboard as /devices/pci0000:00/0000:00:1a.2/usb5/5-2/5-2:1.0/0003:1B1C:1B11.0008/input/input21
[76782.689380] hid-generic 0003:1B1C:1B11.0008: input,hidraw0: USB HID v1.11 Keyboard [Corsair Corsair K95 RGB Gaming Keyboard] on usb-0000:00:1a.2-2/input0
[76817.656097] usbhid 5-2:1.1: can't add hid device: -110
[76817.656118] usbhid: probe of 5-2:1.1 failed with error -110
[76852.620736] usbhid 5-2:1.2: can't add hid device: -110
[76852.620758] usbhid: probe of 5-2:1.2 failed with error -110
[76887.584308] usbhid 5-2:1.3: can't add hid device: -110
[76887.584328] usbhid: probe of 5-2:1.3 failed with error -110
So.. back to square one, getting the keyboard to work again. are there any other alternatives to the default HID driver?
Reply With Quote


  #12  
Old 10-31-2014, 01:56 AM
MSC's Avatar
MSC MSC is offline
Linux/OSX driver
 
Join Date: Oct 2014
Posts: 247
POST ID # = 739145
MSC Reputation: 10
Default

Nope. I'm in the process of rewriting the program to detach the stock HID driver entirely and handle all key input through the ckb daemon. It's a less elegant solution than I was hoping for, but I don't feel like debugging the USB keyboard module to figure out what's wrong with it.

It seems to be necessary (most of the time) to issue a USB reset to the device when activating it, and in fact the Windows driver appears to do 2 or 3 of them. But the device breaks again as soon as I try to reactivate the Linux driver. I have a SLIGHT suspicion this keyboard didn't get much compatibility testing...
Reply With Quote


  #13  
Old 10-31-2014, 02:21 AM
SpeedFreak01 SpeedFreak01 is offline
Registered User
SpeedFreak01's PC Specs
 
Join Date: Oct 2014
Posts: 17
POST ID # = 739148
SpeedFreak01 Reputation: 10
Default

Appreciate the work mate, you seem to be doing a hell of a lot more for the community than the actual devs, so top job.

Its really a shame, i think the keyboard has great potential but the firmware is just too buggy at the moment.

Thinking i might put the keyboard aside for now and wait for corsair to release more firmware updates.
Users are clearly unhappy with the device, and its abundantly clear there are issues with it, i guess its just a case of waiting for further revisions.

In the meantime will keep watching this thread, whenever you update this next will do some more testing.
Reply With Quote


  #14  
Old 11-01-2014, 12:34 AM
MSC's Avatar
MSC MSC is offline
Linux/OSX driver
 
Join Date: Oct 2014
Posts: 247
POST ID # = 739342
MSC Reputation: 10
Default

Yeah, the firmware's pretty buggy. Thanks for your feedback regardless - it's been helpful.

I've pushed an update that disables the kernel driver and uses a custom input device. It seems to fix the keyboard not responding, but I don't know if you'll be as lucky. I don't think there's much else I can do if it still fails, so fingers crossed.
Reply With Quote


  #15  
Old 11-01-2014, 04:00 AM
Dwindleflip Dwindleflip is offline
Registered User
Dwindleflip's PC Specs
 
Join Date: Aug 2014
Posts: 94
POST ID # = 739351
Dwindleflip Reputation: 5
Default

hire this person.
Reply With Quote


Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:31 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.