无线鼠标,非常奇怪的行为

无线鼠标,非常奇怪的行为

在最近一次apt full-upgrade包括内核更新之后,我现在两次遇到了一个相当奇怪的问题,更重要的是,我一生都无法弄清楚我找到的唯一解决方案如何以及为什么能够真正修复它。

现在有两次,当我在观看视频时闲置 20-30 分钟时,我的鼠标(Logitech M510,一直工作完美,我几乎可以肯定不是问题所在,正如我将在下面描述的那样)已经禁用了指针,同时保持按钮功能。

1.电池已更换,鼠标已关闭并重新打开多次,但都没有任何区别。

2.同样,移除 USB 统一接收器也不能解决问题。

3. dmesg不记录任何错误、警告。当接收器重新插入时,输出与以前一样正常:

    usb 4-1.1: USB disconnect, device number 3
    usb 4-1.1: new full-speed USB device number 5 using ehci-pci
    usb 4-1.1: New USB device found, idVendor=046d, idProduct=c52b, bcdDevice=24.07
    usb 4-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
    usb 4-1.1: Product: USB Receiver
    usb 4-1.1: Manufacturer: Logitech
    logitech-djreceiver 0003:046D:C52B.0008: hiddev0,hidraw0: USB HID v1.11 Device [Logitech USB Receiver] on usb-0000:00:1d.0-1.1/input2
    input: Logitech M510 as /devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.1/4-1.1:1.2/0003:046D:C52B.0008/0003:046D:4051.0009/input/input38
    logitech-hidpp-device 0003:046D:4051.0009: input,hidraw1: USB HID v1.11 Mouse [Logitech M510] on usb-0000:00:1d.0-1.1/input2:1
    input: Logitech K350 as /devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.1/4-1.1:1.2/0003:046D:C52B.0008/0003:046D:200A.000A/input/input39
    logitech-hidpp-device 0003:046D:200A.000A: input,hidraw2: USB HID v1.11 Keyboard [Logitech K350] on usb-0000:00:1d.0-1.1/input2:2

4. xinput test [mouse]xev响应按钮按下但不记录任何指针移动,即终端中不会记录任何内容。

5.solaar show当鼠标指针不起作用时 使用(logitech receive cli)并且当我修复它时,除了Device activity counters: 1=18, 2=12线条之外,没有显示任何差异。接收器和鼠标发生故障时的组合输出如下所示:

    Unifying Receiver
    Device path  : /dev/hidraw0
    USB id       : 046d:c52b
    Serial       : AD33D9EE
    Firmware   : 24.07.B0030
    Bootloader : 02.09
    Other      : AA.AC
    Has 2 paired device(s) out of a maximum of 6.
    Notifications: wireless, software present (0x000900)
    Device activity counters: 1=18, 2=12

    Wireless Mouse M510
     Codename     : M510v2
     Kind         : mouse
     Wireless PID : 4051
     Protocol     : HID++ 4.5
     Polling rate : 8 ms (125Hz)
     Serial number: AD33D9EE
          Firmware: RQM 62.00.B0013
     The power switch is located on the base.
     Supports 22 HID++ 2.0 features:
         0: ROOT                   {0000}   
         1: FEATURE SET            {0001}   
         2: DEVICE FW VERSION      {0003}   
         3: DEVICE NAME            {0005}   
         4: RESET                  {0020}   
         5: BATTERY STATUS         {1000}   
         6: unknown:1802           {1802}   internal, hidden
         7: unknown:1810           {1810}   internal, hidden
         8: unknown:1830           {1830}   internal, hidden
         9: unknown:1862           {1862}   internal, hidden
        10: unknown:1890           {1890}   internal, hidden
        11: unknown:18A0           {18A0}   internal, hidden
        12: unknown:18B1           {18B1}   internal, hidden
        13: REPROG CONTROLS V4     {1B04}   
        14: WIRELESS DEVICE STATUS {1D4B}   
        15: unknown:1DF0           {1DF0}   hidden
        16: unknown:1DF3           {1DF3}   internal, hidden
        17: unknown:1E00           {1E00}   hidden
        18: unknown:1EB0           {1EB0}   internal, hidden
        19: unknown:1F03           {1F03}   internal, hidden
        20: LOWRES WHEEL           {2130}   
            Wheel Reports: HID
        21: POINTER SPEED          {2205}   
            Pointer Speed: 1.0
     Has 7 reprogrammable keys:
         0: LEFT CLICK , default: LeftClick => LEFT CLICK                
             divertable, mse, pos:0, group:1, gmask:1
         1: RIGHT CLICK , default: RightClick   => RIGHT CLICK               
             divertable, mse, pos:0, group:1, gmask:1
         2: MIDDLE BUTTON , default: MiddleMouseButton  => MIDDLE BUTTON             
             divertable, mse, reprogrammable, pos:0, group:2, gmask:3
         3: LEFT SCROLL AS AC PAN , default: HorzScrollLeftSet  => LEFT SCROLL AS AC PAN     
             divertable, mse, reprogrammable, pos:0, group:2, gmask:3
         4: RIGHT SCROLL AS AC PAN , default: HorzScrollRightSet    => RIGHT SCROLL AS AC PAN    
             divertable, mse, reprogrammable, pos:0, group:2, gmask:3
         5: BACK AS BUTTON 4 , default: BackEx  => BACK AS BUTTON 4          
             divertable, mse, reprogrammable, pos:0, group:2, gmask:3
         6: FORWARD AS BUTTON 5 , default: BrowserForwardEx => FORWARD AS BUTTON 5       
             divertable, mse, reprogrammable, pos:0, group:2, gmask:3
    Battery: 90%, discharging.

