Jump to content
Corsair Community

(Unofficial) Linux / OSX Driver


MSC

Recommended Posts

Glad it's working :D Shame the device gets locked up so easily. Oh well, at least I got the resets to work a lot faster in the process.

 

Another thing I think might need doing is periodically sending USB commands to the keyboard even if animations are disabled. One time I was using the keyboard and the input suddenly locked up, but when I turned on an animation the daemon detected that it was frozen and reset the device, causing it to work again. Only did that once, I don't know if you've had anything like that happen. But it's probably a good idea to have the daemon "check in" every now and again even if a lock-up isn't likely.

Link to comment
Share on other sites

  • Replies 824
  • Created
  • Last Reply

Top Posters In This Topic

Thanks for the driver.

 

Is there any plan for a compositor and/or a software library for effect rendering. Some effects are just easier to do by writing code, and embedded python, lua, scheme or js(integrated in qt) would be very useful.

Link to comment
Share on other sites

Definitely! I think I mentioned this in an earlier post, but I'm planning to make the animations API-based so that they run as standalone programs, and you'll be able to add custom scripts that work in the same way. So they could be coded in C, Python, BASH, or anything else that a command-line interpreter can run. You'll also be able to select which keys they play on as well as how they're activated, and will be able to layer multiple animations together. I should have the API finished some time in the next week or two.
Link to comment
Share on other sites

Hey MSC you're doing excellent things here sir! Let me be the first in line to buy you a beer.

 

Now, I'm running 10.9 and am running into a "framework not found AudioToolbox.framework" error when trying to compile. If you don't know what the cause is off the top of your head, then I guess Yosemite isn't too bad...

Link to comment
Share on other sites

Apple's docs say it goes back to 10.5, so it should still be present. I noticed that I didn't include the .framework extension anywhere else, so maybe that's the problem. Try compiling again with the latest commit and see if that fixes it. If not I'll include an option to disable linking with AudioToolbox (it's not a major feature, it's only used to toggle the light on the Mute button).
Link to comment
Share on other sites

Okay, I just ran the latest commit and got the same error.

 

I can confirm that the framework does exist within my library- I'm looking at this compile error log and I feel like it might be helpful.

 

ckb/moc_rgbwidget.o   -F/Users/zamzx/Documents/QT/5.4/clang_64/lib -framework AudioToolbox.framework -framework QtWidgets -framework QtGui -framework QtCore -framework DiskArbitration -framework IOKit -framework OpenGL -framework AGL 
ld: framework not found AudioToolbox.framework
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [../../../ckb-master/bin/ckb.app/Contents/MacOS/ckb] Error 1
make: *** [sub-src-ckb-ckb-pro-make_first] Error 2
03:27:19: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project ckb (kit: Desktop Qt %{Qt:Version} clang 64bit)
When executing step "Make"
03:27:19: Elapsed time: 00:00.

Link to comment
Share on other sites

Looks like it's still trying to link the version with the file extension. Can you open up src/ckb/ckb.pro (or "ckb [master]" > "ckb" > "ckb.pro" from Qt Creator) and confirm that line 17 says "LIBS += -framework AudioToolbox" and NOT "LIBS += -framework AudioToolbox.framework"? You might need to re-invoke "Run qmake" as well, or try deleting the whole ckb directory and extracting it from the zip file again. If that doesn't do it just let me know and I'll fire up a Mavericks VM later to figure out what's going on.
Link to comment
Share on other sites

I checked and it did NOT have the .framework extension, so I took your advice and deleted all of the files from previous versions and builds and started from a freshly unzipped version.

 

And it worked! This is super awesome! There's nothing cooler than seeing those beautiful rainbow hues come to life.

Link to comment
Share on other sites

Glad it worked. I made a note in the documentation to delete the old directory first in case something like this happens again.

 

I just added the ability to store multiple profiles and to add/remove modes beyond the three stored on the device. Right now it will load the hardware profile first and if you want to create more, you can select the "Edit profiles" option which will allow you to create, rename, duplicate, or delete them. I might rework this UI later, but at least it works for now. I'm planning to get started on the animation API next.

Link to comment
Share on other sites

Hello MSC! Thank you for a nice driver!

I have k70 rgb with swedish kb layout and the only keys not working are the one to the left of the enter key and the key to the right of lshift. Those keys are quite important egen programming and i would like to hqve them work properly. I suppose it has to do with the keyboard_us.c and the hexcodes represented there. Do you have any idea how I can extract the hexcodes from those keys and make them work in a custom c file?

Thank you in advance and sorry if this has already been answered :)

Edited by Criticalstone
Link to comment
Share on other sites

Hello MSC! Thank you for a nice driver!

I have k70 rgb with swedish kb layout and the only keys not working are the one to the left of the enter key and the key to the right of lshift. Those keys are quite important egen programming and i would like to hqve them work properly. I suppose it has to do with the keyboard_us.c and the hexcodes represented there. Do you have any idea how I can extract the hexcodes from those keys and make them work in a custom c file?

Thank you in advance and sorry if this has already been answered :)

 

I have two key don't reconized : near to the tab key (*) on french AZERTY and < near to maj. peraps you need the code the theses key

 

Would I be correct in assuming that you're unable to change the color of the keys, as well as them not generating any key input? Or is there some other key on the keyboard that allows you to set their colors? (Try the UK layout as well as the US layout, since there are some slight differences)

 

I don't have a good way to test LED codes at the moment, but here's how to test the input codes. With the daemon running, open a new terminal window and run the following two commands:

echo notify all > /dev/input/ckb1/cmd
cat /dev/input/ckb1/notify0

(If you're on a Mac, replace "/dev/input/ckb1" with "/tmp/ckb1")

 

You should see some lines of text, ending with "key -enter". Now if you press the unrecognized keys you should see "key +#xx" "key -#xx", where xx are some numbers. Paste those numbers here (or if you see a name instead, paste that) and tell me which keys they correspond to and I'll get new layouts set up for them.

 

EDIT: Also, if you could provide me with screenshots of what your keyboards look like in CUE, so that I can see the physical layout, that'd be great. Thanks :)

Edited by MSC
Link to comment
Share on other sites

Would I be correct in assuming that you're unable to change the color of the keys, as well as them not generating any key input? Or is there some other key on the keyboard that allows you to set their colors? (Try the UK layout as well as the US layout, since there are some slight differences)

 

Correct, I can't set colors of the keys and they are not generating any input.

There are some other keys that are not represented in the layout but can be changed looking at the us layout and try to see what key it represents. Those two keys that don't work doesn't exist on the us layout. The enter key covers one and the shift key covers the other :)

 

I also believe that both alexises and I are having problem with the same physical keys

 

EDIT: Also, if you could provide me with screenshots of what your keyboards look like in CUE, so that I can see the physical layout, that'd be great. Thanks :)

 

Ill give you this when I come home :)

 

Edit:

Here is a picture of the swedish kb layout

http://frontype.com/keyboarding/540px-Computer-keyboard-Sweden.svg.png

 

 

Thanks for a fast reply!

Edited by Criticalstone
Link to comment
Share on other sites

Ok, as I suspected those are the same numbers as the extra keys from the UK layout. I *think* they're the same keys, so I just changed the names and copied everything else. Hopefully the new Swedish option works for you; let me know if the LEDs still don't work or if they keys generate the wrong characters.

 

Btw, I also made the UK layout the default for countries that the software doesn't recognize. If my assumption is correct that the European keyboards are using the same input codes, this should cause them to work correctly now (even if the keys are mis-labeled). Maybe Alexises can confirm this?

 

 

As for your question about the animations, the daemon itself doesn't handle animation; the UI program does that. The daemon just reads color codes and sends that information out to the keyboard. Additionally, the animations are now their own programs, and ckb simply layers them together. So the basic process is like this:

 

1. ckb stores a list of "background" colors. Those are the ones that you pick from the keyboard control on the app.

