I'm using Ubuntu 11.04 64 bit laptop, and I have a Microsoft mouse. When I'm on the battery power the mouse cuts in and out, I have full battery power so it's not because of low power. It never does this in Windows, and in the past when I ran Karmic it never did this either, only when I reinstalled Ubuntu with Natty. As soon as I plug in the power it works perfectly fine.
-
do you see anything weird happening in dmesg? – user606723 Aug 03 '11 at 20:47
-
Doesn't look like anything weird is happening, but it's hard to tell, really overwhelming, a lot of info on dmesg. – KoRnKloWn Aug 05 '11 at 07:11
-
This question appears to be abandoned and unanswered, could you perhaps add more detail to your question? If this question no longer applies then you can either delete it or answer it yourself if you've solved the problem. Thanks! – Jorge Castro Feb 11 '12 at 22:58
6 Answers
This behaviour is caused by laptop-mode-tools
. While it's true that removing it completely solves the "problem", you may still want to keep the package on your system.
In order to disable the usb autosuspend feature of laptop-mode-tools for your mouse, you can insert your mouse's USBID (obtainable through lsusb
) in
/etc/laptop-mode/conf.d/usb-autosuspend.conf
on the line
AUTOSUSPEND_USBID_BLACKLIST="your-usb-id"
where your-usb-id is of the format 093a:2510
(this is my mouse).
If AUTOSUSPEND_USBID_BLACKLIST
is already there, simply add the necessary USBID (note this will work only if AUTOSUSPEND_USE_WHITELIST
is set to 0
).
Finally, reload laptop-mode-tools by executing
# service laptop-mode reload
or
$ sudo service laptop-mode reload

- 31
-
1In case you want to keep
laptop-mode-tools
but you don't want it to mess with any of your USB devices, you can edit the configuration and setCONTROL_USB_AUTOSUSPEND=0
(the default is"auto"
). – nickie Jan 29 '14 at 18:59 -
For me it was /etc/laptop-mode/conf.d/runtime-pm.conf and CONTROL_RUNTIME_AUTOSUSPEND on Ubuntu 20.04 – Victor Cold Jul 28 '22 at 14:07
Make sure you don't have the laptop-mode-tools
or powertop
packages installed. If you do, uninstall them by running
sudo apt-get remove --purge laptop-mode-tools powertop && apt-get autoremove
This solved the issue for me on Mint 13 on an Alienware M14x R2.

- 848
-
I think it's "powertop" instead of "powertools": sudo apt-get remove --purge laptop-mode-tools powertop && apt-get autoremove – Mukesh Chapagain Aug 27 '12 at 06:59
I should note that after 11.10 that problem no longer existed for me. So the answer to this problem is just update! :D
- 817
I had a similar problem and I solved it by disabling pm-powersave with
# pm-powersave false
Then I rebooted my laptop and everything was just fine. I don't know, however, the other implications of this action.

