Air Mouse sometimes not working

Questions about hardware, drivers and peripherals
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
User avatar
NeroR
Level 2
Level 2
Posts: 68
Joined: Fri Oct 26, 2018 4:32 pm

Air Mouse sometimes not working

Post by NeroR »

Beside a Logitech K400 Plus keyboard (and sometimes a SpeedLink game pad) I use a Xoro AMW 100 Gyroscope Air Mouse at my PC (Linux Mint 19 Xfce).
Sometimes the Airmouse is working. Sometimes (often) not.
If it's not working, I have to wait about 1 Minute and then it is working again.

Like just now: I've booted my PC. The air mouse was working. I started Kodi, started a playlist. Everything was fine. After a few minutes I'd to skip a song but the air mouse was not working. After ca. 1 minute I tried it again and it was OK.
The problem it's IMHO not about distance or bad pairing. The distance is 2 or 3 meters. If it is working, it's working fine.
The problem is also on both sides, mouse pointer and keyboard. It's clear to me that the air mouse goes into sleep mode and to wake it up I have to press any key before. It's also clear to me how to hide and activate the mouse pointer. It it's not working, everything is not working (mouse pointer, keyboard and microphone).
Even if the device is currently not working, it is listed on usb-devices.
The device is working at 2.4 GHz. It's also known as Air Mouse C120 (IMHO the same model).

Code: Select all

~$ usb-devices

T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=480 MxCh= 9
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=1d6b ProdID=0002 Rev=04.15
S:  Manufacturer=Linux 4.15.0-42-generic xhci-hcd
S:  Product=xHCI Host Controller
S:  SerialNumber=0000:00:15.0
C:  #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=0mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub

T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=480 MxCh= 0
D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=058f ProdID=6366 Rev=01.00
S:  Manufacturer=Generic
S:  Product=Flash Card Reader/Writer
S:  SerialNumber=058F63666438
C:  #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=100mA
I:  If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage

T:  Bus=01 Lev=01 Prnt=01 Port=04 Cnt=02 Dev#=  3 Spd=480 MxCh= 4
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=1a40 ProdID=0101 Rev=01.11
S:  Product=USB 2.0 Hub
C:  #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=100mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub

T:  Bus=01 Lev=02 Prnt=03 Port=00 Cnt=01 Dev#=  5 Spd=12  MxCh= 0
D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=0c45 ProdID=52f4 Rev=10.01
S:  Manufacturer=AliTV Remote V1
S:  Product=Airmouse
C:  #Ifs= 6 Cfg#= 1 Atr=a0 MxPwr=100mA
I:  If#= 0 Alt= 0 #EPs= 0 Cls=01(audio) Sub=01 Prot=00 Driver=snd-usb-audio
I:  If#= 1 Alt= 0 #EPs= 0 Cls=01(audio) Sub=02 Prot=00 Driver=snd-usb-audio
I:  If#= 2 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=01 Prot=01 Driver=usbhid
I:  If#= 3 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=01 Prot=02 Driver=usbhid
I:  If#= 4 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=01 Prot=02 Driver=usbhid
I:  If#= 5 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=01 Prot=02 Driver=usbhid

T:  Bus=01 Lev=02 Prnt=03 Port=02 Cnt=02 Dev#=  6 Spd=12  MxCh= 0
D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=32 #Cfgs=  1
P:  Vendor=046d ProdID=c52b Rev=24.07
S:  Manufacturer=Logitech
S:  Product=USB Receiver
C:  #Ifs= 3 Cfg#= 1 Atr=a0 MxPwr=98mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=01 Prot=01 Driver=usbhid
I:  If#= 1 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=01 Prot=02 Driver=usbhid
I:  If#= 2 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=00 Prot=00 Driver=usbhid

T:  Bus=01 Lev=02 Prnt=03 Port=03 Cnt=03 Dev#=  7 Spd=12  MxCh= 0
D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=1a34 ProdID=0809 Rev=01.00
S:  Manufacturer=SL
S:  Product=SL-6566
C:  #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=100mA
I:  If#= 0 Alt= 0 #EPs= 2 Cls=03(HID  ) Sub=00 Prot=00 Driver=usbhid

T:  Bus=01 Lev=01 Prnt=01 Port=07 Cnt=03 Dev#=  4 Spd=12  MxCh= 0
D:  Ver= 2.00 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=8087 ProdID=0025 Rev=00.02
C:  #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA
I:  If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
I:  If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb

T:  Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=5000 MxCh= 7
D:  Ver= 3.00 Cls=09(hub  ) Sub=00 Prot=03 MxPS= 9 #Cfgs=  1
P:  Vendor=1d6b ProdID=0003 Rev=04.15
S:  Manufacturer=Linux 4.15.0-42-generic xhci-hcd
S:  Product=xHCI Host Controller
S:  SerialNumber=0000:00:15.0
C:  #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=0mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
What can I do?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
rbmorse

