pwr-Solaar / Solaar

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

MX Anywhere 3 Mouse Wheel Resolution via Receiver vs Bluetooth #2025

Closed herbertp closed 1 year ago

herbertp commented 1 year ago

Information

``` solaar version 1.1.8 Unifying Receiver Device path : /dev/hidraw4 USB id : 046d:C52B Serial : ECC49D79 Firmware : 12.03.B0025 Bootloader : 02.15 Other : AA.AA Has 4 paired device(s) out of a maximum of 6. Notifications: wireless, software present (0x000900) Device activity counters: 2=147 1: Wireless Keyboard K270 (unifying) Device path : /dev/hidraw5 WPID : 4003 Codename : (unifying) Kind : keyboard Protocol : HID++ 2.0 Polling rate : 20 ms (50Hz) Serial number: E30328A2 The power switch is located on the top case. Battery: unknown (device is offline). 2: MX Anywhere 3 Device path : /dev/hidraw6 WPID : 4090 Codename : MX Anywhere 3 Kind : mouse Protocol : unknown (device is offline) Polling rate : 8 ms (125Hz) Serial number: 581ECA57 The power switch is located on the base. Battery: unknown (device is offline). 3: MX Anywhere 2 Device path : /dev/hidraw7 WPID : 4063 Codename : MX Anywhere 2 Kind : mouse Protocol : unknown (device is offline) Polling rate : 8 ms (125Hz) Serial number: C053876D The power switch is located on the base. Battery: unknown (device is offline). 4: Anywhere Mouse MX 2 Device path : /dev/hidraw11 WPID : 404A Codename : Anywhere MX 2 Kind : mouse Protocol : HID++ 4.5 Polling rate : 8 ms (125Hz) Serial number: 639BBEF4 The power switch is located on the base. Battery: unknown (device is offline). USB and Bluetooth Devices 1: MX Anywhere 3 Device path : /dev/hidraw3 USB id : 046d:B025 Codename : MX Anywhere 3 Kind : mouse Protocol : HID++ 4.5 Serial number: Model ID: B02540900000 Unit ID: 581ECA57 Bootloader: BL1 13.00.B0014 Firmware: MPM 24.00.B0014 Other: Supports 30 HID++ 2.0 features: 0: ROOT {0000} V0 1: FEATURE SET {0001} V0 2: DEVICE FW VERSION {0003} V4 Firmware: Bootloader BL1 13.00.B0014 000095D7D19A Firmware: Firmware MPM 24.00.B0014 B02595D7D19A Firmware: Other Unit ID: 581ECA57 Model ID: B02540900000 Transport IDs: {'btleid': 'B025', 'wpid': '4090'} 3: DEVICE NAME {0005} V0 Name: MX Anywhere 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 Anywhere 3 8: UNIFIED BATTERY {1004} V0 Battery: 95%, discharging. 9: REPROG CONTROLS V4 {1B04} V5 Key/Button Actions (saved): {Left Button:Left Click, Right Button:Right Click, Middle Button:Smart Shift, Back Button:Mouse Back Button, Forward Button:Mouse Forward Button, Smart Shift:Mouse Middle Button} Key/Button Actions : {Left Button:Left Click, Right Button:Right Click, Middle Button:Smart Shift, Back Button:Mouse Back Button, Forward Button:Mouse Forward Button, Smart Shift:Mouse Middle Button} Key/Button Diversion (saved): {Middle Button:Diverted, Back Button:Regular, Forward Button:Regular, Smart Shift:Regular} Key/Button Diversion : {Middle Button:Diverted, Back Button:Regular, Forward Button:Regular, Smart Shift:Regular} 10: CHANGE HOST {1814} V1 Change Host : 3:localhost 11: XY STATS {2250} V1 12: ADJUSTABLE DPI {2201} V1 Sensitivity (DPI) (saved): 1600 Sensitivity (DPI) : 1600 13: SMART SHIFT ENHANCED {2111} V0 Scroll Wheel Ratchet Speed (saved): 1 Scroll Wheel Ratchet Speed : 1 14: 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 15: WHEEL STATS {2251} V0 16: DFUCONTROL SIGNED {00C2} V0 17: DEVICE RESET {1802} V0 internal, hidden 18: unknown:1803 {1803} V0 internal, hidden 19: CONFIG DEVICE PROPS {1806} V7 internal, hidden 20: unknown:1812 {1812} V0 internal, hidden 21: OOBSTATE {1805} V0 internal, hidden 22: unknown:1830 {1830} V0 internal, hidden 23: unknown:18A1 {18A1} V0 internal, hidden 24: unknown:1E00 {1E00} V0 hidden 25: unknown:1EB0 {1EB0} V0 internal, hidden 26: unknown:1861 {1861} V0 internal, hidden 27: unknown:9300 {9300} V1 internal, hidden 28: unknown:9001 {9001} V0 internal, hidden 29: unknown:9205 {9205} V0 internal, hidden Has 7 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 => Smart Shift mse, reprogrammable, divertable, raw XY, analytics key events, pos:0, group:2, group mask:g1,g2 reporting: diverted 3: Back Button , default: Mouse Back Button => Mouse Back Button mse, reprogrammable, divertable, raw XY, analytics key events, unknown:000800, 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, unknown:000800, pos:0, group:2, group mask:g1,g2 reporting: default 5: Smart Shift , default: Smart Shift => Mouse Middle Button mse, reprogrammable, divertable, raw XY, analytics key events, pos:0, group:2, group mask:g1,g2 reporting: default 6: 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: 95%, discharging. ```
``` - 1.1.8 - _NAME: MX Anywhere 3 _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-gestures, gesture2-divert, gesture2-params, sidetone, equalizer, scroll-ratchet] _battery: 4100 _dpi-sliding: 10 _modelId: B02540900000 _sensitive: {change-host: false, divert-keys: false, dpi: false, dpi-sliding: true, hires-scroll-mode: false, hires-smooth-invert: false, hires-smooth-resolution: true, mouse-gestures: true, reprogrammable-keys: false, smart-shift: false} _serial: 581ECA57 _unitId: 581ECA57 _wpid: '4090' change-host: null divert-keys: {82: 1, 83: 0, 86: 0, 196: 0} dpi: 1600 hires-scroll-mode: false hires-smooth-invert: false hires-smooth-resolution: false reprogrammable-keys: {80: 80, 81: 81, 82: 196, 83: 83, 86: 86, 196: 82} smart-shift: 1 - _NAME: Wireless Keyboard K270 (unifying) _absent: [hi-res-scroll, lowres-scroll-mode, hires-smooth-invert, hires-smooth-resolution, hires-scroll-mode, smart-shift, thumb-scroll-mode, thumb-scroll-invert, onboard_profiles, report_rate, pointer_speed, dpi, dpi-sliding, speed-change, mouse-gestures, backlight, backlight-timed, fn-swap, reprogrammable-keys, persistent-remappable-keys, divert-keys, disable-keyboard-keys, divert-crown, crown-smooth, divert-gkeys, m-key-leds, mr-key-led, multiplatform, change-host, gesture2-gestures, gesture2-divert, gesture2-params, sidetone, equalizer, scroll-ratchet] _battery: 4096 _modelId: '000000000000' _serial: E30328A2 _unitId: '00000000' _wpid: '4003' - {_NAME: Wireless Mouse M310, _serial: 66B81DA1, _wpid: '1024'} - _NAME: Wireless Mobile Mouse MX Anywhere 2S _absent: [hi-res-scroll, lowres-scroll-mode, smart-shift, 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-gestures, gesture2-divert, gesture2-params] _modelId: B01A406A0000 _serial: E765C3F3 _unitId: FC4FF096 _wpid: 406A divert-keys: {82: 0, 83: 0, 86: 0, 91: 0, 93: 0} dpi: 1000 hires-scroll-mode: false hires-smooth-invert: false hires-smooth-resolution: true reprogrammable-keys: {80: 80, 81: 81, 82: 82, 83: 83, 86: 86, 91: 91, 93: 93} - _NAME: Wireless Mobile Mouse MX Anywhere 2 _absent: [hi-res-scroll, lowres-scroll-mode, smart-shift, thumb-scroll-invert, thumb-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, scroll-ratchet] _battery: 4096 _modelId: B01840630000 _sensitive: {dpi: false, hires-smooth-resolution: false} _serial: C053876D _unitId: 768A587E _wpid: '4063' change-host: null divert-keys: {82: 0, 83: 0, 86: 0, 91: 0, 93: 0} dpi: 1600 hires-scroll-mode: false hires-smooth-invert: false hires-smooth-resolution: true reprogrammable-keys: {80: 80, 81: 81, 82: 82, 83: 83, 86: 86, 91: 91, 93: 93} ```