- 1
It seems like your computer is set to disable USB when iddle as a power saving measure.
This is usually suggested by powertop, but it's a very bad idea if you are using a USB mouse. This command fixes it temporally:
echo -1 | sudo tee /sys/bus/usb/devices/yourmouse/../power/autosuspend
You need to substitute yourmouse for your mouse bus and device number, you can usually find it with:
lsusb
Unluckily this will work only until whatever the program that have changed the setting kicks on again: either at boot time, when you disconnect your computer from electricity, or whatever. You need to discover what package is changing it to resolve the issue.
- 35,153
-
There doesn't seem to be anything in that directory with the name of the bus and device numbers – KoRnKloWn Aug 05 '11 at 07:10
-
Can you post the output of both lsusb and ls /sys/bus/devices/ ?. – Javier Rivera Aug 05 '11 at 07:52
-
I also changed the command as the autosuspend parameters were wrong and there was a permission problem. – Javier Rivera Aug 05 '11 at 07:59
-
I managed to find the folder with the autosuspend file using the directory listing you posted above, but the value was already set to 2, and I ran the command directly from that folder anyways on the autosuspend file, but nothing changed because like I said, it was already set to two. – KoRnKloWn Aug 05 '11 at 19:12
-
Also, it's constantly cutting in and out, and I just noticed in the power folder runtime_status changes to suspended when it cuts out, and switches back to active when it comes back on. – KoRnKloWn Aug 05 '11 at 19:20
-
OK, so I googled it and it looks like the autosuspend file needs to be set to -1 to keep it from autosuspending? I'm going to try that. – KoRnKloWn Aug 05 '11 at 19:34
-
OK, that does help, but you were right, as soon as I plug in my charger the value changes to 0, then when I unplug it switches back to 2, I think it has to do with the power manager, is there a way to edit the power manager configuration to prevent it from doing that? Otherwise I guess I can just write a small script I can run to set the value back on battery power. – KoRnKloWn Aug 05 '11 at 19:37
-
I can't get a script to work, because when I unplug and replug in the mouse it changes the directory that file is in, is there any way I could use the ID number to get to the directory in a script? Otherwise maybe there's a power manager config file I could edit? – KoRnKloWn Aug 05 '11 at 19:50
-
Well there's nothing in the ACPI directory that seems to be causing the switch (that is the directory with power management configs, right?) Not sure what program I could have installed that is doing this. – KoRnKloWn Aug 05 '11 at 19:55
-
Would it be a good idea to make a script that sets ALL the usb drives autosuspend to -1? Because I could always write the scripts and put them in the acpi folder. I mean, I doubt the usb drives are using all that much power when they are not suspending, but not being used... – KoRnKloWn Aug 05 '11 at 19:59
-
Also checked the pm folder in etc/ and there's no config files in there at all – KoRnKloWn Aug 05 '11 at 20:14
-
I have edit the anser to use the -1 value. It looks like it is version dependant, and changes with kernel version. The only program that I know that messes with it is powertop. – Javier Rivera Aug 08 '11 at 07:31
-
It will be quite difficult for a while to help you as I have lost my laptop (I expect to recever it soon) and I'm stuck with a Windows XP netbook for now :(. – Javier Rivera Aug 08 '11 at 07:32
-
XP netbook? I'm sorry :/ if I were you I would format that hard drive and install Ubuntu, it would probably run faster then XP. – KoRnKloWn Aug 09 '11 at 04:38
-
I don't have powertop, so I know it's not that. Do you think it would be a good idea to make it so all my usb drives are always set to -1 in autosuspend thing? I could add to the script in the acpi folder (I think it's power.sh or something), to set all the values to -1 – KoRnKloWn Aug 09 '11 at 04:43
-
@Tory: The netbook was not mine. Disabling USB autosuspend will lower your battery life, specially if you use external devices that draw lots of power (like a DVD drive). Disabling it could be a great idea for you, but I believe it's not generic enough to put in an answer that will show in a good position in google. – Javier Rivera Aug 09 '11 at 08:55
-
And, BTW, I'll love to discover what has caused the problem. It can be very helpful for other people. – Javier Rivera Aug 09 '11 at 08:56
-
I don't have things connected to my usb drives very often, so maybe that would be a good alternative for me? – KoRnKloWn Aug 09 '11 at 20:54
-
And I'd love to find out what has caused the problem too!
Do you think it could be that I have an older battery? Sometimes I get a warning that my battery may be old or broken, and that it's only at 48%, which it's about 2 years old, and still lasts a good few hours, but it use to last an hour or so longer. Could that have something to do with it?
– KoRnKloWn Aug 09 '11 at 20:56 -
Using Ubuntu Mate 15.10 I solved this with one terminal command ..
sudo tlp ac
it looks like tlp (power manager) blocks the usb mouse to save power
-
1Why did you add an answer to this question? It's related to Ubuntu 11.04, 4 years old, and already has an answer. – SuperSluether Jan 06 '16 at 23:37