Re: Air Mouse sometimes not working

Post by rbmorse »

You might be the victim of the USB autosuspend function. It's designed to save power
by disconnecting unused USB devices after a specific interval. Some devices don't
know how to wake back up after they've been autosuspended.

run this command from a terminal:

Code: Select all

cat /sys/module/usbcore/parameters/autosuspend
and tell us the output (probably the number "2")
User avatar
NeroR
Level 2
Level 2
Posts: 68
Joined: Fri Oct 26, 2018 4:32 pm

Re: Air Mouse sometimes not working

Post by NeroR »

rbmorse wrote: Thu Dec 13, 2018 10:41 pm You might be the victim of the USB autosuspend function. It's designed to save power
by disconnecting unused USB devices after a specific interval. Some devices don't
know how to wake back up after they've been autosuspended.

run this command from a terminal:

Code: Select all

cat /sys/module/usbcore/parameters/autosuspend
and tell us the output (probably the number "2")
Yea, I also suppose it has something to do with autosuspend (which I find out now), but for me this is totally new.

You are right, my autosuspend-value is "2"
User avatar
NeroR
Level 2
Level 2
Posts: 68
Joined: Fri Oct 26, 2018 4:32 pm

Re: Air Mouse sometimes not working

Post by NeroR »

My air mouse is Dev 5 (it's more easy readable in the tree view).

Code: Select all

$ lsusb -t
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/7p, 5000M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/9p, 480M
    |__ Port 1: Dev 2, If 0, Class=Mass Storage, Driver=usb-storage, 480M
    |__ Port 5: Dev 3, If 0, Class=Hub, Driver=hub/4p, 480M
        |__ Port 1: Dev 5, If 4, Class=Human Interface Device, Driver=usbhid, 12M
        |__ Port 1: Dev 5, If 2, Class=Human Interface Device, Driver=usbhid, 12M
        |__ Port 1: Dev 5, If 0, Class=Audio, Driver=snd-usb-audio, 12M
        |__ Port 1: Dev 5, If 5, Class=Human Interface Device, Driver=usbhid, 12M
        |__ Port 1: Dev 5, If 3, Class=Human Interface Device, Driver=usbhid, 12M
        |__ Port 1: Dev 5, If 1, Class=Audio, Driver=snd-usb-audio, 12M
        |__ Port 3: Dev 6, If 0, Class=Human Interface Device, Driver=usbhid, 12M
        |__ Port 3: Dev 6, If 1, Class=Human Interface Device, Driver=usbhid, 12M
        |__ Port 3: Dev 6, If 2, Class=Human Interface Device, Driver=usbhid, 12M
        |__ Port 4: Dev 7, If 0, Class=Human Interface Device, Driver=usbhid, 12M
    |__ Port 8: Dev 4, If 1, Class=Wireless, Driver=btusb, 12M
    |__ Port 8: Dev 4, If 0, Class=Wireless, Driver=btusb, 12M
This is Vendor=0c45 ProdID=52f4 (as I can see in the output of usb-devices).


I also checked dmesg, but this doesn't help me.

Code: Select all

[    3.047623] usb 1-5.1: New USB device found, idVendor=0c45, idProduct=52f4
[    3.047625] usb 1-5.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    3.047626] usb 1-5.1: Product: Airmouse
[    3.047627] usb 1-5.1: Manufacturer: AliTV Remote V1
...
[    3.521402] input: AliTV Remote V1 Airmouse as /devices/pci0000:00/0000:00:15.0/usb1/1-5/1-5.1/1-5.1:1.2/0003:0C45:52F4.0001/input/input2
[    3.521750] logitech-djreceiver 0003:046D:C52B.0007: hiddev0,hidraw0: USB HID v1.11 Device [Logitech USB Receiver] on usb-0000:00:15.0-5.3/input2
[    3.580335] hid-generic 0003:0C45:52F4.0001: input,hidraw1: USB HID v1.10 Keyboard [AliTV Remote V1 Airmouse] on usb-0000:00:15.0-5.1/input2
[    3.580444] input: AliTV Remote V1 Airmouse as /devices/pci0000:00/0000:00:15.0/usb1/1-5/1-5.1/1-5.1:1.3/0003:0C45:52F4.0002/input/input3
[    3.580749] hid-generic 0003:0C45:52F4.0002: input,hidraw2: USB HID v1.10 Mouse [AliTV Remote V1 Airmouse] on usb-0000:00:15.0-5.1/input3
[    3.581012] hid-generic 0003:0C45:52F4.0003: hiddev1,hidraw3: USB HID v1.10 Device [AliTV Remote V1 Airmouse] on usb-0000:00:15.0-5.1/input4
[    3.581146] input: AliTV Remote V1 Airmouse as /devices/pci0000:00/0000:00:15.0/usb1/1-5/1-5.1/1-5.1:1.5/0003:0C45:52F4.0004/input/input4
[    3.581283] hid-generic 0003:0C45:52F4.0004: input,hidraw4: USB HID v1.10 Gamepad [AliTV Remote V1 Airmouse] on usb-0000:00:15.0-5.1/input5
User avatar
MrEen
Level 23
Level 23
Posts: 18343
Joined: Mon Jun 12, 2017 8:39 pm

