pwr-Solaar / Solaar

Linux device manager for Logitech devices
https://pwr-solaar.github.io/Solaar
GNU General Public License v2.0
5.39k stars 401 forks source link

Scroll wheel resolution with MX Master 3s - very fast scrolling #1801

Closed paolomainardi closed 1 year ago

paolomainardi commented 1 year ago

Information

Solaar version 1.1.5 Bolt Receiver Device path : /dev/hidraw6 USB id : 046d:C548 Serial : 41434345323844383136343844383835 Has 1 paired device(s) out of a maximum of 6. Notifications: wireless, software present (0x000900) Device activity counters: 1=67 1: MX Master 3S Device path : None WPID : B034 Codename : MX Master 3S Kind : mouse Protocol : HID++ 4.5 Serial number: B341B1BB Model ID: B03400000000 Unit ID: B341B1BB Bootloader: BL1 69.00.B0003 Firmware: RBM 22.00.B0003 Other: The power switch is located on the (unknown). Supports 35 HID++ 2.0 features: 0: ROOT {0000} V0 1: FEATURE SET {0001} V0 2: DEVICE FW VERSION {0003} V4 Firmware: Bootloader BL1 69.00.B0003 B03438FCA4E6 Firmware: Firmware RBM 22.00.B0003 B03438FCA4E6 Firmware: Other Unit ID: B341B1BB Model ID: B03400000000 Transport IDs: {'btleid': 'B034'} 3: DEVICE NAME {0005} V0 Name: MX Master 3S Kind: mouse 4: WIRELESS DEVICE STATUS {1D4B} V0 5: RESET {0020} V0 6: CRYPTO ID {0021} V1 7: DEVICE FRIENDLY NAME {0007} V0 Friendly Name: MX Master 3S 8: UNIFIED BATTERY {1004} V3 Battery: 60%, discharging. 9: REPROG CONTROLS V4 {1B04} V5 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 : 1:paolo-cto-arch 11: HOSTS INFO {1815} V2 Host 0 (paired): paolo-cto-arch Host 1 (unpaired): Host 2 (unpaired): 12: XY STATS {2250} V1 13: ADJUSTABLE DPI {2201} V2 Sensitivity (DPI) (saved): 1500 Sensitivity (DPI) : 1500 14: SMART SHIFT {2110} V0 Scroll Wheel Rachet (saved): 8 Scroll Wheel Rachet : 0 15: HIRES WHEEL {2121} V1 Multiplier: 15 Has invert: Normal wheel motion Has ratchet switch: Free 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 16: THUMB WHEEL {2150} V0 Thumb Wheel Direction (saved): True Thumb Wheel Direction : True Thumb Wheel Diversion (saved): True Thumb Wheel Diversion : True 17: WHEEL STATS {2251} V0 18: DFUCONTROL {00C3} V0 19: DEVICE RESET {1802} V0 internal, hidden, unknown:000010 20: unknown:1803 {1803} V0 internal, hidden, unknown:000010 21: CONFIG DEVICE PROPS {1806} V8 internal, hidden, unknown:000010 22: unknown:1816 {1816} V0 internal, hidden, unknown:000010 23: OOBSTATE {1805} V0 internal, hidden 24: unknown:1830 {1830} V0 internal, hidden, unknown:000010 25: unknown:1891 {1891} V7 internal, hidden, unknown:000008 26: unknown:18A1 {18A1} V0 internal, hidden, unknown:000010 27: unknown:1E00 {1E00} V0 hidden 28: unknown:1E02 {1E02} V0 internal, hidden 29: unknown:1602 {1602} V0 30: unknown:1EB0 {1EB0} V0 internal, hidden, unknown:000010 31: unknown:1861 {1861} V1 internal, hidden, unknown:000010 32: unknown:9300 {9300} V0 internal, hidden, unknown:000010 33: unknown:9001 {9001} V0 internal, hidden, unknown:000010 34: unknown:1E22 {1E22} V0 internal, hidden, unknown:000010 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:2, group mask:g1,g2 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:2, group mask:g1,g2 reporting: default 6: Smart Shift , default: Smart Shift => Smart Shift mse, reprogrammable, divertable, raw XY, analytics key events, pos:0, group:2, group mask:g1,g2 reporting: default 7: Virtual Gesture Button , default: Virtual Gesture Button => Virtual Gesture Button divertable, virtual, raw XY, force raw XY, pos:0, group:3, group mask:empty reporting: default Battery: 60%, discharging.
- 1.1.5 - _NAME: Wireless Mouse MX Master 2S _absent: [hi-res-scroll, lowres-smooth-scroll, thumb-scroll-mode, thumb-scroll-invert, onboard_profiles, report_rate, pointer_speed, speed-change, backlight, backlight-timed, fn-swap, persistent-remappable-keys, disable-keyboard-keys, divert-crown, crown-smooth, divert-gkeys, m-key-leds, mr-key-led, multiplatform, gesture2-params, smart-shift, lowres-scroll-mode, sidetone, equalizer] _modelId: B01940690000 _sensitive: {dpi: false, gesture2-divert: false, gesture2-gestures: true, hires-smooth-invert: false, hires-smooth-resolution: false, mouse-gestures: false} _serial: A80EC00C _unitId: B0D51471 _wpid: '4069' change-host: null divert-keys: {82: 0, 83: 0, 86: 0, 195: 2, 196: 0} dpi: 1000 dpi-sliding: 0 gesture2-divert: {46: false} gesture2-gestures: {45: false, 46: true} hires-scroll-mode: false hires-smooth-invert: false hires-smooth-resolution: true reprogrammable-keys: {80: 80, 81: 81, 82: 82, 83: 83, 86: 86, 195: 195, 196: 196} smart-shift: 16 - _NAME: MX Anywhere 3 _modelId: B02540900000 _serial: 3EB10C19 _unitId: 3EB10C19 _wpid: '4090' divert-keys: {82: 0, 83: 0, 86: 0, 196: 0} dpi: 1000 dpi-sliding: 0 hires-smooth-invert: false hires-smooth-resolution: false mouse-gestures: 0 reprogrammable-keys: {80: 80, 81: 81, 82: 82, 83: 83, 86: 86, 196: 196} smart-shift: 0 - _NAME: Wireless Mouse MX Master 2S _absent: [hi-res-scroll, lowres-scroll-mode, thumb-scroll-mode, thumb-scroll-invert, onboard_profiles, report_rate, pointer_speed, speed-change, backlight, backlight-timed, fn-swap, persistent-remappable-keys, disable-keyboard-keys, divert-crown, crown-smooth, divert-gkeys, m-key-leds, mr-key-led, multiplatform, gesture2-params] _modelId: B01940690000 _serial: D6934110 _unitId: 862B3F8E _wpid: '4069' divert-keys: {82: 0, 83: 0, 86: 0, 195: 0, 196: 0} dpi: 1000 dpi-sliding: 0 gesture2-divert: {46: false} gesture2-gestures: {45: true, 46: true} hires-scroll-mode: false hires-smooth-invert: false hires-smooth-resolution: true mouse-gestures: 0 reprogrammable-keys: {80: 80, 81: 81, 82: 82, 83: 83, 86: 86, 195: 195, 196: 196} smart-shift: 16 - _NAME: MX Master 3S _absent: [hi-res-scroll, lowres-scroll-mode, onboard_profiles, report_rate, pointer_speed, speed-change, backlight, backlight-timed, 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] _battery: 4100 _modelId: B03400000000 _sensitive: {divert-keys: true, dpi: true, hires-scroll-mode: true, hires-smooth-invert: true, hires-smooth-resolution: true, reprogrammable-keys: true, smart-shift: true, thumb-scroll-invert: true, thumb-scroll-mode: true} _serial: B341B1BB _unitId: B341B1BB _wpid: B034 change-host: null divert-keys: {82: 0, 83: 0, 86: 0, 195: 0, 196: 0} dpi: 1500 dpi-sliding: 0 hires-scroll-mode: false hires-smooth-invert: false hires-smooth-resolution: true mouse-gestures: 0 reprogrammable-keys: {80: 80, 81: 81, 82: 82, 83: 83, 86: 86, 195: 195, 196: 196} smart-shift: 8 thumb-scroll-invert: true thumb-scroll-mode: true

