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

Linux input driver interacts badly with scroll wheel resolution #2404

Closed
tau-dev opened this issue Mar 18, 2024 · 10 comments
Closed

Linux input driver interacts badly with scroll wheel resolution #2404

tau-dev opened this issue Mar 18, 2024 · 10 comments

Comments

@tau-dev
Copy link

tau-dev commented Mar 18, 2024

Information
uname -srmo: Linux 6.7.9-arch1-1 x86_64 GNU/Linux

solaar show:

solaar version 1.1.11


MX Master 3 Wireless Mouse
     Device path  : /dev/hidraw2
     USB id       : 046d:B023
     Codename     : MX Master 3
     Kind         : mouse
     Protocol     : HID++ 4.5
     Serial number: 
     Model ID:      B02340820000
     Unit ID:       C71C9C9A
        Bootloader: BOT 95.01.B0015
          Firmware: MPM 19.01.B0015
             Other: 
     Supports 31 HID++ 2.0 features:
         0: ROOT                   {0000} V0     
         1: FEATURE SET            {0001} V0     
         2: DEVICE FW VERSION      {0003} V3     
            Firmware: Bootloader BOT 95.01.B0015 00006A9CA89D
            Firmware: Firmware MPM 19.01.B0015 B0236A9CA89D
            Firmware: Other   
            Unit ID: C71C9C9A  Model ID: B02340820000  Transport IDs: {'btleid': 'B023', 'wpid': '4082'}
         3: DEVICE NAME            {0005} V0     
            Name: Wireless Mouse MX Master 3
            Kind: mouse
         4: WIRELESS DEVICE STATUS {1D4B} V0     
         5: CONFIG CHANGE          {0020} V0     
         6: CRYPTO ID              {0021} V1     
         7: DEVICE FRIENDLY NAME   {0007} V0     
            Friendly Name: MX Master 3
         8: BATTERY STATUS         {1000} V1     
            Battery: 100%, discharging, next level 50%.
         9: REPROG CONTROLS V4     {1B04} V4     
            Key/Button Actions (saved): {Left Button:Left Click, Right Button:Right Click, Middle Button:Mouse Middle Button, Back Button:Mouse Back Button, Forward Button:Mouse Forward Button, Mouse Gesture Button:Gesture Button Navigation, Smart Shift:Smart Shift}
            Key/Button Actions        : {Left Button:Left Click, Right Button:Right Click, Middle Button:Mouse Middle Button, Back Button:Mouse Back Button, Forward Button:Mouse Forward Button, Mouse Gesture Button:Gesture Button Navigation, Smart Shift:Smart Shift}
            Key/Button Diversion (saved): {Middle Button:Regular, Back Button:Regular, Forward Button:Regular, Mouse Gesture Button:Regular, Smart Shift:Regular}
            Key/Button Diversion        : {Middle Button:Regular, Back Button:Regular, Forward Button:Regular, Mouse Gesture Button:Regular, Smart Shift:Regular}
        10: CHANGE HOST            {1814} V1     
            Change Host        : 2:legion5jonathan
        11: XY STATS               {2250} V1     
        12: ADJUSTABLE DPI         {2201} V1     
            Sensitivity (DPI) (saved): 1000
            Sensitivity (DPI)        : 1000
        13: SMART SHIFT            {2110} V0     
            Scroll Wheel Ratcheted (saved): Ratcheted
            Scroll Wheel Ratcheted        : Ratcheted
            Scroll Wheel Ratchet Speed (saved): 5
            Scroll Wheel Ratchet Speed        : 7
        14: HIRES WHEEL            {2121} V1     
            Multiplier: 15
            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): True
            Scroll Wheel Resolution        : False
            Scroll Wheel Diversion (saved): False
            Scroll Wheel Diversion        : False
        15: THUMB WHEEL            {2150} V0     
            Thumb Wheel Direction (saved): True
            Thumb Wheel Direction        : False
            Thumb Wheel Diversion (saved): False
            Thumb Wheel Diversion        : False
        16: WHEEL STATS            {2251} V0     
        17: DFUCONTROL SIGNED      {00C2} V0     
        18: DEVICE RESET           {1802} V0    internal, hidden 
        19: unknown:1803           {1803} V0    internal, hidden 
        20: CONFIG DEVICE PROPS    {1806} V6    internal, hidden 
        21: unknown:1813           {1813} V0    internal, hidden 
        22: OOBSTATE               {1805} V0    internal, hidden 
        23: unknown:1830           {1830} V0    internal, hidden 
        24: unknown:18A1           {18A1} V0    internal, hidden 
        25: unknown:1E00           {1E00} V0    hidden 
        26: unknown:1EB0           {1EB0} V0    internal, hidden 
        27: unknown:1861           {1861} V0    internal, hidden 
        28: unknown:9300           {9300} V0    internal, hidden 
        29: unknown:9001           {9001} V0    internal, hidden 
        30: unknown:9205           {9205} V0    internal, hidden 
     Has 8 reprogrammable keys:
         0: Left Button               , default: Left Click                  => Left Click                
             mse, analytics key events, pos:0, group:1, group mask:g1
             reporting: default
         1: Right Button              , default: Right Click                 => Right Click               
             mse, analytics key events, pos:0, group:1, group mask:g1
             reporting: default
         2: Middle Button             , default: Mouse Middle Button         => Mouse Middle Button       
             mse, reprogrammable, divertable, raw XY, analytics key events, pos:0, group:3, group mask:g1,g2,g3
             reporting: default
         3: Back Button               , default: Mouse Back Button           => Mouse Back Button         
             mse, reprogrammable, divertable, raw XY, analytics key events, pos:0, group:2, group mask:g1,g2
             reporting: default
         4: Forward Button            , default: Mouse Forward Button        => Mouse Forward Button      
             mse, reprogrammable, divertable, raw XY, analytics key events, pos:0, group:2, group mask:g1,g2
             reporting: default
         5: Mouse Gesture Button      , default: Gesture Button Navigation   => Gesture Button Navigation 
             mse, reprogrammable, divertable, raw XY, analytics key events, pos:0, group:3, group mask:g1,g2,g3
             reporting: default
         6: Smart Shift               , default: Smart Shift                 => Smart Shift               
             mse, reprogrammable, divertable, raw XY, analytics key events, pos:0, group:3, group mask:g1,g2,g3
             reporting: default
         7: Virtual Gesture Button    , default: Virtual Gesture Button      => Virtual Gesture Button    
             divertable, virtual, raw XY, force raw XY, pos:0, group:4, group mask:empty
             reporting: default
     Battery: 100%, discharging, next level 50%.