Re: Air Mouse sometimes not working

Post by MrEen »

Hi NeroR.

This is not an area I'm very experienced in, but I can help a little. I'm using 18.3 Xfce, and I think there's an error in the system that may be fixed in 19 or not, so we'll test some parameters before making changes.

Based on your lsusb (bus 1 device 5) the proper location should be /sys/bus/usb/devices/usb1/1-4/ (device 1 would be /sys/bus/usb/devices/usb1/1-0/) so if cat /sys/bus/usb/devices/usb1/1-4/idVendor returns 0c45, then we know the correct location.

Now I have a USB midi keyboard that lsusb shows as bus 3 device 3, but I find its idVendor in /sys/bus/usb/devices/usb3/3-4/ which makes no sense, while my computer keyboard is bus 3 device 2 and find its idVendor in /sys/bus/usb/devices/usb3/3-2/idVendor which is closer, but still wrong.

That's just my way of saying if cat /sys/bus/usb/devices/usb1/1-4/idVendor does not return 0c45, then try cat /sys/bus/usb/devices/usb1/1-5/idVendor or cat /sys/bus/usb/devices/usb1/1-6/idVendor until one returns the proper vendor id.

Now, assuming the very first one was the correct one, we need to check the properties of it with cat /sys/bus/usb/devices/usb1/1-4/power/control. If that returns on, then you're not having an issue with autosuspend and can forget this line of inquiry. If the return is auto however, autosuspend may very well be the problem.

