32

I have a laptop with the latest Linux Mint installed (the MATE version, not the Cinnamon one). 80-90% of the time everything works great, but periodically the mouse will start "lagging" heavily (it will feel sluggish to respond and the cursor move at maybe 20% normal speed). This problem comes and goes without any apparent cause. It occurs with both a USB mouse as well as the laptop's touchpad. I didn't have this issue with an older version of Mint, though.

I've tried to Google for someone else who solved this issue, but because of the general nature of the terms involved ("mouse", "linux", "lag", etc.) I just find a lot of unrelated pages.

Does anyone have any suggestions on how I can diagnose what is causing this strange mouse lag (and ideally, how I can solve it)?

* EDIT *

Here's a sample of top output during the lag:

top - 20:10:27 up 34 days, 22:31,  4 users,  load average: 2.36, 1.19, 0.65
Tasks: 192 total,   2 running, 190 sleeping,   0 stopped,   0 zombie
%Cpu(s):  5.8 us, 24.8 sy,  0.0 ni, 68.5 id,  0.4 wa,  0.0 hi,  0.5 si,  0.0 st
KiB Mem:   4032688 total,  3475752 used,   556936 free,   202180 buffers
KiB Swap:  8787516 total,   137556 used,  8649960 free,  1768748 cached

  PID USER      PR  NI  VIRT  RES  SHR S  %CPU %MEM    TIME+  COMMAND           
21961 root      20   0     0    0    0 S  20.9  0.0   0:12.82 kworker/1:0       
21762 root      20   0     0    0    0 R  11.3  0.0   0:12.05 kworker/0:2       
 5780 me        20   0  181m  26m  16m S   9.3  0.7 271:41.38 mate-system-mon   
21733 root      20   0     0    0    0 S   7.6  0.0   0:16.24 kworker/1:1       
21956 root      20   0     0    0    0 S   7.3  0.0   0:13.10 kworker/0:0       
21879 root      20   0     0    0    0 S   3.7  0.0   0:03.25 kworker/u:2       
23920 me        20   0  425m  85m  16m S   3.3  2.2 148:23.44 chrome            
20013 me        20   0  426m 198m  27m S   2.0  5.0   5:53.41 chrome            
  852 me        20   0  170m  13m  10m S   1.0  0.3   1:43.49 mate-terminal     
 2283 root      20   0  132m  26m  10m S   1.0  0.7 140:33.62 Xorg              
11361 me        20   0 1054m 212m  26m S   1.0  5.4 119:45.32 eclipse           
23766 me        20   0  644m 179m  39m S   1.0  4.6 156:13.04 chrome            
19035 couchdb   20   0 86672 5120 1484 S   0.7  0.1 314:22.75 beam.smp          
   10 root      20   0     0    0    0 S   0.3  0.0   6:08.10 ksoftirqd/1       
 2453 me        20   0 38796 1824 1680 S   0.3  0.0   2:31.55 gvfs-afc-volume   
 5776 me        20   0  105m 8376 6772 S   0.3  0.2   1:48.06 multiload-apple   
18074 me        20   0 69836  14m 3808 S   0.3  0.4   9:23.07 python            

Here's a tail of running dmesg (dmesg gives a lot of output, thus the tail):

[2844570.290434] type=1701 audit(1358135321.797:17): auid=4294967295 uid=1000 gid=1000 ses=4294967295 pid=6593 comm="chrome" reason="seccomp" sig=0 syscall=20 compat=0 ip=0xb3599424 code=0x50000
[2855118.278240] stereo mode not supported
[2891634.104527] stereo mode not supported
[2929390.761034] stereo mode not supported
[2930948.986039] stereo mode not supported
[2931457.828088] stereo mode not supported
[2936251.706768] stereo mode not supported
[2939573.402914] stereo mode not supported
[2940015.539524] stereo mode not supported
[2977473.595590] stereo mode not supported

As per @grs's answer, here's the tail of my /var/log/Xorg.0.log:

