Coder Social home page Coder Social logo

lg4l's Introduction

Logitech 4 Linux

This project is intended to provide kernel modules to support various Logictech input devices including:

  • G110
  • G13
  • G15 (needs testing)
  • G15v2
  • G19
  • G510 (does not work on my device)

This work has been mostly done by a couple of friendly people on the Freenode IRC channel #lg4l

If you're looking for some help, best to drop by there and see if anyone's around.

Building

All going well, you should be able to just install your kernel headers and type

# make
# make install

Now load the correct module for your device, eg:

# modprobe hid-g19

The modules will now be available but the device will still be grabbed by generic-usb. Run the rebind script to put the new module in control of the device:

# ./rebind

lg4l's People

Contributors

ali1234 avatar cmoh avatar jgeboski avatar martynsmith avatar tanktarta avatar tbe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lg4l's Issues

Unable to bind g15v1

Hi, I have a g15v1 keyboard and I have compiled the driver from 4.11 branch (i'm on debian stretch with kernel 4.9). I have an issue when binding the driver to device. When i do lsusb, the output is the following:

Bus 001 Device 042: ID 046d:c222 Logitech, Inc. G15 Keyboard / LCD
Bus 001 Device 040: ID 046d:c221 Logitech, Inc. G11/G15 Keyboard / Keyboard
Bus 001 Device 039: ID 046d:c223 Logitech, Inc. G11/G15 Keyboard / USB Hub

the rebind script try to bind the to the device 046d:c222 but the input device seems to be 046d:c221 ( since 046d:c222 is clearly related to the keyboard LCD) . So i tried to change the the id into rebind script but I get:

bash: echo: write error: No such device

tried to do it manually but I gate the same error

Thank you for your work

Review keyboard initialization sequences

Some "faking away with initialization" message seems to appear on all devices.
The initialization sequence seems to be reverse engineered with an USB monitor from the windows drivers until the device "worked". The stages and the messages exchanged at that phase seem to differ for each device, although the results are ignored by the driver.

Kernel crashes on module removal

Removing the hid-g13 module (with the G13 plugged in) causes the kernel to crash.

  1. make && make install the modules
  2. depmod -a
  3. modprobe hid-g13
  4. Click on the USB icon in virtualbox and enable the G13
  5. sh rebind
  6. G13 lights up, dmesg shows all is well
  7. rmmod hid-g13

It then crashes - http://i.imgur.com/Qmceu.png

In hid-gfb.c, I tried moving the "fb_deferred_io_cleanup(info);" in gfb_free_framebuffer_work() to be the first thing done as this seem to be the order used when gfb_probe() fails. This seem to make it get a little further, but it still crashes on the vfree().

http://i.imgur.com/uf28c.png

Ubuntu 18

After make install. Ik got a bunch off error messages and don't what to do. Afther make also, but that whas a missing depencie.

hmobron@ubuntu2:/tmp/lg4l$ make install
make -C /lib/modules/4.15.0-43-generic/build M=/tmp/lg4l modules_install
make[1]: Map '/usr/src/linux-headers-4.15.0-43-generic' wordt binnengegaan
INSTALL /tmp/lg4l/hid-g110.ko
cp: kan het normale bestand '/lib/modules/4.15.0-43-generic/extra/hid-g110.ko' niet aanmaken: Toegang geweigerd
At main.c:160:

  • SSL error:02001002:system library:fopen:No such file or directory: ../crypto/bio/bss_file.c:74
  • SSL error:2006D080:BIO routines:BIO_new_file:no such file: ../crypto/bio/bss_file.c:81
    sign-file: certs/signing_key.pem: No such file or directory
    INSTALL /tmp/lg4l/hid-g13.ko
    cp: kan het normale bestand '/lib/modules/4.15.0-43-generic/extra/hid-g13.ko' niet aanmaken: Toegang geweigerd
    At main.c:160:
  • SSL error:02001002:system library:fopen:No such file or directory: ../crypto/bio/bss_file.c:74
  • SSL error:2006D080:BIO routines:BIO_new_file:no such file: ../crypto/bio/bss_file.c:81
    sign-file: certs/signing_key.pem: No such file or directory
    INSTALL /tmp/lg4l/hid-g15.ko
    cp: kan het normale bestand '/lib/modules/4.15.0-43-generic/extra/hid-g15.ko' niet aanmaken: Toegang geweigerd
    At main.c:160:
  • SSL error:02001002:system library:fopen:No such file or directory: ../crypto/bio/bss_file.c:74
  • SSL error:2006D080:BIO routines:BIO_new_file:no such file: ../crypto/bio/bss_file.c:81
    sign-file: certs/signing_key.pem: No such file or directory
    INSTALL /tmp/lg4l/hid-g15v2.ko
    cp: kan het normale bestand '/lib/modules/4.15.0-43-generic/extra/hid-g15v2.ko' niet aanmaken: Toegang geweigerd
    At main.c:160:
  • SSL error:02001002:system library:fopen:No such file or directory: ../crypto/bio/bss_file.c:74
  • SSL error:2006D080:BIO routines:BIO_new_file:no such file: ../crypto/bio/bss_file.c:81
    sign-file: certs/signing_key.pem: No such file or directory
    INSTALL /tmp/lg4l/hid-g19.ko
    cp: kan het normale bestand '/lib/modules/4.15.0-43-generic/extra/hid-g19.ko' niet aanmaken: Toegang geweigerd
    At main.c:160:
  • SSL error:02001002:system library:fopen:No such file or directory: ../crypto/bio/bss_file.c:74
  • SSL error:2006D080:BIO routines:BIO_new_file:no such file: ../crypto/bio/bss_file.c:81
    sign-file: certs/signing_key.pem: No such file or directory
    INSTALL /tmp/lg4l/hid-gcore.ko
    cp: kan het normale bestand '/lib/modules/4.15.0-43-generic/extra/hid-gcore.ko' niet aanmaken: Toegang geweigerd
    At main.c:160:
  • SSL error:02001002:system library:fopen:No such file or directory: ../crypto/bio/bss_file.c:74
  • SSL error:2006D080:BIO routines:BIO_new_file:no such file: ../crypto/bio/bss_file.c:81
    sign-file: certs/signing_key.pem: No such file or directory
    INSTALL /tmp/lg4l/hid-gfb.ko
    cp: kan het normale bestand '/lib/modules/4.15.0-43-generic/extra/hid-gfb.ko' niet aanmaken: Toegang geweigerd
    At main.c:160:
  • SSL error:02001002:system library:fopen:No such file or directory: ../crypto/bio/bss_file.c:74
  • SSL error:2006D080:BIO routines:BIO_new_file:no such file: ../crypto/bio/bss_file.c:81
    sign-file: certs/signing_key.pem: No such file or directory
    DEPMOD 4.15.0-43-generic
    make[1]: Map '/usr/src/linux-headers-4.15.0-43-generic' wordt verlaten

Project status

I found the kernel mailinglist threads, but they seem to dead end. Has this project stalled out or is there something in the works that is not visible or I have not found?

I appreciate the effort.

Error building with kernel 4.12.3

When I make the driver with kernel 4.12.3 I have the following error:

make -C /lib/modules/4.12.3-1-ARCH/build M=/home/ogarcia/Devel/aur/lg4l/src/lg4l-06bff7105c74aba96779cd1145a97ef3b36d76ba
make[1]: Entering directory '/usr/lib/modules/4.12.3-1-ARCH/build'
  CC [M]  /home/ogarcia/Devel/aur/lg4l/src/lg4l-06bff7105c74aba96779cd1145a97ef3b36d76ba/hid-gcore.o
/home/ogarcia/Devel/aur/lg4l/src/lg4l-06bff7105c74aba96779cd1145a97ef3b36d76ba/hid-gcore.c: In function 'gcore_leds_probe':
/home/ogarcia/Devel/aur/lg4l/src/lg4l-06bff7105c74aba96779cd1145a97ef3b36d76ba/hid-gcore.c:264:50: error: 'struct hid_device' has no member named 'minor'; did you mean 'vendor'?
   sprintf(led_name, led_templates[i].name, hdev->minor);
                                                  ^~~~~
                                                  vendor
/home/ogarcia/Devel/aur/lg4l/src/lg4l-06bff7105c74aba96779cd1145a97ef3b36d76ba/hid-gcore.c: In function 'gcore_minor_show':
/home/ogarcia/Devel/aur/lg4l/src/lg4l-06bff7105c74aba96779cd1145a97ef3b36d76ba/hid-gcore.c:387:43: error: 'struct hid_device' has no member named 'minor'; did you mean 'vendor'?
  return sprintf(buf, "%d\n", gdata->hdev->minor);
                                           ^~~~~
                                           vendor
/home/ogarcia/Devel/aur/lg4l/src/lg4l-06bff7105c74aba96779cd1145a97ef3b36d76ba/hid-gcore.c:388:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
make[2]: *** [scripts/Makefile.build:309: /home/ogarcia/Devel/aur/lg4l/src/lg4l-06bff7105c74aba96779cd1145a97ef3b36d76ba/hid-gcore.o] Error 1
make[1]: *** [Makefile:1512: _module_/home/ogarcia/Devel/aur/lg4l/src/lg4l-06bff7105c74aba96779cd1145a97ef3b36d76ba] Error 2
make[1]: Leaving directory '/usr/lib/modules/4.12.3-1-ARCH/build'
make: *** [Makefile:14: default] Error 2

If I edit source file and make change as suggest (minor for vendor) seems work well.

hid_ginput crash with 3.13 and 3.14 kernels on start of g15 client utilities

Using your gnome15 overlay on kernels 3.13 and 3.14 with this ebuild:
sys-kernel/lg4l-kernel-module-20130906-r1::gnome15

Relevant boot dmesg output (seems allright?):

# egrep -i 'gnome15|hid|G19' /var/log/messages
kernel: hidraw: raw HID events driver (C) Jiri Kosina
kernel: usbcore: registered new interface driver usbhid
kernel: usbhid: USB HID core driver
kernel: hid-generic 0003:046D:C066.0001: input,hidraw0: USB HID v1.11 Mouse [Logitech G9x Laser Mouse] on usb-0000:00:1a.1-2/input0
kernel: hid-generic 0003:046D:C066.0002: input,hiddev0,hidraw1: USB HID v1.11 Keyboard [Logitech G9x Laser Mouse] on usb-0000:00:1a.1-2/input1
kernel: usb 1-6.1: Product: G19 Gaming Keyboard
kernel: input: G19 Gaming Keyboard as /devices/pci0000:00/0000:00:1a.7/usb1/1-6/1-6.1/1-6.1:1.0/input/input16
kernel: hid-generic 0003:046D:C228.0003: input,hidraw2: USB HID v1.10 Keyboard [G19 Gaming Keyboard] on usb-0000:00:1a.7-6.1/input0
kernel: input: G19 Gaming Keyboard as /devices/pci0000:00/0000:00:1a.7/usb1/1-6/1-6.1/1-6.1:1.1/input/input17
kernel: hid-generic 0003:046D:C228.0004: input,hiddev0,hidraw3: USB HID v1.10 Device [G19 Gaming Keyboard] on usb-0000:00:1a.7-6.1/input1
kernel: usb 1-6.2: Product: G19 Gaming Keyboard
kernel: input: Logitech G19 Gaming Keyboard as /devices/pci0000:00/0000:00:1a.7/usb1/1-6/1-6.2/1-6.2:1.1/input/input18
kernel: hid-generic 0003:046D:C229.0005: input,hiddev0,hidraw4: USB HID v1.11 Keypad [Logitech G19 Gaming Keyboard] on usb-0000:00:1a.7-6.2/input1
kernel: input: Logitech G19 Gaming Keyboard as /devices/pci0000:00/0000:00:1a.7/usb1/1-6/1-6.2/1-6.2:1.1/input/input19
kernel: hid-g19 0003:046D:C229.0005: input,hiddev0,hidraw4: USB HID v1.11 Keypad [Logitech G19 Gaming Keyboard] on usb-0000:00:1a.7-6.2/input1
kernel: input: Logitech G19 as /devices/pci0000:00/0000:00:1a.7/usb1/1-6/1-6.2/1-6.2:1.1/input/input20
kernel: hid-g19 0003:046D:C229.0005: Logitech G19 hasn't completed stage 1 yet, forging ahead with initialization
kernel: hid-g19 0003:046D:C229.0005: Logitech G19 hasn't completed stage 2 yet, forging ahead with initialization
kernel: hid-g19 0003:046D:C229.0005: Logitech G19 hasn't completed stage 3 yet, forging ahead with initialization
kernel: input: gnome15-mouse as /devices/virtual/input/input21
kernel: input: gnome15-keyboard as /devices/virtual/input/input22
kernel: input: gnome15-joystick as /devices/virtual/input/input23
kernel: input: gnome15-digital-joystick as /devices/virtual/input/input24

As soon as the client utilities start (not sure which one causes this, either g15-systemtray or g15-desktop-service) this happens:

dbus[2171]: [system] Activating service name='org.gnome15.SystemService' (using servicehelper)
dbus[2171]: [system] Successfully activated service 'org.gnome15.SystemService'
kernel: BUG: unable to handle kernel paging request at ffff8803309f6930
kernel: IP: [<ffffffffa0a481be>] ginput_setkeycode+0x5e/0xd0 [hid_ginput]
kernel: PGD 1e0f067 PUD 1e12067 PMD 0 
kernel: Oops: 0002 [#1] PREEMPT SMP 
kernel: Modules linked in: hid_g19(O) hid_gfb(O) hid_ginput(O) nvidia(PO)
kernel: CPU: 6 PID: 3524 Comm: python2.7 Tainted: P           O 3.13.6-gentoo #1
kernel: Hardware name: Gigabyte Technology Co., Ltd. EX58-UD4P/EX58-UD4P, BIOS F14p 01/28/2011
kernel: task: ffff8800db9620d0 ti: ffff8802d8398000 task.ti: ffff8802d8398000
kernel: RIP: 0010:[<ffffffffa0a481be>]  [<ffffffffa0a481be>] ginput_setkeycode+0x5e/0xd0 [hid_ginput]
kernel: RSP: 0018:ffff8802d8399e30  EFLAGS: 00010046
kernel: RAX: 0000000000000287 RBX: ffff8803109f7800 RCX: 0000000000000025
kernel: RDX: 00000000ffff8803 RSI: 0000000000000067 RDI: ffff8800db141168
kernel: RBP: ffff8802d8399e78 R08: 00000000ffffffb7 R09: ffff8802da981af5
kernel: R10: 0000000000000000 R11: f000000000000000 R12: ffff8800db141120
kernel: R13: ffff8802d8399e74 R14: ffff8800db141168 R15: 00000000000000fb
kernel: FS:  00007f077d7f0700(0000) GS:ffff88031fd80000(0000) knlGS:0000000000000000
kernel: CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
kernel: CR2: ffff8803309f6930 CR3: 00000002febea000 CR4: 00000000000007e0
kernel: Stack:
kernel: ffff8802da981af9 0000000000000019 ffff8800db141120 0000000000000018 
kernel: ffff880310a158e8 ffffffffa0a4840f 000000250000000a 0000000000000067 
kernel: ffff880300000000 00000067f0792cc9 0000000000000025 ffff8800c007b5c0 
kernel: Call Trace:
kernel: [<ffffffffa0a4840f>] ? ginput_keymap_store+0xff/0x1c0 [hid_ginput]
kernel: [<ffffffff81157cde>] ? sysfs_write_file+0x11e/0x1c0
kernel: [<ffffffff810f520a>] ? vfs_write+0xaa/0x1e0
kernel: [<ffffffff810f5c13>] ? SyS_write+0x43/0xa0
kernel: [<ffffffff817301a2>] ? page_fault+0x22/0x30
kernel: [<ffffffff81730662>] ? system_call_fastpath+0x16/0x1b
kernel: Code: 24 48 4c 89 f7 e8 e3 79 ce e0 8b 4d 08 49 8b 54 24 28 8b 14 8a 41 89 55 00 49 8b 54 24 28 8b 4d 08 8b 75 04 89 34 8a 41 8b 55 00 <48> 0f b3 53 30 8b 55 04 48 0f ab 53 30 44 8b 83 d4 00 00 00 45  
kernel: RIP  [<ffffffffa0a481be>] ginput_setkeycode+0x5e/0xd0 [hid_ginput]
kernel: RSP <ffff8802d8399e30>
kernel: CR2: ffff8803309f6930
kernel: ---[ end trace 5041fef59d7e362b ]---

After this it's just a matter of time before the whole system goes down.

Cannot build in 3.17+ kernels

At build time I give this error:

make -C /lib/modules/3.18.1-1-ARCH/build M=/home/ogarcia/Documentos/lg4l modules
make[1]: Entering directory '/usr/lib/modules/3.18.1-1-ARCH/build'
  CC [M]  /home/ogarcia/Documentos/lg4l/hid-g19.o
In file included from include/linux/cpumask.h:12:0,
                 from ./arch/x86/include/asm/cpumask.h:4,
                 from ./arch/x86/include/asm/msr.h:10,
                 from ./arch/x86/include/asm/processor.h:20,
                 from ./arch/x86/include/asm/atomic.h:6,
                 from include/linux/atomic.h:4,
                 from include/linux/kgdb.h:18,
                 from include/linux/fb.h:4,
                 from /home/ogarcia/Documentos/lg4l/hid-g19.c:19:
include/linux/bug.h:33:45: error: negative width in bit-field '<anonymous>'
 #define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); }))
                                             ^
include/linux/kernel.h:815:3: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
   BUILD_BUG_ON_ZERO((perms) & 2) +    \
   ^
include/linux/sysfs.h:75:12: note: in expansion of macro 'VERIFY_OCTAL_PERMISSIONS'
    .mode = VERIFY_OCTAL_PERMISSIONS(_mode) },  \
            ^
include/linux/device.h:540:45: note: in expansion of macro '__ATTR'
  struct device_attribute dev_attr_##_name = __ATTR(_name, _mode, _show, _store)
                                             ^
/home/ogarcia/Documentos/lg4l/hid-g19.c:163:8: note: in expansion of macro 'DEVICE_ATTR'
 static DEVICE_ATTR(fb_update_rate, 0666,
        ^
include/linux/bug.h:33:45: error: negative width in bit-field '<anonymous>'
 #define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); }))
                                             ^
include/linux/kernel.h:815:3: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
   BUILD_BUG_ON_ZERO((perms) & 2) +    \
   ^
include/linux/sysfs.h:75:12: note: in expansion of macro 'VERIFY_OCTAL_PERMISSIONS'
    .mode = VERIFY_OCTAL_PERMISSIONS(_mode) },  \
            ^
include/linux/device.h:540:45: note: in expansion of macro '__ATTR'
  struct device_attribute dev_attr_##_name = __ATTR(_name, _mode, _show, _store)
                                             ^
/home/ogarcia/Documentos/lg4l/hid-g19.c:449:8: note: in expansion of macro 'DEVICE_ATTR'
 static DEVICE_ATTR(keymap_index, 0666,
        ^
include/linux/bug.h:33:45: error: negative width in bit-field '<anonymous>'
 #define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); }))
                                             ^
include/linux/kernel.h:815:3: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
   BUILD_BUG_ON_ZERO((perms) & 2) +    \
   ^
include/linux/sysfs.h:75:12: note: in expansion of macro 'VERIFY_OCTAL_PERMISSIONS'
    .mode = VERIFY_OCTAL_PERMISSIONS(_mode) },  \
            ^
include/linux/device.h:540:45: note: in expansion of macro '__ATTR'
  struct device_attribute dev_attr_##_name = __ATTR(_name, _mode, _show, _store)
                                             ^
/home/ogarcia/Documentos/lg4l/hid-g19.c:453:8: note: in expansion of macro 'DEVICE_ATTR'
 static DEVICE_ATTR(keymap, 0666,
        ^
include/linux/bug.h:33:45: error: negative width in bit-field '<anonymous>'
 #define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); }))
                                             ^
include/linux/kernel.h:815:3: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
   BUILD_BUG_ON_ZERO((perms) & 2) +    \
   ^
include/linux/sysfs.h:75:12: note: in expansion of macro 'VERIFY_OCTAL_PERMISSIONS'
    .mode = VERIFY_OCTAL_PERMISSIONS(_mode) },  \
            ^
include/linux/device.h:540:45: note: in expansion of macro '__ATTR'
  struct device_attribute dev_attr_##_name = __ATTR(_name, _mode, _show, _store)
                                             ^
/home/ogarcia/Documentos/lg4l/hid-g19.c:526:8: note: in expansion of macro 'DEVICE_ATTR'
 static DEVICE_ATTR(name, 0666, g19_name_show, g19_name_store);
        ^
scripts/Makefile.build:263: recipe for target '/home/ogarcia/Documentos/lg4l/hid-g19.o' failed
make[2]: *** [/home/ogarcia/Documentos/lg4l/hid-g19.o] Error 1
Makefile:1381: recipe for target '_module_/home/ogarcia/Documentos/lg4l' failed
make[1]: *** [_module_/home/ogarcia/Documentos/lg4l] Error 2
make[1]: Leaving directory '/usr/lib/modules/3.18.1-1-ARCH/build'
Makefile:13: recipe for target 'all' failed
make: *** [all] Error 2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.