USB Mouse sleeping after 5 seconds when on battery

18,799

Solution 1

To solve this problem on 12.04 and continue using laptop-mode-tools edit the file:

/etc/laptop-mode/conf.d/usb-autosuspend.conf

$ sudo gedit /etc/laptop-mode/conf.d/usb-autosuspend.conf

And look for the line:

AUTOSUSPEND_USBTYPE_BLACKLIST=""

Replace with:

AUTOSUSPEND_USBTYPE_BLACKLIST="usbhid usb-storage"

This will automatically disable USB autosuspend if you have ANY mouse and even USB drives plugged in.

Solution 2

I had the same problem, I think after I installed either laptop-mode-tools or powertop. Instead of uninstalling them again...

  • enter sudo powertop in a terminal
  • use the right arrow key to change to the tab Tunables
  • use the down arrow key to select the line with Autosuspend for your USB mouse
  • press Enter to toggle this line to Bad
  • quit powertop with the key q

EDIT: Too bad, this is just a temporary solution. It does not survive a reboot...

However, I found something else. If you have laptop-mode-tools installed, try to set CONTROL_USB_AUTOSUSPEND=0 in the file /etc/laptop-mode/conf.d/usb-autosuspend.conf

EDIT: setting BATT_SUSPEND_USB=0 should also solve the problem (at least it solved mine).

Solution 3

The following link offers another approach that looks like it should work. Just attempted it myself. Here's hoping.

In case the link goes away I'll give you the short and sweet version. First off, the fix assumes you're using laptop-mode-tools. Use lsusb to get the id of the device, and then add this to the AUTOSUSPEND_USBID_BLACKLIST parameter in /etc/laptop-mode/conf.d/usb-autosuspend.conf.

The id I'm using for my USB mouse has been highlighted in the below snippet from lsusb's output.

Bus 002 Device 003: ID 045e:0748 Microsoft Corp.

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

Solution 4

use lsusb to find bus number and device number
next in each folder present in /sys/bus/usb/devices/ which is named as number-number such as 1-1.2 etc check the files busnum and devnum to find the bus number and device number the files are for and find the folder required (say 1-1.2).
Next for the respective folder say 1-1.2, set the value in file located at /sys/bus/usb/devices/1-1.2/power/autosuspend as -1.
Now the device will not suspend.

Share:
18,799

Related videos on Youtube

yurividal
Author by

yurividal

Updated on September 18, 2022

Comments

  • yurividal
    yurividal over 1 year

    My usb mouse sleeps after 5 seconds of inactivity when running on battery power. It wakes uo again when i press any button on the mouse. This is really annoying.

    I have made lsusb, and I noticed my mouse is

    Bus 001 Device 012: ID 04d9:2083 Holtek Semiconductor, Inc.

    I have checked my /sys/bus/usb/devices/usb1/power/autosuspend but it is already set to 0, and the directory usb1 has many subdirectories which also have autosuspend files, and i dont know how to edit them.

    Also, I would like a permanent solution, which would work for any mouse, on any of my 3 usb ports. Any ideas?

    Using: Ubuntu 12.04 64bit

  • Abhishek Bhatia
    Abhishek Bhatia almost 12 years
    I forgot to mention that this is temporary solution.
  • nanofarad
    nanofarad almost 12 years
    This could be non-temporary if added to one of the system init scripts.
  • tiktak
    tiktak over 11 years
    Thanks for pointing out powertop. I just realized I didn't have this problem before installing it. Your command isn't correct on Ubuntu, it should have been: sudo apt-get remove --purge powertop-1.13 && sudo apt-get autoremove
  • abhishek-23
    abhishek-23 about 10 years
    Awesome tip!!! Thanks :) Also it is possible to add device by id like 0458:003a
  • Ekaveera Gouribhatla
    Ekaveera Gouribhatla about 10 years
    hi i could not edit the file due to permissions..plzz help me..i am using ubuntu 12.04
  • user447607
    user447607 about 9 years
    In the same file, I just set AUTOSUSPEND_TIMEOUT=600 since 2 seconds is a little nutty anyway.
  • wbkang
    wbkang over 5 years
    On Ubuntu 16.04, the config file is called /etc/laptop-mode/conf.d/runtime-pm.conf and the property is named AUTOSUSPEND_RUNTIME_DEVTYPE.