[2940015.539] (II) intel(0): Printing DDC gathered Modelines:
[2940015.539] (II) intel(0): Modeline "1366x768"x0.0   69.30  1366 1414 1446 1456  768 771 777 793 -hsync -vsync (47.6 kHz eP)
[2977473.595] (II) intel(0): EDID vendor "AUO", prod id 4140
[2977473.595] (II) intel(0): DDCModeFromDetailedTiming: Ignoring: We don't handle stereo.
[2977473.595] (II) intel(0): Printing DDC gathered Modelines:
[2977473.595] (II) intel(0): Modeline "1366x768"x0.0   69.30  1366 1414 1446 1456  768 771 777 793 -hsync -vsync (47.6 kHz eP)
[3020717.050] (II) intel(0): EDID vendor "AUO", prod id 4140
[3020717.050] (II) intel(0): DDCModeFromDetailedTiming: Ignoring: We don't handle stereo.
[3020717.050] (II) intel(0): Printing DDC gathered Modelines:
[3020717.050] (II) intel(0): Modeline "1366x768"x0.0   69.30  1366 1414 1446 1456  768 771 777 793 -hsync -vsync (47.6 kHz eP)
14
  • Is this just a tough problem to solve or is there something wrong with my question? I know on Stack Overflow questions often get ignored if (for instance) they don't have code samples ... is there any information missing here that I could provide? Jan 6, 2013 at 21:12
  • I have exactly the same problem - I'll start a bounty
    – sunwukung
    Jan 9, 2013 at 22:31
  • Thank you! If I could spend my Stack Overflow points here I'd totally do the same ... Jan 9, 2013 at 23:21
  • 3
    First, please state what hardware you are using - desktop/laptop, mouse type and manufacturer. Have you tried different mouse? Is there swapping during the lag (can verify with top)? When to mouse lag occur, does it affect the keyboard too? Generally, more info you put in your question, better answer you can get.
    – grs
    Jan 12, 2013 at 0:37
  • Is this a laptop? What kind of mouse? PS1? USB? Wireless? Does it happen when the system is under heavy load? And everything that @grs said.
    – terdon
    Jan 12, 2013 at 16:50

7 Answers 7

31

I found the following solution on Ask Ubuntu:

sudo -i
echo N> /sys/module/drm_kms_helper/parameters/poll
echo "options drm_kms_helper poll=N">/etc/modprobe.d/local.conf

It definitively solved the problem for me, and after more than a week of testing I can confirm it stopped the mouse lag for me.

3
10

Note that on newer kernels the drm_kms_helper module may not be loaded by default. One extra step gets this working:

sudo su -
modprobe drm_kms_helper
echo N> /sys/module/drm_kms_helper/parameters/poll
echo "drm_kms_helper" >> /etc/modprobe.d/local.conf
echo "options drm_kms_helper poll=N" >> /etc/modprobe.d/local.conf

Hope that helps someone!

3
  • to load module at boot time: echo 'drm_kms_helper' >> /etc/modules-load.d/local.conf
    – kravemir
    Oct 28, 2014 at 18:16
  • @kravemir won't I need to elevate my privileges for that command to work with Startup Applications?
    – ahorn
    Jun 15, 2020 at 12:53
  • Coming from Google, on ubuntu 20.04 with displaylink, this makes the lag that occurs a few seconds after plugging-in a wireless mouse much much worse.
    – gxtaillon
    Mar 21, 2021 at 15:33
4

Fixing Mouse Lag on Cinnamon

I have experienced heavy mouse lag on cinnamon suddenly. In case someone else finds this page when searching, like me, for a possible cause, it is perhaps: Desktop magnification. Make sure it is turned off with Alt+Super+8, even when the screen is not magnified.

It took me quite some time to track it down, mainly found the problem after starting to bisect my entire home directory (move half of the directories to a temporary directory and log in again etc.) until I could locate ~/.config/dconf/user and then finally the zoom level factor that was set to 1.0:

[org/cinnamon/desktop/a11y/magnifier]
mag-factor=1.0
screen-magnifier-enabled=true

You can check if this is the case on your Cinnamon with

