libratbag / libratbag

A DBus daemon to configure input devices, mainly high-end and gaming mice
MIT License
2.11k stars 258 forks source link

ratbagctl on mx518 error: no devices available #1000

Open fr4gtp opened 4 years ago

fr4gtp commented 4 years ago
[xxx@arch ~]$ uname -srmo      
Linux 5.6.15-arch1-1 x86_64 GNU/Linux
[xxx@arch ~]$ ratbagd --version
0.14
[xxx@arch ~]$ lsusb            
...
Bus 005 Device 005: ID 046d:c051 Logitech, Inc. G3 (MX518) Optical Mouse
...
[xxx@arch ~]$ cat /usr/share/libratbag/logitech-MX518.device 
[Device]
Name=MX518
DeviceMatch=usb:046d:c051
Driver=hidpp20
[xxx@arch ~]$ ratbagctl list                                
No devices available.

while the device is working properly

[xxx@arch ~]$ sudo lomoco -i
005.005: 046d:c051 MX518 Optical Mouse (M-BS81A) Caps: RES 
        Resolution (RES): 800 cpi
        USB Mouse Polling Interval:  10ms

as well deamon

[xxx@arch ~]$ sudo systemctl status ratbagd       
● ratbagd.service - Daemon to introspect and modify configurable mice
     Loaded: loaded (/usr/lib/systemd/system/ratbagd.service; disabled; vendor preset: disabled)
     Active: active (running) since Tue 2020-06-09 03:47:25 MSK; 6min ago
   Main PID: 23407 (ratbagd)
      Tasks: 1 (limit: 4683)
     Memory: 1.2M
     CGroup: /system.slice/ratbagd.service
             └─23407 /usr/bin/ratbagd
thomasa88 commented 4 years ago

I thought I had the MX518 and the same problem. But it turns out I have the G400. However, this command could maybe shine some light on your issue as well, to see if any data files are found for the mouse:

# Stop ratbagd (can probably do it nicer with systemctl)
$ sudo pkill ratbagd
$ sudo ratbagd --verbose
Initializing libratbag
ratbag debug: New device: Lenovo Lenovo Traditional USB Keyboard
ratbag debug: Using data directory '/usr/share/libratbag'
ratbag debug: No data file found for 17ef:6099
ratbag debug: New device: Logitech Gaming Mouse G400
ratbag debug: Using data directory '/usr/share/libratbag'
ratbag debug: No data file found for 046d:c245
ratbag debug: New device: Logitech Gaming Mouse G400
ratbag debug: Using data directory '/usr/share/libratbag'
ratbag debug: No data file found for 046d:c245
ratbag debug: New device: Trapper Data AB MouseTrapper Advance
ratbag debug: Using data directory '/usr/share/libratbag'
ratbag debug: No data file found for 0d24:0005
ratbag debug: New device: Trapper Data AB MouseTrapper Advance
ratbag debug: Using data directory '/usr/share/libratbag'
ratbag debug: No data file found for 0d24:0005
DBus server ready

edit. Looks like your USB ID does not match the file in libratbag. Maybe try changing it (but it could be different chips and not work):

$ cat /usr/share/libratbag/logitech-MX518.device
[Device]
Name=MX518
DeviceMatch=usb:046d:c08e
Driver=hidpp20

edit. I'm not sure if making it match could screw up something in your mouse permanently. I have not used libratbag before.

fr4gtp commented 4 years ago

Looks like your USB ID does not match the file in libratbag. Maybe try changing it (but it could be different chips and not work):

$ cat /usr/share/libratbag/logitech-MX518.device
[Device]
Name=MX518
DeviceMatch=usb:046d:c08e
Driver=hidpp20

As you can see, the previous identifier is the same. However then this also did not work. But now he's different

then:

[xxx@arch ~]$ cat /usr/share/libratbag/logitech-MX518.device 
[Device]
Name=MX518
DeviceMatch=usb:046d:c051
Driver=hidpp20

now:

[xxx@arch ~]$ cat /usr/share/libratbag/logitech-MX518.device 
[Device]
Name=MX518
DeviceMatch=usb:046d:c08e
Driver=hidpp20

I have another MX518 of an earlier revision, it didn’t work either I can change the identifier manually, but earlier the identifier matched, this could be a bug, but not hardware understand but it can be disassembled both devices and indicate chip marking and any other information so that the device works with ratbagd?

sebschrader commented 3 years ago