Describe the bug The MX Anywhere 3 can be operated via the Logitech receiver as well as without using Bluetooth. My MX Anywhere 3 is configured to use the receiver on connection '1' and Bluetooth on connection 3 so that I can easily switch between them. When the mouse is working via the receiver, the Mouse Wheel Resolution needs to be set to High to make scrolling useful (otherwise too slow) but when connected via Bluetooth, the same setting needs to be set to Off to get comparable scrolling (otherwise it is too fast). This works perfectly fine as long as soolar is running, but needs to be configured every time solaar is (re-)started (I assume this is because solaar sees the same Unit ID and does not differentiate between RF receiver and Bluetooth)

To Reproduce Steps to reproduce the behavior:

  1. Connect the MX Anywhere 3 via RF Receiver
  2. Switch the mouse to a different connection and pair via Bluetooth
  3. Configure different settings (Scroll Wheel Resolution) for the Receiver and Bluetooth version of the same mouse.
  4. Switch between Receiver and Bluetooth mode to test that they work as intended.
  5. Shut down and restart solaar
  6. Verify again for both modes

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Note: the assumption here is that different settings for the same mouse connected via Receiver or Bluetooth should be possible with solaar as they are visualized as 'different leaves' in the device tree.

pfps commented 1 year ago

What you appear to want is some way to determine whether a device is connected via a receiver or via bluetooth. A potential reason to do this is that the Linux HID++ mouse driver sets the mouse to high-resolution scrolling when connected via the receiver but not when connected via bluetooth. This is not a Solaar problem but is instead a problem with the driver or a problem caused by both Solaar and the driver trying to control the mouse wheel resolution.

