Ubuntu – USB peripherals freeze after 16.04

16.04driverskeyboardmouseusb

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.

Best Answer

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!

Related Question