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

    by  • June 19, 2012 • Ubuntu • 12 Comments

    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 :) .

    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.

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

    1. June 23, 2012 at 5:44 am

      Thank's for this article :)

      • Gayan
        June 25, 2012 at 7:41 pm

        You are welcome 'Karim'.

    2. Ethan
      July 8, 2012 at 3:05 am

      Thanks a lot! Very straightforward and precise. Keep it up!

      • Gayan
        July 8, 2012 at 12:56 pm

        I'll try my best, thanks 'Ethan'! :) .

    3. November 7, 2012 at 6:45 am

      Thanks man! Solved my problem. :)

      • Gayan
        November 7, 2012 at 7:58 am

        No problem mate :) .

    4. MikeP
      November 13, 2012 at 10:16 pm

      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?

      • Gayan
        November 14, 2012 at 8:08 am

        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.

    5. August
      November 23, 2012 at 8:03 pm

      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)

      • Gayan
        November 24, 2012 at 9:58 am

        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).

    6. Emil
      November 30, 2012 at 1:03 am

      Great tip! Helped me! Pls publish this on Ubuntu official forums!

      • Gayan
        November 30, 2012 at 8:13 am

        Thanks ‘Emil’.

    Leave a Reply

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