Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I just bought a HP wireless mouse, but I'm having some issues.

The cursor frequently becomes non-responsive to mouse movements. I noticed that it only happens on my laptop when it is running off the battery and whenever the mouse isn't moved for say 20-30 seconds, I then have to touch the laptops touch-pad to get the mouse to reconnect.

So it looks like it maybe power-management is interfering but I'm not really sure how to troubleshoot this.

Edit : An important piece of info which I completely forgot mention is that I didn't have this problem with my previous Sweex MI420 wireless mouse .

$ dmesg |grep -i mouse:

[    1.279240] mousedev: PS/2 mouse device common for all mice
[    2.205885] input: HP HP Wireless Laser Comfort Mouse as /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.0/input/input5
[    2.206071] generic-usb 0003:03F0:8501.0001: input,hiddev0,hidraw0: USB HID v1.11 Mouse [HP HP Wireless Laser Comfort Mouse] on usb-0000:00:1a.0-1.2/input0

$ ls /sys/bus/usb/devices:

1-0:1.0
1-1
1-1.1
1-1:1.0
1-1.1:1.0
1-1.1:1.1
1-1.2
1-1.2:1.0
2-0:1.0
2-1
2-1:1.0
usb1
usb2
share|improve this question
    
You have mentioned in your question title that the laptop is on battery...do you get the same issue if you remove the battery and run straight off of AC power? –  Christopher Kyle Horton Sep 21 '11 at 0:41
    
Runs fine when on AC or on my desktop –  volting Sep 21 '11 at 8:05

2 Answers 2

Possibly you need to change the power values for your USB devices

Three possible areas to consider:

  1. Switching off USB power management completely
  2. Switching off USB suspend control on an individual device basis
  3. 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.

  1. Grub boot option usbcore.autosuspend=-1
  2. 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

enter image description here

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
share|improve this answer
    
Thanks for your reply. I tried changing the power levels as you suggested on 1-1 2-1 and usb1 and usb2, but the problem persists, I edited the orignal question to show the ls of usb devices... –  volting Sep 25 '11 at 15:23
    
Actually its seems like it may have helped a little, It still loses connection but It will reconnect after moving the mouse around for about 20 seconds, which is still unacceptable but a step in the right direction. –  volting Sep 25 '11 at 15:36
    
tried both methods from edit 2 but they didnt seem to make any difference. –  volting Sep 25 '11 at 16:12
    
Something which forgot to mention is that I never had this problem with my previous wireless mouse. –  volting Sep 25 '11 at 16:16
    
Unfortunately that didn't seem to make any difference. I added a link for the mouse in the question. –  volting Sep 25 '11 at 17:25
up vote 4 down vote accepted

I fixed the problem by changing a setting in /etc/laptop-mode/conf.d/usb-autosuspend.conf

According to a comment in the config file, some USB devices don't correctly support autosuspend.

Theres an option in the config AUTOSUSPEND_USBID_BLACKLISTto add a list of USB device IDs for offending devices , I added the ID for the mouse and now it works without issues.

#
# Configuration file for Laptop Mode Tools module usb-autosuspend.
#
# For more information, consult the laptop-mode.conf(8) manual page.
#


###############################################################################
# USB autosuspend settings
# ------------------------
#
# If you enable this setting, laptop mode tools will automatically enable the
# USB autosuspend feature for all devices.
#
# NOTE: Some USB devices claim they support autosuspend, but implement it in a
# broken way. This can mean keyboards losing keypresses, or optical mice turning
# their LED completely off. If you have a device that misbehaves, add its USB ID
# to the blacklist below and complain to your hardware vendor.
################################################################################

# Enable debug mode for this module
# Set to 1 if you want to debug this module
DEBUG=0

# Enable USB autosuspend feature?
# Set to 0 to disable
CONTROL_USB_AUTOSUSPEND="auto"

# The list of USB IDs that should not use autosuspend. Use lsusb to find out the
# IDs of your USB devices.
# Example: AUTOSUSPEND_USBID_BLACKLIST="046d:c025 0123:abcd"
AUTOSUSPEND_USBID_BLACKLIST="03f0:8501"

# The list of USB driver types that should not use autosuspend.  The driver
# type is given by "DRIVER=..." in a USB device's uevent file.
# Example: AUTOSUSPEND_USBID_BLACKLIST="usbhid usb-storage"
AUTOSUSPEND_USBTYPE_BLACKLIST=""

# Trigger auto-suspension of the USB deivce under conditional circumstances
BATT_SUSPEND_USB=1
LM_AC_SUSPEND_USB=0
NOLM_AC_SUSPEND_USB=0

# USB Auto-Suspend timeout in seconds
# Number of seconds after which the USB devices should suspend
AUTOSUSPEND_TIMEOUT=2
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.