USB peripherals freeze after 16.04

6,385

Solution 1

After more googling I finally found the solution. Apparently something has changed in default power management options making my mouse and keyboard be autosuspended to cut power usage and the functionality works even without manually installing any of the power saving software. The solution is here:

http://www.hecticgeek.com/2012/06/fix-usb-mouse-not-working-laptop-mode-tools-ubuntu/

modify etc/laptop-mode/conf.d/usb-autosuspend.conf to add your devices to the blacklist.

VERY IMPORTANT: your usb devices must be unplugged while running sudo service laptop-mode restart!

Solution 2

I've not figured out yet how to fix this issue permanently, but there is workaround that worked to me.

First off, you should discover which is your device:

# lsusb
...
Bus 003 Device 002: ID 056d:c087 Logitech, Inc. M105 Optical Mouse

Pay attention to the bus number and id. Then, go to /sys/bus/usb/devices and you will see that folder contains a lot of symlinks. Using Bus 003 as reference, you should dig into 3-* folders.

# ll
...
lrwxrwxrwx 1 root root 0 nov 17 20:33 3-0:1.0 -> ../../../devices/pci0000:00/0000:00:1a.0/usb3/3-0:1.0/
lrwxrwxrwx 1 root root 0 nov 17 20:33 3-1 -> ../../../devices/pci0000:00/0000:00:1a.0/usb3/3-1/
lrwxrwxrwx 1 root root 0 nov 17 20:33 3-1:1.0 -> ../../../devices/pci0000:00/0000:00:1a.0/usb3/3-1/3-1:1.0/
lrwxrwxrwx 1 root root 0 nov 17 20:33 4-0:1.0 -> ../../../devices/pci0000:00/0000:00:1a.1/usb4/4-0:1.0/
lrwxrwxrwx 1 root root 0 nov 17 20:33 5-0:1.0 -> ../../../devices/pci0000:00/0000:00:1d.0/usb5/5-0:1.0/
lrwxrwxrwx 1 root root 0 nov 17 20:33 6-0:1.0 -> ../../../devices/pci0000:00/0000:00:1d.1/usb6/6-0:1.0/
lrwxrwxrwx 1 root root 0 nov 17 20:33 7-0:1.0 -> ../../../devices/pci0000:00/0000:00:1d.2/usb7/7-0:1.0/
lrwxrwxrwx 1 root root 0 nov 17 20:33 usb1 -> ../../../devices/pci0000:00/0000:00:1a.7/usb1/
lrwxrwxrwx 1 root root 0 nov 17 20:33 usb2 -> ../../../devices/pci0000:00/0000:00:1d.7/usb2/
lrwxrwxrwx 1 root root 0 nov 17 20:33 usb3 -> ../../../devices/pci0000:00/0000:00:1a.0/usb3/
...

You'll notice every single folder has two files idVendor and idProduct. These files contain those id you got previously, through lsusb command. That was the tricky part.

Once you have identified the device (rename usb3/3-1 folders accordingly), run:

echo 'on' | sudo tee /sys/bus/usb/devices/usb3/3-1/power/control

The only inconvenient is that this solution is not permanent, and you should run it again every time you reboot your laptop (use reverse-i-search Ctrl+R then, will make all easier)

Share:
6,385

Related videos on Youtube

Jatentaki
Author by

Jatentaki

Updated on September 18, 2022

Comments

  • Jatentaki
    Jatentaki over 1 year

    After updating from 14.04 to 16.04 LTS Ubuntu I started experiencing strange issues with USB peripherals (logitech keyboard and mouse). The mouse randomly freezes and so does the keyboard. For mouse, after being left idle the pointer usually stops moving and only right click remains working. Rightclicking unfreezes the mouse again for normal operation, and the next freeze happens when it's left untouched for several seconds. Keyboard has a similar pattern where after a moment of not being used the next several letters won't be registered. Once it gets going it will remain working until the next pause. The freezes between the mouse and the keyboard do not appear to be in a correlation. Replugging the device temporarily gets it working as well. Since this is a laptop I can tell the built-in pointer and keyboard work fine.

    There are three relevant topics I found while googling, but none of them seems to apply:

    USB peripherals cutting in and out

    The suggested source of the problem is the power supply. However I had this setup running flawlessly for over 2 years on 14.04 and the issues appeared immediately after upgrade to 16.04.

    USB Mouse not working after installing Ubuntu 16.04 - Persistent Fix?

    The rmmod/modprobe trick doesn't do it for me, nor did disabling EnableOptionROM. Also it is not that the mouse stops working completely. Right click remains working and "awakens" the rest of functionality.

    Problem with USB mouse in Ubuntu 16.04

    The mouse doesn't change its status in xsetpointer.

    Because of symptoms I would expect this to be a strange device driver issue, however with the issue affecting both keyboard and mouse it seems to be connected with USB functionality instead.

  • crafter
    crafter over 6 years
    Thanks @Jatentaki. This solved the issue for me. However, please copy the steps here as the link may not be available in the future as we have no control over it. If you do this, you will earn my upvote.
  • metame
    metame over 6 years
    No longer the case in 17.04 - /etc/laptop-mode isn't there