How do I solve periodic mouse lag on Linux Mint (MATE)?

28
2013-08
  • machineghost

    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)
    
  • Answers
  • Indrek

    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.

  • grs

    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.

  • stevetammer

    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!

  • UberSteve

    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!


  • Related Question

    "AMD Unsupported Hardware" watermark in Linux Mint
  • RyanScottLewis

    I just setup my new computer that has onboard video and Installed Linux Mint. I installed the "ATI/AMD proprietary FGLRX graphics driver" from Hardware Drivers and now I have a watermark on the bottom left of my screen that says "AMD Unsupported Hardware".

    Why is this there? Is there anyway to get rid of this?

    Onboard video specs: ATI Radeon HD 4200 GPU SidePort Memory - onboard 128MB DDR3 1333 memory

    @Jared Harley: I've been searching around and havn't found a fix for this. /etc/ati/control exists so that shouldn't be a problem.


  • Related Answers
  • RyanScottLewis

    Got the answer!

    http://support.amd.com/us/gpudownload/Pages/index.aspx

    Found my hardware under Linux x86_64 > Integrated/Motherboard > Radeon HD 4200

    "Linux x86" means 32 bit "Linux x86_64 means 64 bit

    Download the driver somewhere (lets put it in '~/stuff') Open up the terminal and type:

    user@user-desktop:~/stuff $ cd ~/stuff
    user@user-desktop:~/stuff $ chmod +x NAMEOFTHEFILEHERE.run
    user@user-desktop:~/stuff $ ./NAMEOFTHEFILEHERE.run
    

    And the driver will be installed.

  • Jared Harley

    According to a post at Phoronix:

    With the fglrx 8.39.4 driver (or newer), there's a chance you may run into a watermark (similar to the AMD testing watermark) saying that your hardware is unsupported when in fact it is supported. If you run into this unsupported hardware watermark, it's likely that /etc/ati/control is missing. If that's the case for you, try reinstalling the driver or manually copying the control file. The driver contents can be extracted using the --extract argument and the control file is located in common/etc/ati/. If you experience this problem, create a thread in the Phoronix Forums with what distribution you are using and how you had installed the driver initially (and whether adding the control file had removed the watermark).

    Other people also had luck downgrading their video driver to one version lower.

  • slhck

    I have an ATI HD 6520 in my Acer Ao 522. I had to upgrade to the latest driver (in my case 12-6 64bit) to get multi-displays to work.

    I tried what James suggested and it didn't work for me. Though the driver seems to chug along with the replaced file. The watermark goes away when I open up Catalyst.

    I may give the open source driver another shot next time I have time to fool with it. I heard ATI has better support with the open source driver than NVIDIA, though on my other machine with a Quattro card, NVIDIA drivers work great.

  • James

    I used the following command to unpack the drivers

    ./ati-driver-installer-10-1-x86.x86_64.run --extract
    

    I then copied the new file into the old place

    cp /etc/ati/control /etc/ati/control-old
    cp common/etc/ati/control /etc/ati/control
    

    It got rid of the watermark for me and the old proprietary driver appears to still work with the new control file.

  • Gnoupi

    Try using the open-source "ati" driver instead of fglrx. The performance will be abysmal but you won't have the watermark (no one is going to code such an anti-feature in a FLOSS driver).