Skip to content
This repository has been archived by the owner on Dec 14, 2019. It is now read-only.

(re?)add usb product IDs for G510 #5

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

anomaly256
Copy link

This builds cleanly and works on my end to drive the G510

@NoXPhasma
Copy link

May I ask you how you got your G510 to work with this? I can install it with your changes and the module is loaded. But beside that it creates only a symlink to /dev/g510-extra-keys nothing works. I can't even chose the Kernel driver. It still only offers me G15 Direct as driver.

I'm running Kernel 4.4.

@anomaly256
Copy link
Author

anomaly256 commented Jul 5, 2016

They seem to have removed the g510 kernel module from the Makefile - no idea why. Also I don't think they ever accepted this PR, no idea why either. The changes submitted here work fine for me

@anomaly256
Copy link
Author

anomaly256 commented Jul 5, 2016

anomaly@scorched ~/src/lg4l $ grep -i g510 hid-ids.h Makefile 
hid-ids.h:#define USB_DEVICE_ID_LOGITECH_G510_LCD               0xc22d
hid-ids.h:#define USB_DEVICE_ID_LOGITECH_G510_AUDIO_LCD 0xc22e
Makefile:obj-m := hid-gcore.o hid-gfb.o hid-g110.o hid-g13.o hid-g15.o hid-g15v2.o hid-g19.o hid-g510.o

anomaly@scorched ~/src/lg4l $ make clean ; make

anomaly@scorched ~/src/lg4l $ ls *510*
hid-g510.c  hid-g510.ko  hid-g510.mod.c  hid-g510.mod.o  hid-g510.o

anomaly@scorched ~/src/lg4l $ sudo insmod hid-gcore.ko
anomaly@scorched ~/src/lg4l $ sudo insmod hid-gfb.ko 
anomaly@scorched ~/src/lg4l $ sudo insmod hid-g510.ko

Gnome15 is now able to talk to my G510 just fine. Authors, why are you holding this back? I'm on 4.6.3 currently, but I've tested this on earlier versions right back to 4.0 or 4.2 iirc

@NoXPhasma
Copy link

Well, as I said, for me it doesn't work at all. I can build and install it. But I get this error message:

INFO    02:30:26-MainThread gnome15.drivers.driver_kernel - Enabling macro keys for joystick
INFO    02:30:26-MainThread gnome15.drivers.driver_kernel - Using GFB_MONO frame buffer mode
INFO    02:30:26-MainThread gnome15.drivers.driver_kernel - Trying fb0
INFO    02:30:26-MainThread gnome15.drivers.driver_kernel - Enabling macro keys for joystick
INFO    02:30:26-MainThread gnome15.drivers.driver_kernel - Using GFB_MONO frame buffer mode
INFO    02:30:26-MainThread gnome15.drivers.driver_kernel - Trying fb0
INFO    02:30:26-MainThread gnome15.g15config - Failed to load driver.
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/gnome15/g15config.py", line 784, in _load_drivers
    driver = driver_mod.Driver(self.selected_device)
  File "/usr/lib/python2.7/dist-packages/gnome15/drivers/driver_kernel.py", line 997, in __init__
    self._init_device()
  File "/usr/lib/python2.7/dist-packages/gnome15/drivers/driver_kernel.py", line 1401, in _init_device
    raise Exception("No frame buffer device specified, and none could be found automatically. Are the kernel modules loaded?")
Exception: No frame buffer device specified, and none could be found automatically. Are the kernel modules loaded?
DEBUG   02:30:26-MainThread gnome15.g15config - Stopped
DEBUG   02:30:26-MainThread gnome15.g15config - Failed to connect to service.

The module is loaded:

$ lsmod | grep hid
hid_g510               20480  0
hid_gfb                16384  1 hid_g510
hid_gcore              16384  1 hid_g510
fb_sys_fops            16384  2 drm_kms_helper,hid_gfb
syscopyarea            16384  2 drm_kms_helper,hid_gfb
sysfillrect            16384  2 drm_kms_helper,hid_gfb
sysimgblt              16384  2 drm_kms_helper,hid_gfb
mac_hid                16384  0
hid_generic            16384  0
usbhid                 49152  0
hid                   118784  5 hid_g510,hid_generic,hid_gfb,usbhid,hid_gcore