cat ~/.config/solaar/config.yaml:

- 1.1.11
- _NAME: MX Master 3 Wireless Mouse
  _absent: [hi-res-scroll, lowres-scroll-mode, onboard_profiles, report_rate, report_rate_extended, pointer_speed, speed-change, backlight, backlight_level,
    backlight_duration_hands_out, backlight_duration_hands_in, backlight_duration_powered, backlight-timed, led_control, led_zone_, fn-swap, persistent-remappable-keys,
    disable-keyboard-keys, crown-smooth, divert-crown, divert-gkeys, m-key-leds, mr-key-led, multiplatform, gesture2-gestures, gesture2-divert, gesture2-params,
    sidetone, equalizer, adc_power_management]
  _battery: 0x1000
  _modelId: B02340820000
  _sensitive: {dpi: ignore, hires-smooth-invert: false, hires-smooth-resolution: true, scroll-ratchet: false, smart-shift: false, thumb-scroll-invert: true}
  _serial: C71C9C9A
  _unitId: C71C9C9A
  _wpid: B02340820000
  change-host: null
  divert-keys: {0x52: 0x0, 0x53: 0x0, 0x56: 0x0, 0xc3: 0x0, 0xc4: 0x0}
  dpi: 0x3e8
  hires-scroll-mode: false
  hires-smooth-invert: false
  hires-smooth-resolution: true
  reprogrammable-keys: {0x50: 0x50, 0x51: 0x51, 0x52: 0x52, 0x53: 0x53, 0x56: 0x56, 0xc3: 0xc3, 0xc4: 0xc4}
  scroll-ratchet: 0x2
  smart-shift: 0x5
  thumb-scroll-invert: true
  thumb-scroll-mode: false
- _NAME: Wireless Keyboard ERGO K860
  _absent: [hi-res-scroll, lowres-scroll-mode, hires-smooth-invert, hires-smooth-resolution, hires-scroll-mode, scroll-ratchet, smart-shift, thumb-scroll-invert,
    thumb-scroll-mode, onboard_profiles, report_rate, report_rate_extended, pointer_speed, dpi, speed-change, backlight, backlight_level, backlight_duration_hands_out,
    backlight_duration_hands_in, backlight_duration_powered, backlight-timed, led_control, led_zone_, reprogrammable-keys, crown-smooth, divert-crown, divert-gkeys,
    m-key-leds, mr-key-led, gesture2-gestures, gesture2-divert, gesture2-params, sidetone, equalizer, adc_power_management]
  _battery: 0x1000
  _modelId: B35940880000
  _sensitive: {hires-scroll-mode: ignore, hires-smooth-invert: ignore, hires-smooth-resolution: ignore}
  _unitId: 4C2EE0F9
  change-host: null
  disable-keyboard-keys: {0x1: false, 0x2: false, 0x4: false, 0x8: false, 0x10: false}
  divert-keys: {0xa: 0x0, 0x6e: 0x0, 0x6f: 0x0, 0xbf: 0x0, 0xc7: 0x0, 0xc8: 0x0, 0xd1: 0x0, 0xd2: 0x0, 0xd3: 0x0, 0xd4: 0x0, 0xe0: 0x0, 0xe4: 0x0, 0xe5: 0x0,
    0xe6: 0x0, 0xe7: 0x0, 0xe8: 0x0, 0xe9: 0x0, 0xea: 0x0, 0xeb: 0x0, 0xec: 0x0, 0x100: 0x0, 0x101: 0x0}
  fn-swap: false
  multiplatform: 0x0
  persistent-remappable-keys: null

Errors or warrnings from Solaar: -

