cvuchener / k90-linux-driver

Linux kernel space driver for Corsair Vengeance K90 Keyboard
22 stars 2 forks source link

K40 installation #6

Open jonahnaylor opened 7 years ago

jonahnaylor commented 7 years ago

Hi I'd hoped to get your driver working with my K40 if it is supported? Just so I can use the G keys and mapping and change the backlit colour etc.

But when I try run make install I get this error:

# make install
make -C /lib/modules/4.8.0-43-generic/build M=/home/user/Desktop/k90-linux-driver-master modules_install
make[1]: Entering directory '/usr/src/linux-headers-4.8.0-43-generic'
  INSTALL /home/user/Desktop/k90-linux-driver-master/hid-corsair.ko
At main.c:158:
- SSL error:02001002:system library:fopen:No such file or directory: bss_file.c:175
- SSL error:2006D080:BIO routines:BIO_new_file:no such file: bss_file.c:178
sign-file: certs/signing_key.pem: No such file or directory
  DEPMOD  4.8.0-43-generic
make[1]: Leaving directory '/usr/src/linux-headers-4.8.0-43-generic'
jonahnaylor commented 7 years ago

ps I'm on Ubuntu 16.04 - thanks for any help.

cvuchener commented 7 years ago

The master branch only supports the K90 (and was merged in the kernel for some time, so it is not really useful to replace the mainline module with it). The k40 branch exists but is unfinished because I cannot test it (I don't have this keyboard).

For the backlight, only changing brightness is supported. Colors are tied to profiles and I don't want to manage profiles from the kernel (it adds too much complexity) but you can use my user space tool. There may be a way to change the color temporarily without a profile but it don't seem to work.

For remapping the invalid key codes, you can also try the udev method: https://github.com/cvuchener/k90-linux-driver/issues/5#issuecomment-225863869

I am not sure what happens with the makefile, my module has nothing to do with main.c, I simply call the makefile from your distribution source passing the current directory as the module directory.

There was a patch for this driver in the mainline kernel, that I did not merge in this repo yet. But I don't think it's related.

jonahnaylor commented 7 years ago

Hi thank you. I've used the #5 comment as you suggested and that has fixed remapping the invalid keys and now the G keys work properly.

Changing the brightness works from the button on the keyboard itself, so I'm happy with that - but if there was a way to just change the backlighting colour... It isn't important but at some stage would be good to change so it matches the rest of the desktop devices which all seem to have blue lights and LEDs, and the keyboard is just stuck to red... But the main thing is I've got the keys working which is what I needed so thank you!

cvuchener commented 7 years ago

Nice to hear it works for you, there seemed to be some problems with an older version of Ubuntu. udev might have changed the file format.

For the color, use corsair-usb-config. Install the dependencies (for ubuntu, that must be build-essential, libusb-1.0-0-dev, libjsoncpp-dev), run make and then something like ./corsair-usb-config profile-color set <index> <color> where <index> is a number between 1 and 3 selecting the profile to change, and <color> the color as a R8G8B8 hexadecimal code (e.g. ff0000 for red, 00ff00 for green, ...).

What does not work currently, is changing the color temporarily in software controlled mode and using animations (pulse could work, but cycle is more complex).

jonahnaylor commented 7 years ago

Hi thanks that worked great. The corsair-usb-config application is awesome and now I've set the colours etc, so thank you for the help!

jonahnaylor commented 7 years ago

Hi sorry to re-open, I spoke too soon! It does seem I'm having some Ubuntu issues here. The keyboard when I first power up my computer isn't recognised properly (the G keys don't do anything again, and a standard US English layout with hash instead of GBP etc is active...)

If I then reboot the computer, the British/UK layout then works and the G keys also come alive and the Raptor K40 works correctly with the correct key mapping.

It is just a bit inconvenient to have to boot up and then reboot every time I first use the machine for the day. Is there any way you know we could diagnose and fix what may be causing this?

Thanks very much for any help.

cvuchener commented 7 years ago

It looks like a layout issue with X.org. You could check with evtest that the key codes don't change between boots to be sure.

I don't know what could cause this change but I found this weird ubuntu-specific bug that may be related : https://bugs.launchpad.net/ubuntu/+source/gnome-settings-daemon/+bug/1246272