当我diff在之前和之后的solaar show输出上使用时,我得到的唯一区别是:

<   Device activity counters: 1=18, 2=12
---
>   Device activity counters: 1=77, 2=212

7.我还没有尝试在问题发生时简单地重新启动系统,因为两次发生这种情况时我都在处理事情,而保留数据是首要任务。话虽这么说,如果重新启动没有恢复指针功能,我会感到非常惊讶。

8. 最后,我不明白为什么我能够在不重新启动的情况下修复此会话中途的唯一方法是运行:

    sudo modprobe -r psmouse

我最初的目标是运行sudo modprobe -r psmouse然后sudo modprobe psmouse重新加载它,但简单地删除psmouse模块就已经恢复了功能。运行lsmod | grep -i mouse列出没有psmouse或任何其他*mouse*模块(psmouse是第一个也是迄今为止唯一我尝试重新加载的与鼠标相关的模块)。

这让我认为控制无线键盘和鼠标的内核模块之间可能存在某种干扰,可能与睡眠和电源管理有关(但是,当错误发生时,这些psmouse值似乎是相同的,并且当它固定时),但我也从未听说过选择性唤醒无源外围设备。hid_logitech_hidpp/sys/device/[mouse]/power/*

最后,虽然黑名单psmouse可以防止这种情况再次发生,但我对这样做作为解决方案持谨慎态度,因为据我所知,它最终会导致有线鼠标无法被识别,而无需首先加载模块psmouse

有什么想法、在哪里寻找来缩小这种行为的原因吗?

$ lsmod | grep hid
 hid_logitech_hidpp     45056  0
 hid_logitech_dj        28672  0
 hid_generic            16384  0
 usbhid                 65536  1 hid_logitech_dj
 hid                   139264  4 usbhid,hid_generic,hid_logitech_dj,hid_logitech_hidpp
 usbcore               299008  8 xhci_hcd,ehci_pci,usbhid,ehci_hcd,xhci_pci

以及清单dpkg --list | grep -i libhid

ii  libhidapi-dev:amd64                                         0.9.0+dfsg-1                         amd64        Multi-Platform library for communication with HID devices (development files)
ii  libhidapi-hidraw0:amd64                                     0.9.0+dfsg-1                         amd64        Multi-Platform library for communication with HID devices (hidraw backend)
ii  libhidapi-libusb0:amd64                                     0.9.0+dfsg-1                         amd64        Multi-Platform library for communication with HID devices (libusb backend)
ii  libhidrd0:amd64                                             0.2.0-11                             amd64        runtime library for parsing and generating USB HID reports
ii  libhidrd0-dev:amd64                                         0.2.0-11                             amd64        development files for parsing and generating USB HID reports

更新

以下是solaar -dd我在找到一致重现此错误的方法后收集到的一些额外日志。

第一个与当前电池状态及其相应的通知有关。虽然不太可能,但这可能仍然与原因有关,因为说实话,我不记得以前可用的鼠标电池状态,现在可以对其进行轮询。但是,当鼠标正常工作时,此错误通知确实会重复出现,因此我对此表示怀疑。

 WARNING [ReceiverListener:hidraw1] logitech_receiver.status: <PairedDevice(1,4051,M510v2)>: battery 70%, ALERT invalid battery
   ERROR [ReceiverListener:hidraw1] logitech_receiver.listener: processing Notification(1,05,00,46050000000000000000000000000000)
 Traceback (most recent call last):
  File "/usr/share/solaar/lib/logitech_receiver/listener.py", line 185, in run
    self._notifications_callback(n)
  File "/usr/share/solaar/lib/solaar/listener.py", line 220, in _notifications_handler
    _notifications.process(dev, n)
  File "/usr/share/solaar/lib/logitech_receiver/notifications.py", line 54, in process
    return _process_device_notification(device, status, notification)
  File "/usr/share/solaar/lib/logitech_receiver/notifications.py", line 115, in _process_device_notification
    return _process_feature_notification(device, status, n, feature)
  File "/usr/share/solaar/lib/logitech_receiver/notifications.py", line 209, in _process_feature_notification
    status.set_battery_info(discharge, _hidpp20.BATTERY_STATUS[battery_status])
  File "/usr/share/solaar/lib/logitech_receiver/status.py", line 205, in set_battery_info
    reason = _("Battery: %(percent)d%% (%(status)s)") % { 'percent': level, 'status': _(status) }
  File "/usr/share/solaar/lib/logitech_receiver/i18n.py", line 29, in <lambda>
    _ = lambda x: _gettext.gettext(x).decode('UTF-8')
AttributeError: 'NamedInt' object has no attribute 'decode'
  1. 第二条日志目前很难阅读,但我想一旦我解码了六边形 hidpp 通信,我就会知道接收器实际上想对鼠标做什么。目前看来接收方要么正在发送,要么正在接收(还没有弄清楚它的方向,并且w[] and the r[])响应相同)r[10 01 8F00 0F0900]

    18:55:44,573  WARNING [ReceiverListener:hidraw1] logitech_receiver.base: timeout (4.00/4.00) on device 1 request {000F} params [2120]
    18:55:44,573        DEBUG [ReceiverListener:hidraw1] logitech_receiver.base: (15) <= w[10 01 000F 212100]
    18:55:44,577        DEBUG [ReceiverListener:hidraw1] logitech_receiver.base: (15) => r[10 01 8F00 0F0900]
    18:55:44,577        DEBUG [ReceiverListener:hidraw1] logitech_receiver.base: (15) device 0x01 error on request {000F}: 9 = resource error
    18:55:44,577        DEBUG [ReceiverListener:hidraw1] logitech_receiver.base: (15) <= w[10 01 000A 212100]
    18:55:44,579        DEBUG [ReceiverListener:hidraw1] logitech_receiver.base: (15) => r[20 02 4101 0A201A4000000400000000]
    18:55:44,581        DEBUG [ReceiverListener:hidraw1] logitech_receiver.base: (15) => r[20 00 4102 0000000000000000000000]
    18:55:44,583        DEBUG [ReceiverListener:hidraw1] logitech_receiver.base: (15) => r[10 01 8F00 0A0900]
    18:55:44,583        DEBUG [ReceiverListener:hidraw1] logitech_receiver.base: (15) device 0x01 error on request {000A}: 9 = resource error
    18:55:44,583        DEBUG [ReceiverListener:hidraw1] logitech_receiver.base: (15) <= w[10 01 000C 40A000]
    18:55:44,585        DEBUG [ReceiverListener:hidraw1] logitech_receiver.base: (15) => r[10 01 8F00 0C0900]
    18:55:44,585        DEBUG [ReceiverListener:hidraw1] logitech_receiver.base: (15) device 0x01 error on request {000C}: 9 = resource error
    18:55:44,585        DEBUG [ReceiverListener:hidraw1] logitech_receiver.base: (15) <= w[10 01 0009 40A200]
    18:55:44,587        DEBUG [ReceiverListener:hidraw1] logitech_receiver.base: (15) => r[10 01 8F00 090900]
    18:55:44,587        DEBUG [ReceiverListener:hidraw1] logitech_receiver.base: (15) device 0x01 error on request {0009}: 9 = resource error
    18:55:44,587        DEBUG [ReceiverListener:hidraw1] logitech_receiver.base: (15) <= w[10 01 0008 40A300]
    18:55:44,589        DEBUG [ReceiverListener:hidraw1] logitech_receiver.base: (15) => r[10 01 8F00 080900]
    18:55:44,589        DEBUG [ReceiverListener:hidraw1] logitech_receiver.base: (15) device 0x01 error on request {0008}: 9 = resource error
    18:55:44,589        DEBUG [ReceiverListener:hidraw1] logitech_receiver.base: (15) <= w[10 01 000C 220100]
    18:55:44,591        DEBUG [ReceiverListener:hidraw1] logitech_receiver.base: (15) => r[10 01 8F00 0C0900]
    18:55:44,591        DEBUG [ReceiverListener:hidraw1] logitech_receiver.base: (15) device 0x01 error on request {000C}: 9 = resource error
    18:55:44,591        DEBUG [ReceiverListener:hidraw1] logitech_receiver.base: (15) <= w[10 01 000C 211000]
    18:55:44,593        DEBUG [ReceiverListener:hidraw1] logitech_receiver.base: (15) => r[10 01 8F00 0C0900]
    18:55:44,593        DEBUG [ReceiverListener:hidraw1] logitech_receiver.base: (15) device 0x01 error on request {000C}: 9 = resource error 
    
  2. 最后,即使当我尝试取消配对然后将 nouse 重新配对时,它仍然不起作用,并且调试日志显示这些行:

    INFO [ReceiverListener:hidraw1] solaar.listener: Notification(2,41,04,B10A20) triggered new device <PairedDevice(2,200A,K350)> (keyboard) 
    INFO [ReceiverListener:hidraw1] solaar.listener: status_changed <UnifyingReceiver(/dev/hidraw1,15)>: present, 1 paired device. (0) 
    DEBUG [ReceiverListener:hidraw1] logitech_receiver.notifications: <PairedDevice(2,200A,K350)>: unifying (eQuad DJ) connection notification: software=True, encrypted=True, link=True, payload=True 
    INFO [ReceiverListener:hidraw1] solaar.listener: status_changed <PairedDevice(2,200A,K350)>: paired online, {'BATTERY LEVEL': NamedInt(90, 'full'), 'BATTERY CHARGING': False, 'BATTERY STATUS': NamedInt(0, 'discharging'), 'LINK ENCRYPTED': True, 'NOTIFICATION FLAGS': 1048576, 'ERROR': None} (0)
    WARNING [ReceiverListener:hidraw1] logitech_receiver.notifications: <PairedDevice(2,200A,K350)>: unrecognized Notification(2,42,00,0000000000000000000000) 
    DEBUG [ReceiverListener:hidraw1] logitech_receiver.base: (15) <= w[10 FF 83B5 200000] 
    DEBUG [ReceiverListener:hidraw1] logitech_receiver.base: (15) => r[10 FF 8F83 B50300] 
    DEBUG [ReceiverListener:hidraw1] logitech_receiver.base: (15) device 0xFF error on request {83B5}: 3 = invalid value 
    DEBUG [ReceiverListener:hidraw1] logitech_receiver.base: (15) <= w[10 FF 83B5 040000] 
    DEBUG [ReceiverListener:hidraw1] logitech_receiver.base: (15) => r[10 FF 8F83 B50300] 
    DEBUG [ReceiverListener:hidraw1] logitech_receiver.base: (15) device 0xFF error on request {83B5}: 3 = invalid value 
    ERROR [ReceiverListener:hidraw1] logitech_receiver.receiver: failed to read Nano wpid for device 1 of <UnifyingReceiver(/dev/hidraw1,15)> 
    ERROR [ReceiverListener:hidraw1] logitech_receiver.receiver: register_new_device 
    Traceback (most recent call last):
      File "/usr/share/solaar/lib/logitech_receiver/receiver.py", line 415, in register_new_device
            dev = PairedDevice(self, number, notification)
      File "/usr/share/solaar/lib/logitech_receiver/receiver.py", line 103, in __init__
            raise _base.NoSuchDevice(number=number, receiver=receiver, error="read Nano wpid")
    NoSuchDevice: {'error': u'read Nano wpid', 'number': 1, 'receiver': <UnifyingReceiver(/dev/hidraw1,15)>}
    WARNING [ReceiverListener:hidraw1] logitech_receiver.receiver: <UnifyingReceiver(/dev/hidraw1,15)>: looked for device 1, not found
    WARNING [ReceiverListener:hidraw1] solaar.listener: <UnifyingReceiver(/dev/hidraw1,15)>: received Notification(1,40,00,0000000000000000000000) for invalid device 1: None`
    

相关内容