FS#62035 - [linux]USB mouse wheel behaviour changed after suspend
Attached to Project:
Arch Linux
Opened by Tuomas Jäntti (qwertypoke) - Saturday, 16 March 2019, 23:55 GMT
Last edited by Toolybird (Toolybird) - Sunday, 04 June 2023, 03:19 GMT
Opened by Tuomas Jäntti (qwertypoke) - Saturday, 16 March 2019, 23:55 GMT
Last edited by Toolybird (Toolybird) - Sunday, 04 June 2023, 03:19 GMT
|
Details
Description:
After boot wireless mouse wheel works as desired: Each small step of the wheel results in a step of vertical scrolling. After suspend one single step of vertical scrolling requires about a whole round of the wheel. The amount of wheel steps required is not constant. It varies: 10-30 steps. Recovering desired usage can be obtained by either rebooting or pulling out the USB-receiver and pushing it back in. Switching the mouse off and on does not restore correct behaviour. Additional info: * package version(s) I really do not know what part of the system is relevant. Please ask for relevant version info. GUI: Xfce 4.12 kernel 5.0.2 Mouse: Microsoft Wireless Mobile Mouse 3500 * config and/or log files etc. I will provide these as desired. * link to upstream bug report, if any Steps to reproduce: 1) Boot machine: mouse wheel is responding normally 2) Suspend and wake-up: Mouse wheel response is faulty |
This task depends upon
Closed by Toolybird (Toolybird)
Sunday, 04 June 2023, 03:19 GMT
Reason for closing: Upstream
Additional comments about closing: Please report upstream as per comments.
Sunday, 04 June 2023, 03:19 GMT
Reason for closing: Upstream
Additional comments about closing: Please report upstream as per comments.
# modprobe -r usbhid && sleep 5 && modprobe usbhid
I think it's related to high-resolution scrolling module implemented in the kernel 5.0.
I installed resetmsmice (available in AUR) and I used systemd to launch it after each suspend (following https://askubuntu.com/questions/92218/how-to-execute-a-command-after-resume-from-suspend)
No delay after boot in my case and unplugging receiver makes no difference.
The 3 abovementioned workarounds did not help in my case.
My workaround is to roll back kernel to 4.20.13 and wait for a fix in 5.0 or 5.1. Unfortunately I now have a few ignored packages as a result.
to desactivate the new high resolution scrolling module work.
Microsoft Wireless Mouse 1000.
And I don't have the module "hid_logitech_hidpp" listed in lsmod.
I have a dual-boot arch/win10 system. MS wireless mouse scrolls abnormally slow and after much googling I cannot find a workaround.
As an example, in order to comfortably scroll from top to bottom of this web page (25 April), I need 60 mouse scroll movements. With a USB wired mouse it takes 3 movements.
In libinput debug-events, I get one POINTER_AXIS event every 18 wheel clicks, instead of every 1 click. (arch kernel 5.0.9)
I suspect the code in kernel 5.x, ../drivers/hid/hid-input.c is the cause of this poor scrolling behaviour, rather than device-specific hires modules. from reading the changelogs, it looks like hires code was added Dec 2018.
I have compiled 5.0 and 5.1-rc kernels with hid-input.c hacked and the mouse scroll behaviour changes, but not in a controlled way.
Trouble is , I do not understand mouse drivers or the algorithms in this module, so I am only guessing by trying different multiplier numbers at lines 1242/1244. I changed the 120 divisor and multipliers from 120 to 40. Now I get an POINTER _AXIS event every 6 clicks instead of 18 !!
code =
hi_res = value * 120/usage->resolution_multiplier;
usage->wheel_accumulated += hi_res;
lo_res = usage->wheel_accumulated/40;
if (lo_res)
usage->wheel_accumulated -= lo_res * 40;
If anyone is interested I can provide more details.
I don't have Windows installed on the laptop at all.
I did blacklist the psmouse module though, because it seemed to conflict with the touchpad driver.
# modprobe -r hid_logitech_dj && sleep 5 && modprobe hid_logitech_dj
There was no patch by me, as such.
Just a dirty hack to the hid-input.c kernel module which I then compiled to custom kernel on my pc and which partially fixed my particular mouse problem.
There was a bug report upstream - https://bugzilla.kernel.org/show_bug.cgi?id=202909 - and the kernel experts eventually fixed it in kernel 5.2.
rgds
/usr/lib/systemd/system-sleep/10-mouse-fix.sh
#!/bin/bash
case $1/$2 in
pre/*)
# echo "Going to $2..."
/usr/bin/rmmod usbhid
;;
post/*)
# echo "Waking up from $2..."
/usr/bin/modprobe usbhid
;;
esac
# uname -a
Linux orava 5.16.8-arch1-1 #1 SMP PREEMPT Tue, 08 Feb 2022 21:21:08 +0000 x86_64 GNU/Linux
And continuing to whinge it about here achieves nothing. It's clearly an upstream issue and must be reported to the kernel folks. Arch cannot fix this because it's not an Arch packaging bug.