Bug 2274393 - scrolling slow after wake from sleep with MX Master 3
Summary: scrolling slow after wake from sleep with MX Master 3
Keywords:
Status: CLOSED COMPLETED
Alias: None
Product: Fedora
Classification: Fedora
Component: libinput
Version: 40
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Peter Hutterer
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2024-04-10 19:37 UTC by nocar
Modified: 2024-05-13 12:34 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2024-05-13 12:34:05 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description nocar 2024-04-10 19:37:21 UTC
With the Logitech MX Master 3 mouse connected to my Framework 13 (11th gen intel) upon initial boot the scrolling works as expected, after closing the lid (sleeping) the laptop and then waking it by opening the lid, the scrolling becomes very slow, almost unusable. (I should note that the mouse in question is bluetooth only so I couldn't test wired) 

Rebooting the machine fixes the issue until next sleep/wake cycle.

Reproducible: Always

Steps to Reproduce:
1.laptop with MX master 3 connected via bluetooth
2.sleep laptop by closing lid
3.Wake laptop by opening lid
4.attempt to scroll on any webpage or program.
Actual Results:  
scrolling is very slow and almost unusable

Expected Results:  
scrolling should be at normal speed observed before sleep/wake cycle

Comment 1 Ian Wienand 2024-04-18 22:54:32 UTC
I am seeing something very similar.  As context I usually don't update my work laptop until something forces me to, and I remember my VM crashing so I decided to update and reboot all at the same time.  The mouse scrolling was working fine before that and not afterwards.

After that, it was like it was dropping scroll events, you'd scroll a lot and windows would barely move.

Looking at the logs of what updated, the things I feel might be related to this are

---
2024-04-16T16:20:12+1000 DEBUG ---> Package libinput.x86_64 1.25.0-1.fc39 will be upgraded
2024-04-16T16:20:12+1000 DEBUG ---> Package libinput.x86_64 1.25.0-4.fc39 will be an upgrade

2024-04-16T16:20:12+1000 DEBUG ---> Package mutter.x86_64 45.4-1.fc39 will be upgraded
2024-04-16T16:20:12+1000 DEBUG ---> Package mutter.x86_64 45.5-1.fc39 will be an upgrade

2024-04-16T16:20:12+1000 DEBUG ---> Package xorg-x11-server-Xorg.x86_64 1.20.14-30.fc39 will be upgraded
2024-04-16T16:20:12+1000 DEBUG ---> Package xorg-x11-server-Xorg.x86_64 1.20.14-35.fc39 will be an upgrade

Installing:
 ESC[1mESC[32mkernel                                       ESC(BESC[m x86_64    6.8.5-201.fc39                 updates                   159 k
---

Looking at times 

---
 -8 5d075bd4806a41a3a31b2eb7b128db59 Wed 2024-02-21 14:47:13 AEDT Tue 2024-04-16 16:41:57 AEST
 -7 4fe3eebd5b324ab68eba614eb94ccb68 Tue 2024-04-16 16:42:18 AEST Tue 2024-04-16 20:22:43 AEST
---

which means I must have jumped from Linux version 6.7.4-200.fc39.x86_64 on boot 5d075 to 6.8.5-201.fc39.x86_64 on 4fe3ee

There's a lot out there on this mouse and high resolution scroll events.  I initially tried the workaround mentioned in https://wiki.archlinux.org/title/Logitech_MX_Master to "-REL_WHEEL_HI_RES;-REL_HWEEEL_HI_RES" but this didn't help.

With F40 being close, I decided to upgrade at this point; however the problem persists.

What I have found is that using "solaar" and flipping "scroll wheel resolution" to "on" fixes this ... for a period?!  Then something seems to happen and it goes back to being slow again, I flip it again and it starts working!  This sounds incredible to me but is what happens :)

When I trace the events, when it is "slow" and I am just clicking the scroll wheel up and down one click I see

---
 - evdev:
    - [  0,      0,   2,  11,       8] # EV_REL / REL_WHEEL_HI_RES          8
    - [  0,      0,   0,   0,       0] # ------------ SYN_REPORT (0) ---------- +0ms
  - evdev:
    - [  0, 584963,   2,  11,      -8] # EV_REL / REL_WHEEL_HI_RES         -8
    - [  0, 584963,   0,   0,       0] # ------------ SYN_REPORT (0) ---------- +584ms
  - evdev:
    - [  1,  73024,   2,  11,       8] # EV_REL / REL_WHEEL_HI_RES          8
    - [  1,  73024,   0,   0,       0] # ------------ SYN_REPORT (0) ---------- +489ms
  - evdev:
    - [  1, 439972,   2,  11,      -8] # EV_REL / REL_WHEEL_HI_RES         -8
    - [  1, 439972,   0,   0,       0] # ------------ SYN_REPORT (0) ---------- +366ms
  - evdev:
    - [  1, 844999,   2,  11,       8] # EV_REL / REL_WHEEL_HI_RES          8
    - [  1, 844999,   0,   0,       0] # ------------ SYN_REPORT (0) ---------- +405ms
  - evdev:
    - [  2, 182985,   2,  11,      -8] # EV_REL / REL_WHEEL_HI_RES         -8
    - [  2, 182985,   0,   0,       0] # ------------ SYN_REPORT (0) ---------- +338ms
  - evdev:
    - [  2, 490045,   2,  11,       8] # EV_REL / REL_WHEEL_HI_RES          8
    - [  2, 490045,   0,   0,       0] # ------------ SYN_REPORT (0) ---------- +308ms
  - evdev:
    - [  2, 932977,   2,  11,      -8] # EV_REL / REL_WHEEL_HI_RES         -8
    - [  2, 932977,   0,   0,       0] # ------------ SYN_REPORT (0) ---------- +442ms
---

When it is back to being normal, however, after I have flipped that witch in solaar, I see something slightly different -- it seems there are EV_REL / REL_WHEEL events coming in too

---
  - evdev:
    - [  0,      0,   2,  11,      16] # EV_REL / REL_WHEEL_HI_RES         16
    - [  0,      0,   0,   0,       0] # ------------ SYN_REPORT (0) ---------- +0ms
  - evdev:
    - [  0,  82091,   2,  11,      24] # EV_REL / REL_WHEEL_HI_RES         24
    - [  0,  82091,   0,   0,       0] # ------------ SYN_REPORT (0) ---------- +82ms
  - evdev:
    - [  0, 106892,   2,  11,      16] # EV_REL / REL_WHEEL_HI_RES         16
    - [  0, 106892,   0,   0,       0] # ------------ SYN_REPORT (0) ---------- +24ms
  - evdev:
    - [  0, 119897,   2,  11,      32] # EV_REL / REL_WHEEL_HI_RES         32
    - [  0, 119897,   2,   8,       1] # EV_REL / REL_WHEEL                 1
    - [  0, 119897,   0,   0,       0] # ------------ SYN_REPORT (0) ---------- +13ms
  - evdev:
    - [  0, 126878,   2,  11,      24] # EV_REL / REL_WHEEL_HI_RES         24
    - [  0, 126878,   0,   0,       0] # ------------ SYN_REPORT (0) ---------- +7ms
  - evdev:
    - [  0, 186977,   2,  11,      16] # EV_REL / REL_WHEEL_HI_RES         16
    - [  0, 186977,   0,   0,       0] # ------------ SYN_REPORT (0) ---------- +60ms
  - evdev:
    - [  1, 334908,   2,  11,     -16] # EV_REL / REL_WHEEL_HI_RES        -16
    - [  1, 334908,   0,   0,       0] # ------------ SYN_REPORT (0) ---------- +1148ms
  - evdev:
    - [  1, 416991,   2,  11,     -16] # EV_REL / REL_WHEEL_HI_RES        -16
    - [  1, 416991,   0,   0,       0] # ------------ SYN_REPORT (0) ---------- +82ms
  - evdev:
    - [  1, 462900,   2,  11,     -24] # EV_REL / REL_WHEEL_HI_RES        -24
    - [  1, 462900,   0,   0,       0] # ------------ SYN_REPORT (0) ---------- +46ms
  - evdev:
    - [  1, 473836,   2,  11,     -16] # EV_REL / REL_WHEEL_HI_RES        -16
    - [  1, 473836,   2,   8,      -1] # EV_REL / REL_WHEEL                -1
    - [  1, 473836,   0,   0,       0] # ------------ SYN_REPORT (0) ---------- +11ms
  - evdev:
    - [  1, 491947,   2,  11,     -24] # EV_REL / REL_WHEEL_HI_RES        -24
    - [  1, 491947,   0,   0,       0] # ------------ SYN_REPORT (0) ---------- +18ms
  - evdev:
    - [  1, 506990,   2,  11,     -16] # EV_REL / REL_WHEEL_HI_RES        -16
    - [  1, 506990,   0,   0,       0] # ------------ SYN_REPORT (0) ---------- +15ms
---

From what I can tell, things scroll on a "REL_WHEEL" event

Knowing that, I can turn off "scroll wheel resolution" and watch the events, and REL_WHEEL events are *very* sparse when the mouse is in this mode.  You can scroll 20+ times and not see one.  Every time you get a REL_WHEEL_HI_RES event, but the REL_WHEEL events seem almost random.  I know this has something to do with angular divisions, I tried clicking and looking for a pattern like "12 clicks between REL_WHEEL events" but it doesn't seem to be so simple.

What is this solaar switch doing ... and why would it stop working basically randomly, then start when the switch is flipped again ...

Comment 2 Ian Wienand 2024-04-18 23:19:17 UTC
So, it seems "Scroll Wheel Resolution" does the following in solaar

---
 feature = _F.HIRES_WHEEL
 rw_options = {"read_fnid": 0x10, "write_fnid": 0x20}
 validator_options = {"true_value": 0x02, "mask": 0x02}
---

Where from the docs

---
`feature` is the HID++ 2.0 feature that is used to read the
 current state of the setting from a device and write it back to
 a device.

`rw_options` contains options used when reading or writing the
 state of the setting, here to use feature command 0x10 to read
 the value and feature command 0x20 to write the value.

`validator_options` contains options to turn setting values into
 bytes and bytes into setting values. The options here to take a
 single byte (the default) and mask it with 0x04 to get a value
 with a result of 0x04 being true and anything else being false.
  They also say to use 0x04 when writing a true value and 0x00 (the
 default) when writing a false value.  Because this is a boolean
 setting and the mask masks off part of a byte the value to be
 written is or'ed with the byte read for the setting before
 writing to the device.
----

so ... yeah ...

Comment 3 Ian Wienand 2024-04-18 23:43:28 UTC
Another data point; switching the mouse off and then back on puts it into the "slow" mode.  Flipping the switch in solaar and it works again.  So possibly it "forgetting" when the mouse goes to sleep itself?

I also realised there's several different versions of this mouse, mine is

---
# Name: Logitech Wireless Mouse MX Master 3
# ID: bus 0x0005 (bluetooth) vendor 0x046d product 0xb023 version 0x0013
---

I logitech options+ on a mac laptop and it said the firmware for the mouse was the latest, 19.something.

Comment 4 nocar 2024-05-13 12:34:05 UTC
After updating from the beta to the full release version of F40, this issue appears to have been resolved, at least for me.


Note You need to log in before you can comment on or make changes to this bug.