Possibly you need to change the power values for your USB devices
Three possible areas to consider:
- Switching off USB power management completely
- Switching off USB suspend control on an individual device basis
- Switching off USB suspension (Natty)
Switching off USB power management completely
First we should confirm that this is really a power management issue.
Double check there are not USB power management options in your BIOS.
Boot your computer with acpi=off
as a grub-boot option. If the mouse behaves correctly then it is most likely to be a power-management issue. If it still behaves erratically file a launchpad bug report.
Two possible ways to disable all USB power-management.
- Grub boot option
usbcore.autosuspend=-1
- Installing
laptop-mode-tools
from Software center and changing /etc/laptop-mode/conf.d/usb-autosuspend.conf
:
there are various values in there to change:
CONTROL_USB_AUTOSUSPEND="auto" --> CONTROL_USB_AUTOSUSPEND="0"
AUTOSUSPEND_USBID_BLACKLIST=""
AUTOSUSPEND_USBTYPE_BLACKLIST=""
Switching off USB power management on a per device basis
Have a look at /sys/bus/usb/devices
You should see your USB hubs in the format "x-x" i.e. for my laptop I've got two "1-1" and "2-1"
Experiment by changing the power control from "auto" to "on"
i.e. source
power/control
This file contains one of two words: "on" or "auto". You can write
those words to the file to change the device's setting.
"on" means that the device should be resumed and autosuspend is not
allowed. (Of course, system suspends are still allowed.)
"auto" is the normal state in which the kernel is allowed to
autosuspend and autoresume the device.
N.B. up-until kernel 2.6.38 there was a similar value called "power/level" - this has been deprecated/removed in favour of power/control
so to change the power-control to on
sudo su
echo on > /sys/bus/usb/devices/1-1/power/control
echo on > /sys/bus/usb/devices/2-1/power/control
Then disconnect from battery.
I've read also possibly you need to use this technique directly on the usb devices themselves - in my-case "usb1" and "usb2"
sudo su
echo on > /sys/bus/usb/devices/usb1/power/control
echo on > /sys/bus/usb/devices/usb2/power/control
If this works, try forcing the power level to be "on" from boot by editing your rc.local file i.e. add the following lines before the "exit 0" in the file
[ -w /sys/bus/usb/devices/1-1/power/control ] && echo on > /sys/bus/usb/devices/1-1/power/control
[ -w /sys/bus/usb/devices/2-1/power/control ] && echo on > /sys/bus/usb/devices/2-1/power/control
or possibly:
[ -w /sys/bus/usb/devices/usb1/power/control ] && echo on > /sys/bus/usb/devices/usb1/power/control
[ -w /sys/bus/usb/devices/usb2/power/control ] && echo on > /sys/bus/usb/devices/usb2/power/control
Switching off USB suspension (Natty)
Its also worth experimenting with "power/autosuspend_delay_ms"
Setting a value of "-1" means that the usb device should never suspend i.e.
sudo su
echo -1 > /sys/bus/usb/devices/usb1/power/autosuspend_delay_ms
echo -1 > /sys/bus/usb/devices/usb2/power/autosuspend_delay_ms
or
sudo su
echo -1 > /sys/bus/1-1/devices/usb1/power/autosuspend_delay_ms
echo -1 > /sys/bus/2-1/devices/usb2/power/autosuspend_delay_ms