wattos / logitech-g710-linux-driver Goto Github PK
View Code? Open in Web Editor NEWLogitech G710 Linux Driver
License: GNU General Public License v2.0
Logitech G710 Linux Driver
License: GNU General Public License v2.0
Bitmasks are good and all, but having a user friendly (or at least user friendlier) way to set backlight would be cool.
$ time sudo cat /sys/bus/hid/devices/0003\:046D\:C24D.0005/logitech-g710/led_macro
0
real 0m20.151s
user 0m0.009s
sys 0m0.011s
This makes it hard to write scripts that toggle the state.
Hi,
after an update to Kernel 3.8.0-32 the driver stopped working for me completly. I have since tried to make it work in 3.10 but again: no input. I have no clue why this is happening. Does anyone know whats going on?
Hannes
Like you and K900, I am lacking a better way to contact you, so here's an issue.
I would like to convert it to make it use dkms, but it works, and having a package provides a nicer way to uninstall it. (although after going through the process, it's only one file that needs to be removed anyways). Unfortunately, making packages for other distros takes a bit more effort, and I won't be of any help there.
https://github.com/forivall/aur-packages/tree/master/logitech-g710-kmod
https://aur.archlinux.org/packages/logitech-g710-kmod-git/
Hey. I got myself a similar device from logitech, the G105 keybaord, and ran into your driver while doing research on manipulating raw reports (my device reports like 03 gg mm
for each g/mkey pressed, where gg and mm are bitmaps of pressed keys. I'd rather like to pick your brain on this matter
seems installed:
grep -r g710 /lib/modules
:Binary file /lib/modules/3.2.0-59-generic-pae/extra/hid-lg-g710-plus.ko matches
Binary file /lib/modules/3.2.0-59-generic-pae/modules.alias.bin matches
/lib/modules/3.2.0-59-generic-pae/modules.dep:extra/hid-lg-g710-plus.ko: kernel/
drivers/hid/usbhid/usbhid.ko kernel/drivers/hid/hid.ko
Binary file /lib/modules/3.2.0-59-generic-pae/modules.dep.bin matches
/lib/modules/3.2.0-59-generic-pae/modules.alias:alias hid:b0003v0000046Dp0000C24
D hid_lg_g710_plus
Binary file /lib/modules/3.2.0-48-generic-pae/extra/hid-lg-g710-plus.ko matches
Binary file /lib/modules/3.2.0-48-generic-pae/modules.alias.bin matches
/lib/modules/3.2.0-48-generic-pae/modules.dep:extra/hid-lg-g710-plus.ko: kernel/
drivers/hid/usbhid/usbhid.ko kernel/drivers/hid/hid.ko
Binary file /lib/modules/3.2.0-48-generic-pae/modules.dep.bin matches
/lib/modules/3.2.0-48-generic-pae/modules.alias:alias hid:b0003v0000046Dp0000C24
D hid_lg_g710_plus
lsmod | grep g710
:hid_lg_g710_plus 13036 0
usbhid 41937 1 hid_lg_g710_plus
hid 81731 2 hid_lg_g710_plus,usbhid
however, i can't seem to get the M keys to do anything nor the G keys to do anything but return their number. so according to xev, M keys are nothing and G keys are 1-6.
furthermore, i can't seem to find anything useful in kde's settings that can provide any assistance.
maybe i don't understand how to use this?
This driver made all of the keys on my G710 function in Ubuntu, but there's a problem with the G Keys (the six bonus keys on the left side).
The driver maps them to the numbers 1 through 6. If I use something like input-remapper to change the key assignments, it changes them for the regular keyboard numbers 1 through 6 as well. So it's not really feasible to remap them or use them as anything except for an extra 1,2,3,4,5,6.
Is there some other way to change the output of these keys that won't overlap with normal keyboard functions?
Driver doesn't compile anymore on Linux 3.17.2:
CC [M] /home/***/logitech-g710-linux-driver/src/kernel/hid-lg-g710-plus.o
In file included from include/linux/thread_info.h:11:0,
from ./arch/x86/include/asm/preempt.h:6,
from include/linux/preempt.h:18,
from include/linux/spinlock.h:50,
from include/linux/mmzone.h:7,
from include/linux/gfp.h:5,
from include/linux/slab.h:14,
from include/linux/hid.h:30,
from /home/***/logitech-g710-linux-driver/src/kernel/hid-lg-g710-plus.c:17:
include/linux/bug.h:33:45: Fehler: Negative Breite in Bitfeld »<anonym>«
#define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); }))
^
include/linux/kernel.h:849:3: Anmerkung: bei Substitution des Makros »BUILD_BUG_ON_ZERO«
BUILD_BUG_ON_ZERO((perms) & 2) + \
^
include/linux/sysfs.h:75:12: Anmerkung: bei Substitution des Makros »VERIFY_OCTAL_PERMISSIONS«
.mode = VERIFY_OCTAL_PERMISSIONS(_mode) }, \
^
include/linux/device.h:539:45: Anmerkung: bei Substitution des Makros »__ATTR«
struct device_attribute dev_attr_##_name = __ATTR(_name, _mode, _show, _store)
^
/home/***/logitech-g710-linux-driver/src/kernel/hid-lg-g710-plus.c:82:8: Anmerkung: bei Substitution des Makros »DEVICE_ATTR«
static DEVICE_ATTR(led_macro, S_IRUGO | S_IWUGO, lg_g710_plus_show_led_macro, lg_g710_plus_store_led_macro);
^
include/linux/bug.h:33:45: Fehler: Negative Breite in Bitfeld »<anonym>«
#define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); }))
^
include/linux/kernel.h:849:3: Anmerkung: bei Substitution des Makros »BUILD_BUG_ON_ZERO«
BUILD_BUG_ON_ZERO((perms) & 2) + \
^
include/linux/sysfs.h:75:12: Anmerkung: bei Substitution des Makros »VERIFY_OCTAL_PERMISSIONS«
.mode = VERIFY_OCTAL_PERMISSIONS(_mode) }, \
^
include/linux/device.h:539:45: Anmerkung: bei Substitution des Makros »__ATTR«
struct device_attribute dev_attr_##_name = __ATTR(_name, _mode, _show, _store)
^
/home/***/logitech-g710-linux-driver/src/kernel/hid-lg-g710-plus.c:83:8: Anmerkung: bei Substitution des Makros »DEVICE_ATTR«
static DEVICE_ATTR(led_keys, S_IRUGO | S_IWUGO, lg_g710_plus_show_led_keys, lg_g710_plus_store_led_keys);
^
scripts/Makefile.build:263: die Regel für Ziel „/home/***/logitech-g710-linux-driver/src/kernel/hid-lg-g710-plus.o“ scheiterte
make[3]: *** [/home/***/logitech-g710-linux-driver/src/kernel/hid-lg-g710-plus.o] Fehler 1
Makefile:1377: die Regel für Ziel „_module_/home/***/logitech-g710-linux-driver/src/kernel“ scheiterte
make[2]: *** [_module_/home/***/logitech-g710-linux-driver/src/kernel] Fehler 2
make[2]: Verzeichnis „/usr/lib/modules/3.17.2-1-ck/build“ wird verlassen
Makefile:11: die Regel für Ziel „build“ scheiterte
make[1]: *** [build] Fehler 2
This has always worked fine until 3.16, so I assume the error it is related to changes in the kernel. I'm running Arch Linux with latest linux-ck packages.
Make it work under 3.11 kernel please.
I've followed every step in the README.md, yet the G# keys are not separated keys. Instead they're binded to numbers 1 to 6 (not even F1 to F6, which was supposed to be the kind of 'default' keys, according to what I've read from other people).
Following link to link to link to link, I've read so many things that I don't even know what to do.
Example: I've read that newer versions of Ubuntu don't use xmodmap, but xkb. If that's true, how can I rebind those G# keys to make the separated keys so I can then use xbindkeys-config to configure my own commands and so?
Another thing: when I've built from source other applications, I could see literally hundreds of output lines when it's make install
ing it. This time, output is little to inexistent so I don't even know if the driver is correctly compiled or installed, let alone if it's working. Any way to ensure it?
I've removed rules, and module, but at reboot it gets reinstalled. I can't figure out which service is running the following on boot. Any idea how to uninstall it?
Aug 6 08:07:03 fernandob-pc systemd-udevd[489]: 0003:046D:C53D.0005:
Process '/bin/sh -c '/sbin/modprobe hid-lg-g710-plus; if test -d /sys/bus/hid/drivers
/hid-generic && test -d /sys/bus/hid/drivers/hid-lg-g710-plus; then /bin/echo -n
0003:046D:C53D.0005 > /sys/bus/hid/drivers/hid-generic/unbind; /bin/echo -n
0003:046D:C53D.0005 > /sys/bus/hid/drivers/hid-lg-g710-plus/bind;fi'' failed with
exit code 1.
First off, thanks for putting this together.
It works great for me in ubuntu 15.04 but doesn't with Debian Jessie / Gnome. Any idea why that might be the case?
I have successfully compiled and installed this driver but the keyboard still prints 66666 when I open a virtual console. What might cause this?
Distro: Linux Mint 17.2 64 bit
Linux kernel version: 3.16
I think it would be better to use separate sysfs files for different leds, instead of the bizarre combinations there are now, to integrate with existing userspace apps.
I am getting this error on make install
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
I am not sure if the install process succeeded or not. I am able to bind the G and M keys in xkb but G1 also causes "1" to be pressed (same with G2 - G6 and "2" - "6")
Hey,
I've programmed the M1-MR keys to do some stuff and light up when pressed using a simple shell script and xbindkeys, however I've noticed an issue when reading the bitmask from led_keys or led_macro. Doing so gets me the following nice messages in dmesg, twice:
[ 448.158523] BUG: scheduling while atomic: cat/2439/0x00000002 [ 448.158525] Modules linked in: nvidia(PO) usb_storage drm wmi edac_core edac_mce_amd psmouse snd_hda_codec_hdmi serio_raw kvm_amd sp5100_tco evdev r8169 i2c_piix4 hid_generic i2c_core mii kvm microcode pcspkr button snd_hda_codec_realtek snd_hda_intel snd_hda_codec snd_hwdep snd_pcm snd_page_alloc snd_timer snd soundcore it87 hwmon_vid k10temp nfs lockd sunrpc fscache msr cpufreq_userspace cpufreq_powersave acpi_cpufreq mperf processor cpufreq_stats sg ext4 crc16 mbcache jbd2 sr_mod cdrom sd_mod ahci libahci libata ohci_hcd ehci_pci ehci_hcd scsi_mod xhci_hcd hid_lg_g710_plus(O) usbhid hid usbcore usb_common [ 448.158563] Pid: 2439, comm: cat Tainted: P W O 3.9.6-2-ck #1 [ 448.158564] Call Trace: [ 448.158569] [] __schedule_bug+0x4d/0x5b [ 448.158573] [] schedule+0xecf/0x1040 [ 448.158579] [] ? ohci_urb_enqueue+0x1c7/0xa20 [ohci_hcd] [ 448.158588] [] ? usb_hcd_submit_urb+0xa3/0x8e0 [usbcore] [ 448.158595] [] schedule_timeout+0x134/0x2a0 [ 448.158599] [] ? call_timer_fn+0x1a0/0x1a0 [ 448.158603] [] wait_for_common+0xcd/0x180 [ 448.158607] [] ? wake_up_process+0x40/0x40 [ 448.158611] [] wait_for_completion_timeout+0x13/0x20 [ 448.158617] [] lg_g710_plus_show_led_macro+0x7c/0xc0 [hid_lg_g710_plus] [ 448.158621] [] dev_attr_show+0x20/0x60 [ 448.158626] [] sysfs_read_file+0x9a/0x1a0 [ 448.158630] [] vfs_read+0x96/0x180 [ 448.158633] [] sys_read+0x49/0xa0 [ 448.158637] [] system_call_fastpath+0x1a/0x1f
This doesn't seem to be a major problem though, it's just those messages that appear.
PS: I'm using the AUR package and linux-ck 3.9.6.
Has anyone got this to work with a G815 ?
for dir in src/kernel src/userspace; do make -C $dir install; done
make[1]: Entering directory '/mnt/40b88ecf-5660-4110-b4c1-b6105e528191/SourceCode/git/logitech-g710-linux-driver/src/kernel'
make -C /lib/modules/4.18.0-13-generic/build M=/mnt/40b88ecf-5660-4110-b4c1-b6105e528191/SourceCode/git/logitech-g710-linux-driver/src/kernel modules_install
make[2]: Entering directory '/usr/src/linux-headers-4.18.0-13-generic'
INSTALL /mnt/40b88ecf-5660-4110-b4c1-b6105e528191/SourceCode/git/logitech-g710-linux-driver/src/kernel/hid-lg-g710-plus.ko
At main.c:160:
- SSL error:02001002:system library:fopen:No such file or directory: ../crypto/bio/bss_file.c:72
- SSL error:2006D080:BIO routines:BIO_new_file:no such file: ../crypto/bio/bss_file.c:79
sign-file: certs/signing_key.pem: No such file or directory
DEPMOD 4.18.0-13-generic
make[2]: Leaving directory '/usr/src/linux-headers-4.18.0-13-generic'
make[1]: Leaving directory '/mnt/40b88ecf-5660-4110-b4c1-b6105e528191/SourceCode/git/logitech-g710-linux-driver/src/kernel'
make[1]: Entering directory '/mnt/40b88ecf-5660-4110-b4c1-b6105e528191/SourceCode/git/logitech-g710-linux-driver/src/userspace'
make[1]: Nothing to be done for 'install'.
make[1]: Leaving directory '/mnt/40b88ecf-5660-4110-b4c1-b6105e528191/SourceCode/git/logitech-g710-linux-driver/src/userspace'
This is the output, I never built a driver before so i am not sure of the issue
Hi, I love that I can use the extra keys on my G710+ on Linux, thanks for the driver. I cannot get keys G3 and G4 to work, not sure why, but all other extra keys are getting registed. I also find that each time my kernel upgrades, I have to reinstall the driver. Is there anyway to make this automatic?
Thanks,
Rajah
uname -a: Linux Dexter 3.18.6-1-ARCH #1 SMP PREEMPT Sat Feb 7 08:44:05 CET 2015 x86_64 GNU/Linux
Hi, I have done some basic troubleshooting my G613 has G1-G6, playback and volume buttons. I really only care about the G buttons.
I've went ahead and change the device number on both hid-lg-g710-plus.c and the .rules file, compiled and followed the read me.
If I try to set a new shortcut and press G1-G6, I just get F1-F6. I am thinking that maybe this keyboard sends a different code. Do you have any recommendations on how to debug this? A keyboard reading raw tool?
I figured G613 wouldn't be too different from G710.
So I followed the directions, and I'm not entirely sure whether or not it worked...my keyboard (I think) is working exactly the same as before. There were error messages, but I'm not sure If I'd call a keyboard that still technically works a failed install. If it did work, I'd expect the m keys to light up as they do with windows, but I'm not sure. How do I check?
Here's the terminal commands and outputs:
https://gist.github.com/redditCommand/b25ea3c938a12891188d
What are the chances that this driver will work for my g910 too?
Is it possible to have M1-M3 act as modifiers instead of individual keys? Like the Windows implementation. Reading various things bout xmodmap sounds like there are 5 modifier keys in addition to standard modifiers (ctrl, shift, etc). Perhaps they could be utilized in some way.
Issue a keypressed event for selected modifier when G1-G6 are pressed so it appears as if M# was pressed and held while pressing G1-G6?
I that you sent in the driver as patch in kernel mailing list, but it does not appear you received a response. Is that correct?
After running make
, make returns with the following output:
for dir in src/kernel src/userspace; do make -C $dir default; done
make[1]: Entering directory `/home/michael/logitech-g710-linux-driver/src/kernel'
make -C /lib/modules/3.15.10-200.fc20.x86_64/build M=/home/michael/logitech-g710-linux-driver/src/kernel modules
make: Entering an unknown directory
make: *** /lib/modules/3.15.10-200.fc20.x86_64/build: No such file or directory. Stop.
make: Leaving an unknown directory
make[1]: *** [build] Error 2
make[1]: Leaving directory `/home/michael/logitech-g710-linux-driver/src/kernel'
make[1]: Entering directory `/home/michael/logitech-g710-linux-driver/src/userspace'
make[1]: Nothing to be done for `default'.
make[1]: Leaving directory `/home/michael/logitech-g710-linux-driver/src/userspace'
the folder is in /home/michael. Ideas for fixing?
Hi,
LCD backlight control and M1-M3 & MR support has been merged in linux 5.5. Would it be possible to rebase this driver on upstream now, to have the G710 behave as the other Logitech keyboards under linux ?
Hi, I've made a minor change to make it usable under kernel-3.10:
* made usable under kernel 3.10:
A kernel function is not exported anymore (usbhid_submit_report). See link below for details.
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=d881427253da011495f4193663d809d0e9dfa215
Here is the diff:
diff --git a/src/kernel/hid-lg-g710-plus.c b/src/kernel/hid-lg-g710-plus.c
index eff059f..06f7a60 100644
--- a/src/kernel/hid-lg-g710-plus.c
+++ b/src/kernel/hid-lg-g710-plus.c
@@ -164,7 +164,7 @@ static int lg_g710_plus_initialize(struct hid_device *hdev) {
case 8: data->other_buttons_led_report= report; break;
case 9:
data->g_mr_buttons_support_report= report;
- usbhid_submit_report(hdev, report, USB_DIR_OUT);
+ hid_hw_request(hdev, report, HID_REQ_SET_REPORT);
break;
}
}
@@ -247,7 +247,7 @@ static ssize_t lg_g710_plus_show_led_macro(struct device *device, struct device_
if (data != NULL) {
spin_lock(&data->lock);
init_completion(&data->ready);
- usbhid_submit_report(data->hdev, data->mr_buttons_led_report, USB_DIR_IN);
+ hid_hw_request(data->hdev, data->mr_buttons_led_report, HID_REQ_GET_REPORT);
wait_for_completion_timeout(&data->ready, WAIT_TIME_OUT);
spin_unlock(&data->lock);
return sprintf(buf, "%d\n", data->led_macro);
@@ -261,7 +261,7 @@ static ssize_t lg_g710_plus_show_led_keys(struct device *device, struct device_a
if (data != NULL) {
spin_lock(&data->lock);
init_completion(&data->ready);
- usbhid_submit_report(data->hdev, data->other_buttons_led_report, USB_DIR_IN);
+ hid_hw_request(data->hdev, data->other_buttons_led_report, HID_REQ_GET_REPORT);
wait_for_completion_timeout(&data->ready, WAIT_TIME_OUT);
spin_unlock(&data->lock);
return sprintf(buf, "%d\n", data->led_keys);
@@ -280,7 +280,7 @@ static ssize_t lg_g710_plus_store_led_macro(struct device *device, struct device
spin_lock(&data->lock);
data->mr_buttons_led_report->field[0]->value[0]= (key_mask & 0xF) << 4;
- usbhid_submit_report(data->hdev, data->mr_buttons_led_report, USB_DIR_OUT);
+ hid_hw_request(data->hdev, data->mr_buttons_led_report, HID_REQ_SET_REPORT);
spin_unlock(&data->lock);
return count;
}
@@ -304,7 +304,7 @@ static ssize_t lg_g710_plus_store_led_keys(struct device *device, struct device_
spin_lock(&data->lock);
data->other_buttons_led_report->field[0]->value[0]= wasd_mask;
data->other_buttons_led_report->field[0]->value[1]= keys_mask;
- usbhid_submit_report(data->hdev, data->other_buttons_led_report, USB_DIR_OUT);
+ hid_hw_request(data->hdev, data->other_buttons_led_report, HID_REQ_SET_REPORT);
spin_unlock(&data->lock);
return count;
}
Regards,
Michael Dudek
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.