dconf dump / |grep mag
1
  • Alt+Super+8 seems to have fixed it for me.
    – kpg
    Jul 8, 2020 at 6:15
3

After weeks of searching and trying to fix this problem, I finally got it sorted through this page: http://carlocapocasa.com/crushing-the-kworker-uprising-or-how-to-fix-your-linux-lenovo-ideapad-y560p/

$ grep enabled /sys/firmware/acpi/interrupts/* (the gpe with the clear high number is the problem)

Then add a crontab entry to fix it @reboot echo "disable" > /sys/firmware/acpi/interrupts/gpeXX (XX is the number of your gpe)

-037

3

While OP's accepted answer may have helped back in the day; it no longer works today.

Today, you need to adjust the mousepoll rate of the usbhid module.

If your mouse is 1000hz then you need to tell usbhid to poll at at that interval; by default it polls at 125hz.

On Debian systems you can do that by adding the following to /etc/modules:

-r usbhid
usbhid mousepoll=1

Note: I've never had echo 1 > /sys/module/usbhid/parameters/mousepoll work; I've had to add the poll interval and restart. Probably have to restart X and/or reload video modules to apply it without restarting.

1
  • Doesn't seem to work for me. The cursor still lags behind and stops intermittently while dragging.
    – David G
    Jul 24, 2020 at 18:20
2

Judging by the relatively high %sy value in top and based on your statement that the same hardware used to work correctly before the upgrade, I think the lag is caused by a driver. It is unusual for a healthy, almost idle system to spend so much time in kernel mode. I just checked that Linux Mint 14 is based on Ubuntu 12.10 and uses kernel 3.5. It would be curious to see if any errors are recorded in /var/log/Xorg.0.log.

Your options to solve this are fairly limited:

  1. try different mouse;
  2. try LiveCD on another distro/version;
  3. try different graphical interface;
  4. live with it (I am running Linux Mint Debian Edition and on random bases my left button refuses to work and it comes back by itself. I learned to work around this);
  5. get older or newer mouse module for your kernel (provided you know how).

If it is that terrible, you may want to get 2.6.x family kernel installed. There is a chance it will "break" something else and probably you would need to compile it.

6
  • I edited my answer with a /var/log/Xorg.0.log tail; it seems innocuous to me, but I'm not really sure. Jan 16, 2013 at 5:58
  • Nothing interesting the the Xorg log. Which older version of Linux Mint you ran without troubles? What environment?
    – grs
    Jan 16, 2013 at 14:06
  • Hmmm ... I don't remember exactly to be honest, but I was way behind. It was long before this whole GNOME=>MATE thing ... maybe Mint 7 or 8? And the environment was just GNOME. Jan 16, 2013 at 22:30
  • You may want to play with older versions of Linux Mint and/or Ubuntu.
    – grs
    Jan 17, 2013 at 0:03
  • 1
    Thanks for the suggestion, but running ancient versions of operating systems is a security risk and just generally a bad idea. Plus, I find it difficult to believe that current versions of Linux can only run on cutting edge hardware. I mean, this laptop counts its RAM in gigs, not megabytes, and we're talking Linux, not Windows: it should be possible to run a current version. It seems far more likely to me that my problems are coming from one specific new component (eg. MATE), rather than something deep-seated like the kernel; I just don't know how to determine the component. Jan 17, 2013 at 0:11
2

I don't know if this one is still a problem? ... However I had the same issue with the mouse lag in Linux Mint 14 x64 Cinnamon. I tried anything ... different kernels, updating drivers - nothing worked.

Anyway the surprisingly magic solution was to unklick the option "Disable touchpad while typing" in the mouse settings. This setting seems to cause heavy problems randomly.

I hope this might help somebody else out there!

2
  • That sounds very promising, thanks stevetammer; I'll try it when I get home tonight. Feb 12, 2013 at 22:58
  • Sorry, forgot to report back. I checked that setting, and it turns out that I have it un-checked already :-( I tried checking it, just to see, but it didn't seem to do any good. Still, thanks for the suggestion (maybe it will help someone else). Feb 14, 2013 at 22:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .