Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

G502 side scroll buttons need onboard profiles to work correctly in Linux #2618

Open
DrkShadow opened this issue Oct 2, 2024 · 4 comments
Open

Comments

@DrkShadow
Copy link

Information

  • Solaar version (solaar --version or git describe --tags if cloned from this repository):
  • Distribution: Gentoo
  • Kernel version (ex. uname -srmo): Linux 6.6.47-gentoo x86_64
  • Output of solaar show:
solaar version 1.1.13

Lightspeed Receiver
  Device path  : /dev/hidraw6
  USB id       : 046d:C539
  Serial       : 29189FD2
  C Pending    : ff
    Firmware   : 39.06.B0040
    Bootloader : 02.09
    Other      : AA.BE
  Has 1 paired device(s) out of a maximum of 1.
  Notifications: wireless, software present (0x000900)
  Device activity counters: (empty)

  1: G502 Gaming Mouse
     Device path  : None
     WPID         : 407F
     Codename     : G502
     Kind         : mouse
     Protocol     : HID++ 4.2
     Report Rate : 1ms
     Serial number: 3C045B04
     Model ID:      407FC08D0000
     Unit ID:       3C045B04
                 1: BOT 92.00.B0008
                 0: MPM 17.00.B0008
                 3: 
     The power switch is located on the base.
     Supports 30 HID++ 2.0 features:
         0: ROOT                   {0000} V0     
         1: FEATURE SET            {0001} V0     
         2: DEVICE FW VERSION      {0003} V2     
            Firmware: Bootloader BOT 92.00.B0008 AAEF21F1FA5F
            Firmware: Firmware MPM 17.00.B0008 407F21F1FA5F
            Firmware: Other   
            Unit ID: 3C045B04  Model ID: 407FC08D0000  Transport IDs: {'wpid': '407F', 'usbid': 'C08D'}
         3: DEVICE NAME            {0005} V0     
            Name: G502 LIGHTSPEED Wireless Gaming Mouse
            Kind: mouse
         4: WIRELESS DEVICE STATUS {1D4B} V0     
         5: CONFIG CHANGE          {0020} V0     
            Configuration: 11000000000000000000000000000000
         6: BATTERY VOLTAGE        {1001} V2     
            Battery: 70% 3945mV , discharging.
         7: COLOR LED EFFECTS      {8070} V4     
            LED Control (saved): Solaar
            LED Control        : Solaar
            LEDs Primary (saved): !LEDEffectSetting {ID: 0, color: 16711680, intensity: 0, period: 100, ramp: 0, speed: 0}
            LEDs Primary        : None
            LEDs Logo (saved): !LEDEffectSetting {ID: 0, color: 2142890, intensity: 0, period: 100, ramp: 0, speed: 0}
            LEDs Logo        : None
         8: LED CONTROL            {1300} V0     
         9: ONBOARD PROFILES       {8100} V0     
            Device Mode: Host
            Onboard Profiles (saved): Disabled
            Onboard Profiles        : Disabled
        10: MOUSE BUTTON SPY       {8110} V0     
        11: REPORT RATE            {8060} V0     
            Report Rate: 1ms
            Report Rate (saved): 1ms
            Report Rate        : 1ms
        12: ADJUSTABLE DPI         {2201} V1     
            Sensitivity (DPI) (saved): 1300
            Sensitivity (DPI)        : 1300
        13: DEVICE RESET           {1802} V0    internal, hidden 
        14: unknown:1803           {1803} V0    internal, hidden 
        15: OOBSTATE               {1805} V0    internal, hidden 
        16: CONFIG DEVICE PROPS    {1806} V4    internal, hidden 
        17: unknown:1811           {1811} V0    internal, hidden 
        18: unknown:1830           {1830} V0    internal, hidden 
        19: unknown:1890           {1890} V4    internal, hidden 
        20: unknown:1891           {1891} V4    internal, hidden 
        21: unknown:18A1           {18A1} V0    internal, hidden 
        22: unknown:1801           {1801} V0    internal, hidden 
        23: unknown:18B1           {18B1} V0    internal, hidden 
        24: unknown:1DF3           {1DF3} V0    internal, hidden 
        25: unknown:1E00           {1E00} V0    hidden 
        26: unknown:1EB0           {1EB0} V0    internal, hidden 
        27: unknown:1863           {1863} V0    internal, hidden 
        28: unknown:1E22           {1E22} V0    internal, hidden 
        29: HIRES WHEEL            {2121} V0     
            Multiplier: 8
            Has invert: Normal wheel motion
            Has ratchet switch: Normal wheel mode
            Low resolution mode
            HID notification
            Scroll Wheel Direction (saved): False
            Scroll Wheel Direction        : False
            Scroll Wheel Resolution (saved): False
            Scroll Wheel Resolution        : False
            Scroll Wheel Diversion (saved): False
            Scroll Wheel Diversion        : False
     Battery: 70% 3945mV , discharging.
  • Contents of ~/.config/solaar/config.yaml (or ~/.config/solaar/config.json if ~/.config/solaar/config.yaml not present):
- 1.1.13
- _NAME: G502 Gaming Mouse
  _absent: [hi-res-scroll, lowres-scroll-mode, scroll-ratchet, smart-shift, thumb-scroll-invert, thumb-scroll-mode, report_rate_extended, pointer_speed,
    dpi_extended, speed-change, backlight, backlight_level, backlight_duration_hands_out, backlight_duration_hands_in, backlight_duration_powered, backlight-timed,
    rgb_control, rgb_zone_, brightness_control, per-key-lighting, fn-swap, reprogrammable-keys, persistent-remappable-keys, divert-keys, disable-keyboard-keys,
    crown-smooth, divert-crown, divert-gkeys, m-key-leds, mr-key-led, multiplatform, change-host, gesture2-gestures, gesture2-divert, gesture2-params, sidetone,
    equalizer, adc_power_management]
  _battery: 4097
  _modelId: 407FC08D0000
  _sensitive: {dpi: true, hires-scroll-mode: false, hires-smooth-invert: false, hires-smooth-resolution: true, led_control: true, led_zone_1: true, led_zone_2: true,
    onboard_profiles: false, report_rate: false}
  _serial: 3C045B04
  _unitId: 3C045B04
  _wpid: 407F
  dpi: 1300
  hires-scroll-mode: false
  hires-smooth-invert: false
  hires-smooth-resolution: false
  led_control: 1
  led_zone_1: !LEDEffectSetting {ID: 0, color: 16711680, intensity: 0, period: 100, ramp: 0, speed: 0}
  led_zone_2: !LEDEffectSetting {ID: 0, color: 2142890, intensity: 0, period: 100, ramp: 0, speed: 0}
  onboard_profiles: 0
  report_rate: 1
  • Errors or warrnings from Solaar:

Describe the bug
Side scrolling breaks shortly after plugging in the mouse. It seems to be related to Scroll Wheel Resolution (which I disable, because I hate the partial-line scroll, and also scrolling between clicks).

This seems related to #86. When I run xev, the left-and-right scroll of the scroll wheel show buttons 14 and 15 (whereas the issue suggests it should be 6 and 7).

ButtonPress event, serial 47, synthetic NO, window 0x5400001,
    root 0x4ab, subw 0x0, time 3003316313, (113,72), root:(2140,754),
    state 0x10, button 15, same_screen YES

ButtonRelease event, serial 47, synthetic NO, window 0x5400001,
    root 0x4ab, subw 0x0, time 3003316504, (113,72), root:(2140,754),
    state 0x10, button 15, same_screen YES

ButtonPress event, serial 47, synthetic NO, window 0x5400001,
    root 0x4ab, subw 0x0, time 3003317262, (113,72), root:(2140,754),
    state 0x10, button 14, same_screen YES

ButtonRelease event, serial 47, synthetic NO, window 0x5400001,
    root 0x4ab, subw 0x0, time 3003317442, (113,72), root:(2140,754),
    state 0x10, button 14, same_screen YES

If I unplug the receiver and plug it back in, it works all right; because I'm not in plugdev group, I change the owner of the hiddev devices in /dev to my user, start solaar, and side-scroll stops working.

@DrkShadow DrkShadow added the bug label Oct 2, 2024
@pfps
Copy link
Collaborator

pfps commented Oct 8, 2024

Solaar should not require the plugdev group any more. What Solaar needs is access to /dev/hidrawN nodes, which is done using a udev rule.

Are you sure that you mean side scroll? Solaar doesn't do anything with that on your mouse as far as I can tell. It may be that changing owner is what is interfering with side scroll.

@DrkShadow
Copy link
Author

I guess that explains why I had to chgrp -- the udev file sets "uaccess" and does ACLs (for systemd machines?) -- but those aren't on my machine. Changing group works. It's better than putting my user into the root group. Is there some means by which changing the group from root would cause things to break?

The write access seems required for solaar to do its thing, and the breakage of side-scroll doesn't happen until I start solaar. Since I've saved most things to my mouse's hardware profile, I've been using it without solaar for a while. Side-scroll (toggling the scroll wheel to the left or right) still works. Then,

xev
...
ButtonPress event, serial 44, synthetic NO, window 0x2e00001,
    root 0x4ab, subw 0x0, time 253094910, (56,5), root:(2437,1232),
    state 0x10, button 7, same_screen YES

ButtonRelease event, serial 44, synthetic NO, window 0x2e00001,
    root 0x4ab, subw 0x0, time 253094910, (56,5), root:(2437,1232),
    state 0x10, button 7, same_screen YES

ButtonPress event, serial 44, synthetic NO, window 0x2e00001,
    root 0x4ab, subw 0x0, time 253096353, (56,6), root:(2437,1233),
    state 0x10, button 6, same_screen YES

ButtonRelease event, serial 44, synthetic NO, window 0x2e00001,
    root 0x4ab, subw 0x0, time 253096353, (56,6), root:(2437,1233),
    state 0x10, button 6, same_screen YES

It shows the expected buttons 6 and 7, whereas after I start solaar (per description up top), the side-scroll comes out as buttons 14 and 15 -- same as in the linked issue #86.

What I haven't been able to save to the hardware profile: when the mouse is idle for a minute or so, it turns the LEDs back on. Solaar nixes that immediately and all's well.

@DrkShadow
Copy link
Author

Addendum, the above xev is with the group changed,

$ ls -l /dev/hid*
crw-rw---- 1 root mouse 243, 0 Oct  5 23:34 /dev/hidraw0
crw-rw---- 1 root mouse 243, 1 Oct  5 23:34 /dev/hidraw1
crw-rw---- 1 root mouse 243, 2 Oct  5 23:34 /dev/hidraw2
crw-rw---- 1 root mouse 243, 3 Oct  7 22:31 /dev/hidraw3
crw-rw---- 1 root mouse 243, 4 Oct  7 22:31 /dev/hidraw4
crw------- 1 root root  243, 5 Oct  7 23:10 /dev/hidraw5
crw------- 1 root root  243, 6 Oct  7 23:10 /dev/hidraw6

$ groups
wheel audiot cdrom... mouse

so it would have to be something with solaar seeing a non-root group and remapping buttons somehow.

solaar version 1.1.13

Lightspeed Receiver
  Device path  : /dev/hidraw2
  USB id       : 046d:C539
  Serial       : 29189FD2
  C Pending    : ff
    Firmware   : 39.06.B0040
    Bootloader : 02.09
    Other      : AA.BE
  Has 1 paired device(s) out of a maximum of 1.
  Notifications: (none)
  Device activity counters: (empty)

  1: G502 Gaming Mouse
     Device path  : None
     WPID         : 407F
     Codename     : G502
     Kind         : mouse
     Protocol     : HID++ 4.2
     Report Rate : 1ms
     Serial number: 3C045B04
     Model ID:      407FC08D0000
     Unit ID:       3C045B04
                 1: BOT 92.00.B0008
                 0: MPM 17.00.B0008
                 3: 
     The power switch is located on the base.
     Supports 30 HID++ 2.0 features:
         0: ROOT                   {0000} V0     
         1: FEATURE SET            {0001} V0     
         2: DEVICE FW VERSION      {0003} V2     
            Firmware: Bootloader BOT 92.00.B0008 AAEF21F1FA5F
            Firmware: Firmware MPM 17.00.B0008 407F21F1FA5F
            Firmware: Other   
            Unit ID: 3C045B04  Model ID: 407FC08D0000  Transport IDs: {'wpid': '407F', 'usbid': 'C08D'}
         3: DEVICE NAME            {0005} V0     
            Name: G502 LIGHTSPEED Wireless Gaming Mouse
            Kind: mouse
         4: WIRELESS DEVICE STATUS {1D4B} V0     
         5: CONFIG CHANGE          {0020} V0     
            Configuration: 00000000000000000000000000000000
         6: BATTERY VOLTAGE        {1001} V2     
            Battery: 40% 3787mV , discharging.
         7: COLOR LED EFFECTS      {8070} V4     
            LED Control (saved): Solaar
            LED Control        : Device
            LEDs Primary (saved): !LEDEffectSetting {ID: 0, color: 16711680, intensity: 0, period: 100, ramp: 0, speed: 0}
            LEDs Primary        : None
            LEDs Logo (saved): !LEDEffectSetting {ID: 0, color: 2142890, intensity: 0, period: 100, ramp: 0, speed: 0}
            LEDs Logo        : None
         8: LED CONTROL            {1300} V0     
         9: ONBOARD PROFILES       {8100} V0     
            Device Mode: On-Board
            Onboard Profiles (saved): Disabled
            Onboard Profiles        : Profile 1
        10: MOUSE BUTTON SPY       {8110} V0     
        11: REPORT RATE            {8060} V0     
            Report Rate: 1ms
            Report Rate (saved): 1ms
            Report Rate        : 1ms
        12: ADJUSTABLE DPI         {2201} V1     
            Sensitivity (DPI) (saved): 1300
            Sensitivity (DPI)        : 1300
        13: DEVICE RESET           {1802} V0    internal, hidden 
        14: unknown:1803           {1803} V0    internal, hidden 
        15: OOBSTATE               {1805} V0    internal, hidden 
        16: CONFIG DEVICE PROPS    {1806} V4    internal, hidden 
        17: unknown:1811           {1811} V0    internal, hidden 
        18: unknown:1830           {1830} V0    internal, hidden 
        19: unknown:1890           {1890} V4    internal, hidden 
        20: unknown:1891           {1891} V4    internal, hidden 
        21: unknown:18A1           {18A1} V0    internal, hidden 
        22: unknown:1801           {1801} V0    internal, hidden 
        23: unknown:18B1           {18B1} V0    internal, hidden 
        24: unknown:1DF3           {1DF3} V0    internal, hidden 
        25: unknown:1E00           {1E00} V0    hidden 
        26: unknown:1EB0           {1EB0} V0    internal, hidden 
        27: unknown:1863           {1863} V0    internal, hidden 
        28: unknown:1E22           {1E22} V0    internal, hidden 
        29: HIRES WHEEL            {2121} V0     
            Multiplier: 8
            Has invert: Normal wheel motion
            Has ratchet switch: Normal wheel mode
            Low resolution mode
            HID notification
            Scroll Wheel Direction (saved): False
            Scroll Wheel Direction        : False
            Scroll Wheel Resolution (saved): False
            Scroll Wheel Resolution        : False
            Scroll Wheel Diversion (saved): False
            Scroll Wheel Diversion        : False
     Battery: 40% 3787mV , discharging.


  0: G500s Gaming Mouse
     Device path  : /dev/hidraw4
     USB id       : 046d:C24E
     Codename     : G500s Gaming
     Kind         : mouse
     Protocol     : HID++ 1.0
     Serial number: 
     Battery status unavailable.

0: appears to be my wired logitech mouse, 1: is the wireless. Solaar has not been running, and a solaar show doesn't cause the mouse buttons to be remapped.

@pfps
Copy link
Collaborator

pfps commented Oct 9, 2024

As I have the same model mouse I tried changing various setting to see what happens. It turns out that disabling onboard profiles changes what side scroll produces. Onboard profiles do affect what the buttons produce, so it looks as if the default (no active profile) is for the two buttons to produce mouse buttons 14 and 15. It is not abnormal for mice to have a mapping that doesn't work well in Linux and this used to be fixed by using xmodmap.

The profiles on the mouse turn these buttons into left and right tilt. Either these produce what Linux expects for left and right shift or some Linux driver knows enough to translate these inputs into the appropriate mouse buttons.

Probably the best solution is to turn on onboard profiles (or change the setting to ignore). This probably does mean that you can't modify the DPI or report rate directly in Solaar and would have to dump, edit, and reload the profiles if you want to modify either.

@pfps pfps removed the bug label Oct 9, 2024
@pfps pfps changed the title Side-scroll breaks G502 side scroll buttons need onboard profiles to work correctly in Linux Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants