13

Sometimes, after some event that I can't determine, my USB mouse gets stuttery - like the refresh rate drops down to about 5-10Hz. It still works fine other than that, but it's incredibly annoying, and makes the computer feel really slow. It appears to happen frequently after a sleep, but it sometimes happens when the computer has just booted up. A reboot usually fixes it.

I've tried:

  • unplugging and replugging the mouse.
  • rmmod in usbhid and hid, and modprobing them (and psmouse, which is irrelevant)
  • restarting udev (with mouse in and out)
  • killing X, and starting it again
  • plugging in a second USB mouse - problem remains, with both mice.

I would like to find a way to "reset" my mouse, without having to reboot. Is there anything else I should try?

I am running Kubuntu 12.04. this is a laptop, and the touchpad is unaffected.

6
  • You sure it does'nt happen on Windows right?
    – daisy
    Sep 27, 2012 at 13:52
  • Probably related to something in the kernel like timers not coming out of suspend right, not a specific problem with the mouse. Check dmesg output.
    – Jim Paris
    Sep 27, 2012 at 21:13
  • @warl0ck: you think it might be a usb hardware problem in the computer? Possible, I guess, although it resets itself after a reboot most times. I don't have windows, so I can't test, unfortunately. Even if I did, the problem isn't regular, so it might be difficult to know.
    – naught101
    Sep 28, 2012 at 0:19
  • @JimParis: I'd agree, but it also happens sometimes without suspending (less common though). I've tried looking at dmesg, but I don't really know what to look for..
    – naught101
    Sep 28, 2012 at 0:21
  • Have you tried a different distro, possibly via live media? Sep 28, 2012 at 2:38

4 Answers 4

25

Try Ctrl+Alt+F1 to text mode and immediately Ctrl+Alt+F7 to graphical mode.

5
  • 13
    Why did this work? Jun 19, 2018 at 15:01
  • i think this works because it forces all of the graphics-related drivers to basically dump and reset. Thats my best guess. my linux instincts tell me that the USB drivers are probably buffering commands, but somehow getting out of sync with the muse itself. So the mouse slows or stutters when the buffer fills, and eventually stops working. Or something. shifting to TTY and then back would resent such command buffers. Jan 21, 2021 at 20:25
  • Works for Debian Testing today Dec 3, 2021 at 17:41
  • Works for me running manjaro Feb 9, 2022 at 16:14
  • For me is F7 to go into text mode and F1 into graphical mode, but it does indeed work. Ubuntu 20.04. Apr 17, 2022 at 7:58
14

The optical mouse on my laptop running Ubuntu 18.04 on the 4.15.0-51-generic kernel just quit working for some reason. First I tried the normal quick remedies that is unplugging and re-plugging first on the same port and then on the other two unused ports; the mouse still didn't work. I have to point out that I still had power on the USB ports. So I was puzzled and decided to check what was happening on my terminal. Here are my interactions with the system.

dmesg

I found the following entries in the system log.

usb 1-1.2: USB disconnect, device number 16
[50687.847220] usb 1-1.2: new low-speed USB device number 17 using ehci-pci
[50687.959081] usb 1-1.2: New USB device found, idVendor=0000, idProduct=0538
[50687.959084] usb 1-1.2: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[50687.959085] usb 1-1.2: Product:  USB OPTICAL MOUSE
[50687.961754] input:  USB OPTICAL MOUSE as /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.0/0003:0000:0538.0004/input/input18
[50688.019546] hid-generic 0003:0000:0538.0004: input,hidraw0: USB HID v1.11 Mouse [ USB OPTICAL MOUSE] on usb-0000:00:1a.0-1.2/input0

I then tried unloading and re-loading usbhid

sudo modprobe -r usbhid && sudo modprobe usbhid

That did not work. However I did notice a new error in the logs

usb usb3-port2: connect-debounce failed

At this point I decided to do a web search to see what that specific error means and that's how I landed on this page. I however felt that the solutions provided needed too much work and instead opted to see what else I could do with the Kernel modules to solve the problem. First I checked what specific kernel modules were loaded by running

sudo modprobe -r Tab

Please note that the proper way of getting loaded modules is by running lsmod but I prefer the method I used above for minute tasks for which I have no use for lsmod's much more verbose output

A module name psmouse caught my eye and I decided to test whether reloading both both usbhid and psmouse resurrects my mouse.

sudo modprobe -r usbhid && sudo modprobe -r psmouse
sudo modprobe usbhid && sudo modprobe psmouse

And just like that the functions of my optical mouse were restored.

2
  • 1
    This worked for me on Pop!_OS 20.04 LTS . Jul 12, 2020 at 21:38
  • 1
    Sadly this did not work for me (20.04 with kernel 5.10.1) Dec 16, 2020 at 21:16
4

This USB reloading helped me: http://davidjb.com/blog/2012/06/restartreset-usb-in-ubuntu-12-04-without-rebooting/

The original article suggests this:

echo -n "0000:00:1a.0" | tee /sys/bus/pci/drivers/ehci_hcd/unbind
echo -n "0000:00:1d.0" | tee /sys/bus/pci/drivers/ehci_hcd/unbind
echo -n "0000:00:1a.0" | tee /sys/bus/pci/drivers/ehci_hcd/bind
echo -n "0000:00:1d.0" | tee /sys/bus/pci/drivers/ehci_hcd/bind

But on my Debian I need to replace ehci_hcd by ehci-pci. Also you may have different IDs, they can be obtained by executing:

lspci | grep USB
4
  • I get "pemission denied"
    – pmiranda
    Nov 29, 2020 at 21:59
  • @pmiranda These commands require 'root' rights. So only administrator can run them.
    – Dzenly
    Nov 30, 2020 at 6:09
  • I thought that running them with sudo would work but not
    – pmiranda
    Nov 30, 2020 at 12:46
  • 1
    @pmiranda Did you set sudo to second commands (in pipelines) like this ? echo -n "0000:00:1a.0" | sudo tee /sys/bus/pci/drivers/ehci_hcd/unbind
    – Dzenly
    Nov 30, 2020 at 13:39
3

There are many possible causes to the problem.

1: The mouse is physically bad. Try using a different USB mouse.
2: The USB port is physically bad. Plug the mouse into another port.
3: It may be some odd bug in KDE. I have had weird mouse and cursor issues with KDE, but not in Unity or GNOME on the same system.
4: You may need a different/newer mouse driver.

You may want to try updating the system. If you are willing to try anything to fix the issue, (once you know it is an issue with the OS) you may want to install Ubuntu on your system instead of Kubuntu. Kubuntu is different from Ubuntu, although they are largely the same OS.

2
  • Installing Ubuntu vs Kubuntu shouldn't make a difference, unless they have different kernels or radically different KDE. I'd check first updating the system to the latest stuff, perhaps check out experimental/unstable/testing packages. On the other points I fully agree. Oh, and if it is a wireless mouse, check the batteries: low batteries elicit all sort of bizarre behaviour from mice.
    – vonbrand
    Jan 31, 2014 at 13:00
  • @vonbrand I am not saying they use different kernels. I think the issue may be with rendering the cursor in the KDE environment. The Unity interface does not use KDE. Feb 2, 2014 at 13:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.