I also have an MX518 with ID 046d:c051. I tried to create a new device file for this device:

% cat /usr/share/libratbag/logitech-MX518a.device
[Device]
Name=MX518
DeviceMatch=usb:046d:c051
Driver=hidpp20

If I start ratbagd after I created this file, at first it does look like it detects the device and loads the hidpp20 driver.

% sudo ratbagd --verbose=debug
Initializing libratbag
ratbag debug: New device: Logitech USB-PS/2 Optical Mouse
ratbag debug: Using data directory '/usr/share/libratbag'
ratbag debug: device assigned driver hidpp20
ratbag debug: hidraw info: bus 0x03 vendor 0x46d product 0xffffc051
ratbag debug: Logitech USB-PS/2 Optical Mouse is device '/dev/hidraw0'.
ratbag debug: Parsing HID report descriptor
ratbag debug: Parsing HID report descriptor
DBus server ready

But unfortunately no:

% ratbagctl --verbose list
No devices available.

Is there anything I can provide to help?

FFY00 commented 3 years ago

Currently, we only support the new MX518, released in 2019.

anohren commented 3 years ago

My old MX518 didn't work either, even after changing to hidpp10 and following the logitech recommendations to add a device. Perhaps the supported one (and its file) could be named e.g. "MX518 (2nd gen)" or "... (2019)" to avoid confusion? Currently, when looking in the devices folder in the repo it looks as though the original one is supported.

wjaskowski commented 3 years ago

Just to report. My older MX518 doesn't work either:

[Device]
Name=MX518
DeviceMatch=usb:046d:c08e
Driver=hidpp20
FFY00 commented 3 years ago

Unfortunately, the old MX518 does not support the new protocol. Could you try with hidpp10? If it doesn't work then it most likely is a custom protocol, which someone will have to reverse engineer.

wjaskowski commented 3 years ago

Unfortunately, updating the section to:

[Device]
Name=MX518
DeviceMatch=usb:046d:c051
Driver=hidpp10

in /usr/share/libratbag/logitech-MX518.device given lsusb output of Bus 001 Device 002: ID 046d:c051 Logitech, Inc. G3 (MX518) Optical Mouse

doesn't help.

fr4gtp commented 3 years ago

I tested old mx518 with hidpp10

 lsusb
...
Bus 004 Device 003: ID 046d:c051 Logitech, Inc. G3 (MX518) Optical Mouse
...
cat /usr/share/libratbag/logitech-MX518.device

[Device]
Name=MX518
DeviceMatch=usb:046d:c051
Driver=hidpp10
 sudo ratbagd --verbose=debug

Initializing libratbag
...
ratbag debug: New device: Logitech USB-PS/2 Optical Mouse
ratbag debug: Using data directory '/usr/share/libratbag'
ratbag debug: device assigned driver hidpp10
ratbag debug: hidraw info: bus 0x03 vendor 0x46d product 0xffffc051
ratbag debug: Logitech USB-PS/2 Optical Mouse is device '/dev/hidraw2'.
ratbag debug: Parsing HID report descriptor
ratbag debug: Parsing HID report descriptor
DBus server ready
ratbagctl --verbose list
No devices available.

not work

skiner68 commented 3 years ago

Same here: first version MX518 not working, even with custom .device file based on default MX518 Bus 001 Device 005: ID 046d:c051 Logitech, Inc. G3 (MX518) Optical Mouse

ratbag debug: New device: Logitech USB-PS/2 Optical Mouse ratbag debug: Using data directory '/usr/share/libratbag' ratbag debug: device assigned driver hidpp20 ratbag debug: hidraw info: bus 0x03 vendor 0x46d product 0xffffc051 ratbag debug: Logitech USB-PS/2 Optical Mouse is device '/dev/hidraw3'. ratbag debug: Parsing HID report descriptor ratbag debug: Parsing HID report descriptor

samirnp commented 3 years ago

Hi,

I'm not sure if this is relevant, but I notice that other .device files in /usr/share/libratbag have the identifier Name= as Name= Logitech [alphanumeric] and not just Name=[alphanumeric] like in /usr/share/libratbag/logitech-MX518.device. Does the Name identifier matter for recognition of the device?

lucasmr commented 1 year ago

ID 046d:c01e Logitech, Inc. MX518 Optical Mouse This version also doesn't work, tested with hidpp10 and hidpp20 on libratbag 0.17