2. You can add animations on top of that using the "New animation" button. Each animation is its own program and is given a group of keys to it operate on.

3. ckb runs all of the animation programs in the active lighting mode. The animation programs write some output like "set <key name> to alpha A, red R, green G, blue B".

4. ckb reads the output of the programs and layers them together, in order, on top of the background colors (taking into account the overall opacity and blending mode set by the user). When it's done, it has computed the actual color to send to the keyboard.

5. ckb sends a list of keys/colors to the daemon, which in turn collects them together and sends those colors to the keyboard.

 

Then steps 3 through 5 repeat for every frame, at about 60FPS. Since the animation programs all run independently they're very lightweight and can be combined in any possible way without interfering with each other.

Link to comment
Share on other sites

Hi,

 

with the german keyboard also two keys (I think the very same as with the swedish version) were missing and couldn't be controlled by ckb:

 

key +hash
key -hash
key +bslash
key -bslash

 

I just tried your new code with a german K95 RGB and now all keys can be controlled. Cool! Thanks for the software!

 

In the beginning I had a problem with timeouts reported by the kernel (from Ubuntu 14.04) and the keyboard stopped responding. Only a usb reconnect enabled the keyboard again:

 

hid-generic 0003:1B1C:1B11.0022: timeout initializing reports
hid-generic 0003:1B1C:1B11.0022: hiddev0,hidraw4: USB HID v1.11 Device [Corsair Corsair K95 RGB Gaming Keyboard] on usb-0000:00:1a.0-1.5.4/input3

 

After some googling I found, that adding this to the grub cmdline:

usbhid.quirks=0x1B1C:0x1B11:0x20000000

resolved the timeouts, the keyboard then worked well for hours.

 

best regards

Hironimus

Edited by Hironimus
Link to comment
Share on other sites

Glad to hear it :D