And g15-config only shows me the G15 Direct driver.

I'm on Linux Mint 18 x64.

@anomaly256
Copy link
Author

Do you have the uinput module loaded, and are permissions correct on /dev/uinput?

I had to change these. Now my g510 is green and showing system load on the LCD.

@anomaly256
Copy link
Author

This is using the 'g15-direct' module within g15-config by the way. The hid-g510.ko wraps it afaik but provides the g15's interface to userspace

@anomaly256
Copy link
Author

You likely need to alter udev rules for uinput to open up permissions in a way that persists across reboots. I'm not familiar with Mint personally, but I'd wager that this is the problem

@NoXPhasma
Copy link

I have all the udev rules installed and enabled, which come with gnome15.

$ ll /lib/udev/rules.d/ | grep gnome15
-rw-r--r-- 1 root root  223 Jul  5 03:36 98-gnome15.rules
-rw-r--r-- 1 root root 1,5K Jul  5 03:36 99-gnome15-g15direct.rules
-rw-r--r-- 1 root root  311 Jul  5 03:36 99-gnome15-g19direct.rules
-rw-r--r-- 1 root root  282 Jul  5 03:36 99-gnome15-g930.rules
-rw-r--r-- 1 root root 3,2K Jul  5 03:36 99-gnome15-kernel.rules

And yes, I have uinput and python-uinput installed.

crw-rw----+ 1 root plugdev 10, 223 Jul 4 19:54 /dev/uinput

I'm in the group plugdev. But as you can see in my log, it complaints that it can't find a framebuffer device.

@anomaly256
Copy link
Author

that + at the end of the permissions implies an ACL is applied to it beyond the normal posix permissions, which might be interfering. As for the framebuffer issue, I couldn't say but might be related to that. I'm not sure where/how it talks to the LCD's framebuffer, I didn't write this code. But this still looks like a permissions issue somewhere. All I can say is that when everything is right, it does indeed work on the G510 - and is working for me right now. I think you should file an issue and get the original devs to look in to it

@guidugli
Copy link

It does not work to me. Whenever you attach the keyboard to the driver it freezes.

@anomaly256
Copy link
Author

A lot has changed between then and now. No one ever merged this and now it’s unmauntained. I’d consider this project dead. I don’t even have that keyboard any more so I can’t test, sorry

@anomaly256
Copy link
Author

I mean, support for this specific keyboard as dead, not the project itself, sorry

@guidugli
Copy link

guidugli commented Nov 7, 2017 via email

@anomaly256
Copy link
Author

Good luck, sorry I can't be more help

@guidugli
Copy link

The driver would never work because the USB structure is different than on G13 (the base of this driver). I did change it and was able to initialize the driver, changing the keyboard color and setting up M1 led. The problem I am having is that the driver process well the G keys but if I type any other common key, it freezes. I was hoping someone who understands how these drivers work could help me understand how it should work.

@anomaly256
Copy link
Author

anomaly256 commented Nov 26, 2017

It wasn't using the g13 driver it was using the g15 driver, and it absolutely was working for me then. I could control backlighting and use LCD applets, and typing still worked including macros. If it's broken now I dare say it's due to something else changing in the Linux kernel but again I don't have the hardware to investigate unfortunately

@anomaly256
Copy link
Author

Or, possibly, maybe there are multiple hardware revisions of the G510 that talk a slightly different protocol but I wouldn't think so

@guidugli
Copy link

No, based on your comments I believe you were using g15direct which is a python module that control the keyboard from user space. It works fine, unless you are running linux with Wayland.
Anyway, I got the module working but need to work on gnome15 because I believe some things are missing in the driver_kernel.py module.

@anomaly256
Copy link
Author

Ok, that may be the case but it was definitely using the g510 kernel module this code base used to build as well, not the g13 one

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants