Try this fix, if USB Mouse is not Working After Installing ‘Laptop-Mode-Tools’ in Ubuntu

It’s true that Ubuntu (or GNU/Linux in general) is getting better and better at managing power usage under different hardware platforms. For instance, when comparing with older versions, 12.04 Precise Pangolin manages power consumption really well in my Dell Vostro V131 (Intel Sandy Bridge based notebook), and I get a battery life similar to under Windows 7 that came pre-installed with it.

However, after installing Ubuntu, I usually install another tool called ‘Laptop-Mode-Tools‘, a set of utilities (configuration files) that try to minimize the unnecessary power consumptions of your computer’s hardware. And ‘LMT’ further reduces like 0.8 Watts to 1.3Watts of power consumption from my system, which again helps to enhance the battery life, a bit more.

But one issue that I have when installing LMT under Ubuntu 12.04 is that, it disables my USB optical mouse. This is because, LMT adjusts various hardware related power consumption settings, including USB devices which uses a feature called ‘usb-autosuspend’. And as you could guess from its name, it’s designed to put USB devices into a ‘sleep’ status when not used for a certain period, for reducing power usage.

But for some reason, after going into lower power mode, my USB optical mouse refuses to ‘wake-up’.

So the easiest solution is to disable the ‘usb-autosuspend’ feature, but, that will disable the power down features of all the USB devices in general. So it’s not the ideal solution.

However, if you’re too having the same issue, then you can easily fix it by ‘backlisting’ only the USB device ID of your mouse using that configuration file, so all other USB devices will still powered down, except for the USB mouse. Please follow the below steps for achieving that.

Step 1: First, open your Terminal window and enter the below command to backup the original configuration file (just in case).

cp /etc/laptop-mode/conf.d/usb-autosuspend.conf /home/gayan

Replace ‘gayan’ with your user name.

Step 2: Now, before we can edit the configuration file, we have to know the device ID of your USB mouse. For that, enter the below command in your Terminal and look for something that says ‘optical mouse’ or ‘mouse’ etc.

lsusb

Step 3: Then copy the device ID using your mouse, located between the ‘ID’ and device name (as shown above).

Step 4: Then, enter the below command to edit the ‘usb-autosuspend’ configuration file (you’ll need ‘sudo’ privileges).

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

Step 5: Now press ‘Ctrl’ + ‘f’ keys to launch the searching box or, manually locate the the below code in the configuration file.

AUTOSUSPEND_USBID_BLACKLIST

Step 6: Then as shown below, between the ‘ ‘ marks, paste the copied device ID of your USB mouse, and click on the ‘Save’ button then close its window.

That’s it. Now reboot your PC, and the automatic mouse disabling issue should be gone :).

Update: Actually you don’t have to restart the PC, just restarting the ‘laptop-mode-tools’ main service should do the trick. For that, use the below command in your Terminal window (a thanks goes to ‘eero’ — comments below, for the tip!).

sudo service laptop-mode restart

Special note : When idle, if you find the HDD to be spinning down a bit aggressively after installing LMT (default value is ’20’ seconds), then enter the below command to adjust the HDD spinning down time.

gksudo gedit /etc/laptop-mode/laptop-mode.conf

Step 2: Then search for the two text codes shown below using the text editor.

LM_AC_HD_IDLE_TIMEOUT_SECONDS

LM_BATT_HD_IDLE_TIMEOUT_SECONDS

Once you find them, replace the value ’20’ of both these options (one is for using ‘AC’ and the other for while using the battery) with the number of seconds that you want your HDD to wait before spinning down (anything between 60 to 80 seconds might be pretty decent). Then click on the ‘Save’ and the ‘Close’ buttons to finish things up.

That’s should fix that too. Good luck.

28 thoughts on “Try this fix, if USB Mouse is not Working After Installing ‘Laptop-Mode-Tools’ in Ubuntu

  1. MikeP

    Great to see a step by step writeup for this common problem. If i remember I’ll add a link to this on my Linux Mint forum signature. As it’s a common problem that doesn’t always get a straight answer.

    One question:
    Do the device ID’s remain static when unplugged and pluged back in, or is it dependant on the usb port?

    1. Gayan Post author

      Hi ‘MikeP’,

      First of all you are welcome :).

      As for your question, the ‘device ID’ is a set of numbers that are unique to every device and they are static. And the USB port has nothing to do with it. Hope this clarifies it for you.

  2. August

    i am not using laptop mode tools, powertop or powernap, but my internet connection using a Huawei USB modem keeps getting disconnected. How do i disable USB autosuspend so my broadband wont get disconnected repeatedly?

    I’d appreciate your help on this, I’m new to Ubuntu (using Xubuntu 12.04)

    1. Gayan Post author

      Hi August,

      I cannot guarantee results, but I can try.

      Luckily, I too have a Huawei USB modem, I don’t use it anymore, but used to use it and worked with Ubuntu flawlessely. If it also supports reading a memory card, and you have one insert into it also, then that might be the main reason why Ubuntu is suspending it (I’ll save the details :D).

      Anyhow, plugin your USB modem and enter the below command to get a list of current USB devices of your computer.

      lsusb

      Note: For this to work, you will have to keep that USB modem plugged into that particular USB port all the time. If you change it, then this will not work.

      Now, send me the output that command gives you, and I’ll try to come up with a solution (again, I cannot gurantee results though).

  3. Samusz

    Thanks for the strait tip and fix !
    I sill wonder when this laptop-mode-tool package got installed. As a dependency I guess… or is it default in lubuntu 13.04 ?

    1. Gayan Post author

      You’re welcome. Coming back to the question, no, ‘laptop-mode-tools’ does not come installed by default, but as you guessed, it must had been installed as a dependency :).

  4. streamriachuelo

    Muchas Gracias!
    Thank you very much.
    I have exactly the same mouse.
    If this problem happend with all optical mouses then we need to tell that LMT package add this bug fix from newest versions :D
    tks a lot!
    german:)

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>