Describe the bug
After switching the mouse off and on again, or after any short period of inactivity (during which the device presumably enters a standby mode), the Scroll Wheel Resolution setting on the device becomes False even when configured to True in Solaar, resulting in erratically slow scrolling. Regular scroll speed is only restored after opening Solaar and manually toggling the setting off and on again. This, in turn, resets hires-scroll-mode to false in the ~/.config/solaar/config.yaml even when it was manually set to true before (I don't know which of these is cause or effect).

The issue has occurred spuriously before, but has become permanent since upgrading my KDE Plasma desktop to version 6.

@tau-dev tau-dev added the bug label Mar 18, 2024
@pfps pfps changed the title Scroll wheel resolution on MX Master 3 regularly resets to False Linux input driver interacts badly with scroll wheel resolution Mar 18, 2024
@pfps
Copy link
Collaborator

pfps commented Mar 18, 2024

This is a known problem, described in https://pwr-solaar.github.io/Solaar/index. The problem is timing dependent so does not occur always and the frequency can depend on the kernel and hardware in use, among other factors.

From https://pwr-solaar.github.io/Solaar/index:

The Linux HID++ driver modifies the Scroll Wheel Resolution setting to implement smooth scrolling. If Solaar later changes this setting, scrolling can be either very fast or very slow. To fix this problem click on the icon at the right edge of the setting to set it to “Ignore this setting”, which is the default for new devices. The mouse has to be reset (e.g., by turning it off and on again) before this fix will take effect.

@pfps pfps removed the bug label Mar 18, 2024
@tau-dev
Copy link
Author

tau-dev commented Mar 18, 2024

I assumed I had a different problem because the workaround mentioned there (enabling Ignore this setting) did not work for me. Is there really no way to fix this? If it is an upstream issue, any leads on where to go about that?

@pfps
Copy link
Collaborator

pfps commented Mar 18, 2024

That depends on what you want. The Linux input system has a large number of bells and whistles, and may include a way of adjusting how fast scrolling happens. But implementing smooth scrolling in the driver takes away the ability of Solaar to switch scrolling from regular speed to about 8 times regular speed by setting the scroll wheel resolution flag. If you want that ability back you have to use a driver that doesn't implement smooth scrolling for you device.

When you set scroll wheel resolution to ignore, Solaar leaves the setting alone, resulting in standard speed scrolling whether or not smooth scrolling is implemented in the driver for your device. Only if something else is happening can there be involvement by Solaar.

(There is a pathological case if you reverse the direction of scrolling or even divert scrolling, because the driver stomps on all three of the scroll wheel settings without regards for what their value is set to. The pathological case occurs if Solaar reads the settings, then the driver changes them, and then Solaar changes, for example, the scroll direction, also setting the resolution to the value that Solaar read. So it is safest to have all three settings on ignore.)

@tau-dev
Copy link
Author

tau-dev commented Mar 18, 2024

When you set scroll wheel resolution to ignore, Solaar leaves the setting alone, resulting in standard speed scrolling whether or not smooth scrolling is implemented in the driver for your device. Only if something else is happening can there be involvement by Solaar.

Just to be clear: I would like the involvement by Solaar to happen (to activate the hires-scroll-mode), but it does not work reliably anymore. If that's not possible to fix, is there another way to configure this at the driver level?

@pfps
Copy link
Collaborator

pfps commented Mar 18, 2024

As far as I know there is no way to control the driver except by reverting to an older version.

If you think scrolling is too slow then you need to look around for some way to multiply scrolling speed. This may be somewhere in the Linux input stack, in your window system, in your window manager, or post-stack input processing. But maybe there is no component that has this tweak.

You may have to add some input processing. Maybe https://www.baeldung.com/linux/mouse-scroll-speed will do the trick.

@Sondeluz
Copy link

Sondeluz commented Mar 18, 2024

Just chiming in - but I was looking for recent reports about this issue, and this also happens to me with and without Solaar or logiops. I would rather attribute this to some change that Plasma 6 recently did, because this started happening also after upgrading to Plasma 6.

Edit: Bug report opened on https://bugs.kde.org/show_bug.cgi?id=483944

@pfps
Copy link
Collaborator

pfps commented Mar 18, 2024

The driver has been updated several times over the last few years, generally to include more devices with smooth scrolling, so it is entirely possible that an update has changed the scrolling behaviour. As well, any change can affect timing, which can also affect behaviour.

@tau-dev
Copy link
Author

tau-dev commented Mar 19, 2024

some way to multiply scrolling speed

The problem with my MX Master is that without hi-res scrolling, the scroll events happen only about twice per wheel revolution, which is very awkward; any way I know of to modify scroll speed only changes how many lines those events move by, which doesn't help much. On Sondeluz' hint, I'm gonna look into the Plasma side of things for now. Thank you very much for your patience!

@pfps
Copy link
Collaborator

pfps commented Mar 19, 2024

Does this happen even when Solaar is not running and you have turned your mouse off and on? If so, Solaar is not involved and you should probably report the problem. (First, though, check in a clean slate - uninstall Solaar, reboot, and then try scrolling.)

@tau-dev
Copy link
Author

tau-dev commented Mar 22, 2024

Sondeluz reported having this problem without Solaar, so yes, that is probably not really involved.

@tau-dev tau-dev closed this as completed Mar 22, 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

3 participants