It's a very old question, related with laptop-mode, but I'll post my solution:
In Ubuntu 14.04 I edited /etc/laptop-mode/conf.d/usb-autosuspend.conf
and change this lines to blacklist usbhid
:
# The list of USB driver types that should not use autosuspend. The driver
# type is given by "DRIVER=..." in a USB device's uevent file.
# Example: AUTOSUSPEND_USBID_BLACKLIST="usbhid usb-storage"
## Old value: AUTOSUSPEND_USBTYPE_BLACKLIST=""
AUTOSUSPEND_USBTYPE_BLACKLIST="usbhid"
In Ubuntu 12.04 I must to edit /etc/laptop-mode/conf.d/runtime-pm.conf
and change this lines to blacklist usbhid
:
# The list of device driver types that should use autosuspend. The driver
# type is given by "DRIVER=..." in a device's uevent file.
# Example: AUTOSUSPEND_DEVTYPE_WHITELIST="usbhid usb-storage"
## Old value: AUTOSUSPEND_RUNTIME_DEVTYPE_WHITELIST=""
AUTOSUSPEND_RUNTIME_DEVTYPE_WHITELIST="usbhid"
You can also blacklist usb-storage
! and you can also blacklist device by ID (AUTOSUSPEND_RUNTIME_DEVID_WHITELIST
in Ubuntu 12.04 or AUTOSUSPEND_USBID_BLACKLIST
in Ubuntu 14.04).
Then you'll need to restart laptop mode for the changes to take effect:
sudo /etc/init.d/laptop-mode restart
And then replug mouse. The mouse will not suspend again.
This works for me at work (ubuntu 12.04) and home (ubuntu 14.04).
Hope It helps :)
My crappy no name wireless mouse does this. It doesn't matter if my computer is plugged in or on battery. To make matters worse, no amount of activity will "unsuspend" the mouse once it gets stuck, forcing me to remove and reinsert the batteries every 3-5 seconds. Useless piece of s**t. – Emanuel Landeholm – 2015-01-01T14:49:29.747
@Vi.: I propose changing the accepted answer to the one of OscarGarcia, because his is the most accurate, actually answers both your questions, and doesn't have any side-effects like disabling USB autosuspend at all... – Martin Pecka – 2017-04-25T12:08:53.693
This only happens on linux, or other operation systems? – soandos – 2012-04-04T21:59:28.127
I have just observed it. May be reboot will fix it, but I want to know why this can happen. – Vi. – 2012-04-04T22:02:06.053