I went ahead and added Germany and France as recognized keyboard layouts. So if you hover your mouse over the keys in ckb, it should display the correct names now. (It might also mix up a few keys on your color/animations settings the first time you run it...sorry! it won't happen in future versions.) Let me know if I got anything wrong.

 

In the beginning I had a problem with timeouts reported by the kernel (from Ubuntu 14.04) and the keyboard stopped responding. Only a usb reconnect enabled the keyboard again:

 

hid-generic 0003:1B1C:1B11.0022: timeout initializing reports
hid-generic 0003:1B1C:1B11.0022: hiddev0,hidraw4: USB HID v1.11 Device [Corsair Corsair K95 RGB Gaming Keyboard] on usb-0000:00:1a.0-1.5.4/input3

 

After some googling I found, that adding this to the grub cmdline:

usbhid.quirks=0x1B1C:0x1B11:0x20000000

resolved the timeouts, the keyboard then worked well for hours.

 

That's interesting, I've had that problem myself sometimes. I'll try that out and see if it helps.

 

EDIT: sure enough, that solved a problem I had where the keyboard would be unresponsive for several seconds after plugging it in. Thanks for sharing.

Edited by MSC
Link to comment
Share on other sites

Hey MSC

 

i decided to grab the updates you done to the program, however when i compiled it and tried to run ckb nothing happends.

 

connecting the keyboard with ckb-daemon works, however trying to run ckb nothing happends, first run it looks like it tries to open but closes straight away, every try after that nothing seems to happen at all.

 

any ideas of what i might be doing wrong ?

 

Cheers

 

the commands

 

echo rgb off > /dev/input/ckb1/cmd

echo rgb on > /dev/input/ckb1/cmd

echo rgb D2691E > /dev/input/ckb1/cmd

 

still work, just nothing using the ckb works.

 

just noticed, it sets my layout to the gb version when it should be the us version

Edited by SimpleStreet
Link to comment
Share on other sites

It should be setting the layout from your system locale. Can you run the "locale" command in a terminal and post the output for me?

 

It sounds like ckb is crashing when you try to run it. Are you using a K70 or K95, and which distro are you running? It might be something that I forgot to test. I'll include an option to generate a debug build in my next commit if I can't find the problem.

Link to comment
Share on other sites

It should be setting the layout from your system locale. Can you run the "locale" command in a terminal and post the output for me?

 

It sounds like ckb is crashing when you try to run it. Are you using a K70 or K95, and which distro are you running? It might be something that I forgot to test. I'll include an option to generate a debug build in my next commit if I can't find the problem.

 

 

LANG=en_AU.UTF-8

LANGUAGE=en_AU:en

LC_CTYPE="en_AU.UTF-8"

LC_NUMERIC="en_AU.UTF-8"

LC_TIME="en_AU.UTF-8"

LC_COLLATE="en_AU.UTF-8"

LC_MONETARY="en_AU.UTF-8"

LC_MESSAGES="en_AU.UTF-8"

LC_PAPER="en_AU.UTF-8"

LC_NAME="en_AU.UTF-8"

LC_ADDRESS="en_AU.UTF-8"

LC_TELEPHONE="en_AU.UTF-8"

LC_MEASUREMENT="en_AU.UTF-8"

LC_IDENTIFICATION="en_AU.UTF-8"

LC_ALL=

 

K70

Ubuntu 14.10

Link to comment
Share on other sites

I have little to none experience about programming and writing code so I have some difficulties installing this. Could you give me a quick guide on installing this so I can get my K95 running. Thank you in advance! :D:

 

Edit: I cloned it to a dir I created and now I just have to compile it. Can't find any good instructions on how-to in google. Any help beyond the point of creating a directory for gits would be greatly appriciated!

Edited by UbuntuNoob
Link to comment
Share on other sites

K70

Ubuntu 14.10

 

Ah, didn't realize AU used the US layout as well. I've added that to the list of US locales (as well as some others that Wikipedia says use the same layout), so the new daemon should detect it correctly.

 

It turns out your crash was caused by the K70 keyboard, after an update where I added support for more layouts. Sorry about that, it should be fixed in the latest commit.

 

I have little to none experience about programming and writing code so I have some difficulties installing this. Could you give me a quick guide on installing this so I can get my K95 running. Thank you in advance! :D:

 

Edit: I cloned it to a dir I created and now I just have to compile it. Can't find any good instructions on how-to in google. Any help beyond the point of creating a directory for gits would be greatly appriciated!

 

If you're not familiar with terminal commands, the easiest way to get the source is to use the "Download Zip" button on the right side of the GitHub page and extract it from there. Delete your previous download first (if any).

 

Either way, here's how to compile it:

1. Open the "ckb-master" directory in your file browser. You should see "src", "ckb.pro", "DAEMON.md", etc.

2. Right-click on the folder background and select "Open in Terminal". Most file browsers should have an option like that. On the off chance that yours doesn't, open a new terminal, type "cd <ckb-master path>" and hit enter. For instance, if yours is in "Dowloads/ckb-master" type "cd Downloads/ckb-master".

3. Now that you have a terminal in this directory, type "qmake && make" and hit enter. It will take a few seconds to compile so wait until it stops spewing output. The last line should say "Leaving directory <some path>".

4. Type "sudo bin/ckb-daemon" into the terminal and hit enter. It will ask you for your password (needed to access superuser privileges), so type that in and hit enter again.

5. Watch the terminal output and you should eventually see "Device ready at /dev/input/ckb1". This indicates that the daemon launched successfully and has connected your keyboard.

6. Leave that terminal running. You can minimize it to the background, but don't close it. I'll have a better solution for this in a future version, but for now, you need to run the daemon manually and keep it open.

7. Back in your file browser, open the newly-created "bin" directory, and run the "ckb" app. This is the actual user interface for the keyboard and it should be fairly self-explanatory. You can close the window when you're done with it; the app will keep running until you click the "Quit ckb" button from the settings screen.

 

Hopefully that covers it. Let me know if you have trouble or if you're still confused about anything :)

Link to comment
Share on other sites


×
×
  • Create New...