The best thing to do is to set the HIRES WHEEL setting to ignore so that the driver controls the wheel resolution. It may be that the mouse will still misbehave because the wheel resolution is not correctly set when it is switched between the receiver and bluetooth but that is definitely a driver issue.

Solaar does not currently have any means to differentiate between the mouse connected to a receiver and the mouse connected via bluetooth.

herbertp commented 1 year ago

I kindly disagree here, I think it has (means) and it does (differentiate between the mouse connected via receiver or bluetooth) as can be seen in the following screenshots ...

mx3_bluetooth mx3_receiver

... note that both entries refer to the same mouse as can be seen by the Unit ID. This 'differentiation' works as long as solaar is running.

pfps commented 1 year ago

Solaar keeps information about every device it has seen in ~/.config/solaar/config.yaml Devices are identified by one of two combinations of their attributes because not all devices have the same collection of attributes and not all the attributes are available all the time. The idea is that Solaar should be able to identify each physical device it has seen based on attributes of the device that are supposed to be unique to it. (Some low-end devices can only be identified by model so this is no always possible.) Unfortunately, some devices do not follow the available documentation. (For example, there are two ways of obtaining a serial number for a device. Devices that provide both ways are supposed to return the same number but there are a few that don't. Solaar tries to perform correctly for these devices.)

Your config.yaml file has only one entry for an MX Anywhere 3, so Solaar is only remembering one set of settings for it. It may be that there is a bug in Solaar that creates two internal copies of these settings and allows you to change one. If you think this might be the case, please let me know.

pfps commented 1 year ago

By the way, because scroll wheel resolution is also set by the Linux HID++ driver, it is now recommended that this setting be set to ignore. From https://github.com/pwr-Solaar/Solaar

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.

herbertp commented 1 year ago

Thanks for the 'repeated' hint regarding Scroll Wheel Resolution (and setting it to ignore), this seems to solve the issue for me, as now the scroll wheel works fine for both connections. Appreciated!

And yes, I got the impression, that solaar keeps two internal versions depending on how the device is connected but only saves one of them to the config.

In an ideal world, solaar would know the channel choice of the device (1, 2 or 3) and keep separate settings based on this information, which would also allow to create different setups and easily switch between them just by pressing the button on the mouse. But I do not think this information is easily available and thus identifying the mouse by Unit ID (only) is probably the best option for now.

Thanks for the quick feedback, Herbert

pfps commented 1 year ago

What Solaar does is have two representations of the device that share a single structure that stores the saved settings. When a setting is changed on one of the devices this change is push to the saved settings, which then is saved to the configuration file. This only matters for devices that have been connected via both a receiver and some other method where the receiver-connected device representation persists when the device is disconnected from the receiver.

I don't think that it is worth modifying this behaviour.