Describe the bug

When i activate the "scroll wheel resolution" the mouse scrolling is out of control, instead of moving by pixel it jump to more than 15 lines, it seems that libinput is not respecting anymore the hi-res resolution, of course i am running it on Xorg.

paolomainardi commented 1 year ago

Just tested with the very same system an mx master 2s and it works smooth as expected, just to exclude problems with libinput and xf86 stack.

I am also watching here: https://rhtenhove.nl/blog/hires-scrolling-logitech/

But cannot reproduce the proposed fix.

pfps commented 1 year ago

From Known Issues in https://github.com/pwr-Solaar/Solaar

The Linux HID++ driver modifies the setting Scroll Wheel Resolution 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". The mouse has to be reset (e.g., by turning it off and on again) before this fix will take effect.

This happens before libinput.

paolomainardi commented 1 year ago

Thanks for the quick reply @pfps!

I tried this setting, it should be like this right?

image

Anyway ignoring this setting is like not having smooth scrolling, the scrolling behavior gets back to normal scrolling by 3-pixel when using the free spinning wheel. Just comparing to mx2s where enabling/disabling this setting enables real hires scrolling and it works like a charm.

Am I missing something here?

pfps commented 1 year ago

Different mice may behave differently but all that Solaar can do is to get out of the way - the processing is done by the input driver and other code.

paolomainardi commented 1 year ago

@pfps thanks for your quick replies! I just want to help here, if you can point me to the right direction i can start digging to understand the cause of this difference between mx master 2s and 3s.

What is described here: https://rhtenhove.nl/blog/hires-scrolling-logitech seems that can be related to:

MOUSE_WHEEL_CLICK_ANGLE
MOUSE_WHEEL_CLICK_COUNT
pfps commented 1 year ago

To figure out what is going on you have to see what the driver https://github.com/torvalds/linux/blob/master/drivers/hid/hid-logitech-hidpp.c is doing. The blog post is, I believe, an old way of enabling smooth scrolling.

paolomainardi commented 1 year ago

I cannot see here: https://github.com/torvalds/linux/blob/04bd68171e01843284accbcfaa4cd2c50d1707ed/drivers/hid/hid-logitech-hidpp.c#L3756 any reference to the MX Master 3s, maybe not yet supported.

pfps commented 1 year ago

That is probably the difference. I think there are proposed patches that would support the 3s.

paolomainardi commented 1 year ago

It seems that 6.1 will get rid of this logic: https://github.com/torvalds/linux/commit/908d325e1665b2781085580070554cbbe5fc3c89 in favour of something more generic that theoretically should accomodate also 3s.