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