To turn off autosuspend for that device during the present session, use the following (but don't forget to change the numbers if you found the correct idVendor in a different folder):

Code: Select all

echo 'on' | sudo tee /sys/bus/usb/devices/usb1/1-4/power/control
Now, if the problem goes away after doing all that, you'll want to make it permanent so you don't have to go through all that after each reboot. Here's how:

1. In the terminal enter xed admin:///etc/udev/rules.d/usb-power.rules
2. When the file opens, enter the following:

Code: Select all

#Air Mouse autosuspend fix
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="0c45", ATTR{idProduct}=="52f4", TEST=="power/control", ATTR{power/control}="on"
3. Save the file.
4. Reboot.
5. Check that the fix stuck with cat /sys/bus/usb/devices/usb1/1-4/power/control that should return on
6. Hopefully, enjoy your unsuspending mouse forevermore.

Good luck.
User avatar
NeroR
Level 2
Level 2
Posts: 68
Joined: Fri Oct 26, 2018 4:32 pm

Re: Air Mouse sometimes not working

Post by NeroR »

Many thanks, MrEen!

I find my air-mouse receiver at sysfs structure /sys/bus/usb/devices/1-5.1 (IMHO the best notation, without redundancies; direct and shortest way, equal to /sys/bus/usb/devices/usb1/1-5/1-5.1 and other ways).
This means: Bus 1, Port 5 (= external hub), Port 1 (= where the receiver is plugged in) - see output of lsusb -t.
Note: It's not about the Device but only the Port, where it is plugged in. [You can verify the device with cat /sys/bus/usb/devices/1-5.1/devnum].
See Linux USB FAQ: What are the sysfs structures for Linux USB?

Code: Select all

$ cat /sys/bus/usb/devices/1-5.1/product
Airmouse

However, it seems not to be a problem with autosuspend, because the power-control value is "on".

Code: Select all

$ cat /sys/bus/usb/devices/1-5.1/power/control
on

Hopefully I still find a solution for my problem.
User avatar
MrEen
Level 23
Level 23
Posts: 18343
Joined: Mon Jun 12, 2017 8:39 pm

Re: Air Mouse sometimes not working

Post by MrEen »

AHA. So you're using a hub!

What does cat /sys/bus/usb/devices/1-5/power/control return? Maybe the hub is being autosuspended.
User avatar
AZgl1800
Level 20
Level 20
Posts: 11173
Joined: Thu Dec 31, 2015 3:20 am
Location: Oklahoma where the wind comes Sweeping down the Plains
Contact:

Re: Air Mouse sometimes not working

Post by AZgl1800 »

none of the 'system fixes' are permanent after you reboot.

I had to do it with Grub to make it stick permanently.

GRUB_CMDLINE_LINUX_DEFAULT="pci=nomsi ipv6.disable=1 usbcore.autosuspend=-1 enable_mtrr_cleanup mtrr_spare_reg_nr=10 mtrr_gran_size=32M mtrr_chunk_size=64M"

start reading at "usbcore.autosuspend=-1"

the rest of that line is to disable ipv6
and fix a memory issue for this laptop
and I forget what "pci=nomsi" is for

google says:
Message Signaled Interrupts (MSI and MSI-X) (PCI_MSI)

This allows device drivers to enable MSI (Message Signaled
Interrupts). Message Signaled Interrupts enable a device to
generate an interrupt using an inbound Memory Write on its
PCI bus instead of asserting a device IRQ pin.

Use of PCI MSI interrupts can be disabled at kernel boot time
by using the 'pci=nomsi' option. This disables MSI for the
entire system.
LM21.3 Cinnamon ASUS FX705GM | Donate to Mint https://www.patreon.com/linux_mint
Image
User avatar
NeroR
Level 2
Level 2
Posts: 68
Joined: Fri Oct 26, 2018 4:32 pm

Re: Air Mouse sometimes not working

Post by NeroR »

MrEen wrote: Sat Dec 15, 2018 5:33 pm AHA. So you're using a hub!

What does cat /sys/bus/usb/devices/1-5/power/control return? Maybe the hub is being autosuspended.
The hub is using autosuspended.

Code: Select all

$ cat /sys/bus/usb/devices/1-5/power/control
auto

However, it should not be a problem of the external hub, because I had the same problem also while I've connected the USB receiver directly to my front USB port.
At the beginning I used the front USB Port (3.0) but I need this port for other purposes (connecting USB flash drives) and so I've added a hub.
User avatar
MrEen
Level 23
Level 23
Posts: 18343
Joined: Mon Jun 12, 2017 8:39 pm

Re: Air Mouse sometimes not working

Post by MrEen »

NeroR wrote: Sat Dec 15, 2018 6:06 pm
MrEen wrote: Sat Dec 15, 2018 5:33 pm AHA. So you're using a hub!

What does cat /sys/bus/usb/devices/1-5/power/control return? Maybe the hub is being autosuspended.
The hub is using autosuspended.

Code: Select all

$ cat /sys/bus/usb/devices/1-5/power/control
auto

However, it should not be a problem of the external hub, because I had the same problem also while I've connected the USB receiver directly to my front USB port.
At the beginning I used the front USB Port (3.0) but I need this port for other purposes (connecting USB flash drives) and so I've added a hub.
Just to be sure does echo 'on' | sudo tee /sys/bus/usb/devices/usb1/1-5/power/control fix the issue? It's a simple to change test and won't even survive a reboot.
User avatar
NeroR
Level 2
Level 2
Posts: 68
Joined: Fri Oct 26, 2018 4:32 pm

Re: Air Mouse sometimes not working

Post by NeroR »

MrEen wrote: Sat Dec 15, 2018 6:32 pm Just to be sure does echo 'on' | sudo tee /sys/bus/usb/devices/usb1/1-5/power/control fix the issue? It's a simple to change test and won't even survive a reboot.
Unfortunately not! :(

I've deactivated autosuspend for my hub and later also for the whole bus but it doesn't fix my problem.

Code: Select all

$ cat /sys/bus/usb/devices/1-5.1/power/control
on
$ cat /sys/bus/usb/devices/1-5/power/control
on
$ cat /sys/bus/usb/devices/usb1/power/control
on

Maybe I'll buy a new air mouse (with keyboard) but it's not easy to find a model with (a useful) German QWERTZ layout. Even the quite expensive Rii Mini i25 (EUR 35.90), which doesn't look so bad, has a big issue: no Tab-Key and therefore it's not good for Kodi.
User avatar
NeroR
Level 2
Level 2
Posts: 68
Joined: Fri Oct 26, 2018 4:32 pm

Re: Air Mouse sometimes not working

Post by NeroR »

AZgl1500 wrote: Sat Dec 15, 2018 5:46 pm GRUB_CMDLINE_LINUX_DEFAULT="pci=nomsi ipv6.disable=1 usbcore.autosuspend=-1 enable_mtrr_cleanup mtrr_spare_reg_nr=10 mtrr_gran_size=32M mtrr_chunk_size=64M"

start reading at "usbcore.autosuspend=-1"

...

google says:
Message Signaled Interrupts (MSI and MSI-X) (PCI_MSI)
Did you do this also for an air mouse (or another HID)?
Did you set MSI also for fixing your problem with your USB device and do you think I should set it also?
Locked

Return to “Hardware Support”