pwr-Solaar / Solaar

Linux device manager for Logitech devices
https://pwr-solaar.github.io/Solaar
GNU General Public License v2.0
5.56k stars 411 forks source link

Disabling side-scrolling breaks mouse events in KDE #115

Closed Lekensteyn closed 11 years ago

Lekensteyn commented 11 years ago

I got the Anywhere MX from Nestor (from Logitech) and decided to test some things. While doing so, I noticed that the "Side-scrolling" option does more than advertised.

Initially I used the Solaar GUI to toggle settings, but changing the side-scrolling setting breaks.

In KDE 4.11 (Linux 3.11-rc6), it moves the mouse pointer, but window focus and clicks are not registered.

Here is an annotated usbmon log (using ./read-dev-usbmon /dev/usbmon3, from ltunify's repo):

Moving with mouse, note the params=00 00 ...

23:18:07.754 Recv       report_id=20 unkn  device=01 DEV1 type=02 MOUSE                   params=00 00 FF 0F  00 00 00 00  00 00 00 00 
23:18:07.762 Recv       report_id=20 unkn  device=01 DEV1 type=02 MOUSE                   params=00 00 00 F0  FF 00 00 00  00 00 00 00 
23:18:07.768 Recv       report_id=20 unkn  device=01 DEV1 type=02 MOUSE                   params=00 00 FF 0F  00 00 00 00  00 00 00 00 
23:18:07.778 Recv       report_id=20 unkn  device=01 DEV1 type=02 MOUSE                   params=00 00 FF FF  FF 00 00 00  00 00 00 00 
23:18:07.810 Recv       report_id=20 unkn  device=01 DEV1 type=02 MOUSE                   params=00 00 00 F0  FF 00 00 00  00 00 00 00 
23:18:08.042 Recv       report_id=20 unkn  device=01 DEV1 type=02 MOUSE                   params=00 00 FF 0F  00 00 00 00  00 00 00 00 
23:18:08.154 Recv       report_id=20 unkn  device=01 DEV1 type=02 MOUSE                   params=00 00 00 10  00 00 00 00  00 00 00 00 

Run solaar -d -D /dev/hidraw0 config 1 side-scroll False

23:18:11.574 Send       report_id=10 short device=FF RECV type=83 GET_LONG_REG            reg=B5 PAIRING_INFO  params=03 00 00 
23:18:11.578 Recv       report_id=11 long  device=FF RECV type=83 GET_LONG_REG            reg=B5 PAIRING_INFO  params=03 D1 75 96  14 01 06 07  00 00 00 00  00 00 00 00 
23:18:11.578 Send       report_id=10 short device=FF RECV type=80 SET_REG                 reg=B2 DEVICE_PAIRING  params=00 00 00 
23:18:11.582 Recv       report_id=10 short device=FF RECV type=8F _ERROR_MSG              SubID=80 SET_REG  reg=B2 DEVICE_PAIRING  err=03 INVALID_VALUE  
23:18:11.599 Send       report_id=10 short device=FF RECV type=83 GET_LONG_REG            reg=B5 PAIRING_INFO  params=20 00 00 
23:18:11.604 Recv       report_id=11 long  device=FF RECV type=83 GET_LONG_REG            reg=B5 PAIRING_INFO  params=20 07 08 10  17 04 00 02  06 00 00 00  00 00 00 00 
23:18:11.604 Send       report_id=10 short device=01 DEV1 type=00 _HIDPP20                func=1  swId=8  params=00 00 37 
23:18:11.708 Recv       report_id=10 short device=01 DEV1 type=8F _ERROR_MSG              SubID=00 _HIDPP20  reg=18   err=01 INVALID_SUBID  
23:18:11.709 Send       report_id=10 short device=FF RECV type=83 GET_LONG_REG            reg=B5 PAIRING_INFO  params=30 00 00 
23:18:11.712 Recv       report_id=11 long  device=FF RECV type=83 GET_LONG_REG            reg=B5 PAIRING_INFO  params=30 13 86 5F  99 04 00 00  00 01 00 00  00 00 00 00 
23:18:11.713 Send       report_id=10 short device=01 DEV1 type=81 GET_REG                 reg=01 KBD_HAND_DETECT?  params=00 00 00 
23:18:11.814 Recv       report_id=10 short device=01 DEV1 type=81 GET_REG                 reg=01 KBD_HAND_DETECT?  params=02 00 00 
23:18:11.814 Send       report_id=10 short device=01 DEV1 type=80 SET_REG                 reg=01 KBD_HAND_DETECT?  params=00 00 00 
23:18:11.918 Recv       report_id=10 short device=01 DEV1 type=80 SET_REG                 reg=01 KBD_HAND_DETECT?  params=00 00 00 
23:18:11.918 Send       report_id=10 short device=01 DEV1 type=81 GET_REG                 reg=01 KBD_HAND_DETECT?  params=00 00 00 
23:18:11.926 Recv       report_id=20 unkn  device=01 DEV1 type=02 MOUSE                   params=00 80 00 00  00 00 00 00  00 00 00 00 
23:18:11.934 Recv       report_id=10 short device=01 DEV1 type=81 GET_REG                 reg=01 KBD_HAND_DETECT?  params=00 00 00 

Move mouse again, note the params=00 80 ...

23:18:13.856 Recv       report_id=20 unkn  device=01 DEV1 type=02 MOUSE                   params=00 80 03 10  00 00 00 00  00 00 00 00 
23:18:13.864 Recv       report_id=20 unkn  device=01 DEV1 type=02 MOUSE                   params=00 80 03 10  00 00 00 00  00 00 00 00 
23:18:13.872 Recv       report_id=20 unkn  device=01 DEV1 type=02 MOUSE                   params=00 80 02 10  00 00 00 00  00 00 00 00 
23:18:13.880 Recv       report_id=20 unkn  device=01 DEV1 type=02 MOUSE                   params=00 80 02 00  00 00 00 00  00 00 00 00 
23:18:13.888 Recv       report_id=20 unkn  device=01 DEV1 type=02 MOUSE                   params=00 80 03 10  00 00 00 00  00 00 00 00 
23:18:13.896 Recv       report_id=20 unkn  device=01 DEV1 type=02 MOUSE                   params=00 80 03 00  00 00 00 00  00 00 00 00 
...

Enable side-scroll again with solaar:

23:18:17.364 Send       report_id=10 short device=FF RECV type=83 GET_LONG_REG            reg=B5 PAIRING_INFO  params=03 00 00 
23:18:17.368 Recv       report_id=11 long  device=FF RECV type=83 GET_LONG_REG            reg=B5 PAIRING_INFO  params=03 D1 75 96  14 01 06 07  00 00 00 00  00 00 00 00 
23:18:17.368 Send       report_id=10 short device=FF RECV type=80 SET_REG                 reg=B2 DEVICE_PAIRING  params=00 00 00 
23:18:17.372 Recv       report_id=10 short device=FF RECV type=8F _ERROR_MSG              SubID=80 SET_REG  reg=B2 DEVICE_PAIRING  err=03 INVALID_VALUE  
23:18:17.390 Send       report_id=10 short device=FF RECV type=83 GET_LONG_REG            reg=B5 PAIRING_INFO  params=20 00 00 
23:18:17.394 Recv       report_id=11 long  device=FF RECV type=83 GET_LONG_REG            reg=B5 PAIRING_INFO  params=20 07 08 10  17 04 00 02  06 00 00 00  00 00 00 00 
23:18:17.394 Send       report_id=10 short device=01 DEV1 type=00 _HIDPP20                func=1  swId=F  params=00 00 07 
23:18:17.500 Recv       report_id=10 short device=01 DEV1 type=8F _ERROR_MSG              SubID=00 _HIDPP20  reg=1F   err=01 INVALID_SUBID  
23:18:17.501 Send       report_id=10 short device=FF RECV type=83 GET_LONG_REG            reg=B5 PAIRING_INFO  params=30 00 00 
23:18:17.506 Recv       report_id=11 long  device=FF RECV type=83 GET_LONG_REG            reg=B5 PAIRING_INFO  params=30 13 86 5F  99 04 00 00  00 01 00 00  00 00 00 00 
23:18:17.507 Send       report_id=10 short device=01 DEV1 type=81 GET_REG                 reg=01 KBD_HAND_DETECT?  params=00 00 00 
23:18:17.604 Recv       report_id=10 short device=01 DEV1 type=81 GET_REG                 reg=01 KBD_HAND_DETECT?  params=00 00 00 
23:18:17.604 Send       report_id=10 short device=01 DEV1 type=80 SET_REG                 reg=01 KBD_HAND_DETECT?  params=02 00 00 
23:18:17.708 Recv       report_id=10 short device=01 DEV1 type=80 SET_REG                 reg=01 KBD_HAND_DETECT?  params=00 00 00 
23:18:17.708 Send       report_id=10 short device=01 DEV1 type=81 GET_REG                 reg=01 KBD_HAND_DETECT?  params=00 00 00 
23:18:17.716 Recv       report_id=20 unkn  device=01 DEV1 type=02 MOUSE                   params=00 00 00 00  00 00 00 00  00 00 00 00 
23:18:17.724 Recv       report_id=10 short device=01 DEV1 type=81 GET_REG                 reg=01 KBD_HAND_DETECT?  params=02 00 00 

Move mouse again, note params=00 00 ...:

23:18:19.414 Recv       report_id=20 unkn  device=01 DEV1 type=02 MOUSE                   params=00 00 FB FF  FF 00 00 00  00 00 00 00 
23:18:19.422 Recv       report_id=20 unkn  device=01 DEV1 type=02 MOUSE                   params=00 00 FA FF  FF 00 00 00  00 00 00 00 
23:18:19.430 Recv       report_id=20 unkn  device=01 DEV1 type=02 MOUSE                   params=00 00 FB 0F  00 00 00 00  00 00 00 00 
23:18:19.438 Recv       report_id=20 unkn  device=01 DEV1 type=02 MOUSE                   params=00 00 FA FF  FF 00 00 00  00 00 00 00 
23:18:19.446 Recv       report_id=20 unkn  device=01 DEV1 type=02 MOUSE                   params=00 00 FF 0F  00 00 00 00  00 00 00 00 
...

This could be a bug in KDE, but it's also possible that register 01 is not the same for all mice.

nexces commented 11 years ago

I've got Anywhere MX and it's working fine regardless of side-scrolling option. Kernel: 3.11.0-2-generic Distro: Ubuntu Saucy Salamander (development branch) KDE: 4.11

Lekensteyn commented 11 years ago

Can you also post a usbmon? Test:

  1. Move your mouse to the upper left corner.
  2. You should see a blue triangle, indicating that an action is available when you further move to the left.
  3. Disable side-scroll
  4. Try (1) again.
  5. I do not see the blue triangle.

I am running Arch Linux.

nexces commented 11 years ago

Flying around with side-scroll on:

14:37:43.440 Recv       report_id=20 unkn  device=01 DEV1 type=02 MOUSE                   params=00 00 F5 0F  00 00 00 00  00 00 00 00 
14:37:43.448 Recv       report_id=20 unkn  device=01 DEV1 type=02 MOUSE                   params=00 00 F5 FF  FF 00 00 00  00 00 00 00 
14:37:43.456 Recv       report_id=20 unkn  device=01 DEV1 type=02 MOUSE                   params=00 00 F5 0F  00 00 00 00  00 00 00 00 
14:37:43.464 Recv       report_id=20 unkn  device=01 DEV1 type=02 MOUSE                   params=00 00 F4 FF  FF 00 00 00  00 00 00 00 
14:37:43.473 Recv       report_id=20 unkn  device=01 DEV1 type=02 MOUSE                   params=00 00 F3 0F  00 00 00 00  00 00 00 00 
14:37:43.481 Recv       report_id=20 unkn  device=01 DEV1 type=02 MOUSE                   params=00 00 F3 0F  00 00 00 00  00 00 00 00 
14:37:43.487 Recv       report_id=20 unkn  device=01 DEV1 type=02 MOUSE                   params=00 00 F3 0F  00 00 00 00  00 00 00 00 

Plasma detects mouse in the corner and a blue light shines...

Bumping switch of side-scroll in Solaar:

14:37:50.996 Send       report_id=10 short device=01 DEV1 type=81 GET_REG                 reg=01 KBD_HAND_DETECT?  params=00 00 00 
14:37:51.009 Recv       report_id=10 short device=01 DEV1 type=81 GET_REG                 reg=01 KBD_HAND_DETECT?  params=02 00 00 
14:37:51.009 Send       report_id=10 short device=01 DEV1 type=80 SET_REG                 reg=01 KBD_HAND_DETECT?  params=00 00 00 
14:37:51.113 Recv       report_id=10 short device=01 DEV1 type=80 SET_REG                 reg=01 KBD_HAND_DETECT?  params=00 00 00 
14:37:52.388 Send       report_id=10 short device=01 DEV1 type=00 _HIDPP20                func=1  swId=0  params=00 00 42 
14:37:52.388 Send       report_id=10 short device=01 DEV1 type=81 GET_REG                 reg=0D   params=00 00 00 
14:37:52.465 Recv       report_id=10 short device=01 DEV1 type=8F _ERROR_MSG              SubID=00 _HIDPP20  reg=10   err=01 INVALID_SUBID  
14:37:52.471 Recv       report_id=10 short device=01 DEV1 type=81 GET_REG                 reg=0D   params=28 64 30

Flying around with side-scroll off:

14:37:59.133 Recv       report_id=20 unkn  device=01 DEV1 type=02 MOUSE                   params=00 00 04 F0  FF 00 00 00  00 00 00 00 
14:37:59.141 Recv       report_id=20 unkn  device=01 DEV1 type=02 MOUSE                   params=00 00 03 F0  FF 00 00 00  00 00 00 00 
14:37:59.149 Recv       report_id=20 unkn  device=01 DEV1 type=02 MOUSE                   params=00 00 03 F0  FF 00 00 00  00 00 00 00 
14:37:59.157 Recv       report_id=20 unkn  device=01 DEV1 type=02 MOUSE                   params=00 00 02 F0  FF 00 00 00  00 00 00 00 
14:37:59.165 Recv       report_id=20 unkn  device=01 DEV1 type=02 MOUSE                   params=00 00 02 00  00 00 00 00  00 00 00 00 
14:37:59.173 Recv       report_id=20 unkn  device=01 DEV1 type=02 MOUSE                   params=00 00 02 00  00 00 00 00  00 00 00 00 

Plasma still detects mouse in the corner and show blue glow... Side-scroll actually down (tested in google-chrome while flying around)

Turn side-scroll back again:

14:38:05.622 Send       report_id=10 short device=01 DEV1 type=81 GET_REG                 reg=01 KBD_HAND_DETECT?  params=00 00 00 
14:38:05.635 Recv       report_id=10 short device=01 DEV1 type=81 GET_REG                 reg=01 KBD_HAND_DETECT?  params=00 00 00 
14:38:05.635 Send       report_id=10 short device=01 DEV1 type=80 SET_REG                 reg=01 KBD_HAND_DETECT?  params=02 00 00 
14:38:05.739 Recv       report_id=10 short device=01 DEV1 type=80 SET_REG                 reg=01 KBD_HAND_DETECT?  params=00 00 00

Plasma corner action still works as intended and side-scroll is back on...

Log of side-scroll attempt when it's off:

14:47:39.366 Recv       report_id=20 unkn  device=01 DEV1 type=02 MOUSE                   params=80 00 00 00  00 00 00 00  00 00 00 00 
14:47:39.534 Recv       report_id=20 unkn  device=01 DEV1 type=02 MOUSE                   params=00 00 00 00  00 00 00 00  00 00 00 00 
14:47:40.214 Recv       report_id=20 unkn  device=01 DEV1 type=02 MOUSE                   params=40 00 00 00  00 00 00 00  00 00 00 00 
14:47:40.406 Recv       report_id=20 unkn  device=01 DEV1 type=02 MOUSE                   params=00 00 00 00  00 00 00 00  00 00 00 00 
14:47:40.990 Recv       report_id=20 unkn  device=01 DEV1 type=02 MOUSE                   params=80 00 00 00  00 00 00 00  00 00 00 00 
14:47:41.158 Recv       report_id=20 unkn  device=01 DEV1 type=02 MOUSE                   params=00 00 00 00  00 00 00 00  00 00 00 00 
14:47:41.630 Recv       report_id=20 unkn  device=01 DEV1 type=02 MOUSE                   params=40 00 00 00  00 00 00 00  00 00 00 00 
14:47:41.798 Recv       report_id=20 unkn  device=01 DEV1 type=02 MOUSE                   params=00 00 00 00  00 00 00 00  00 00 00 00

Log of side-scroll attempt when it's on:

14:48:42.673 Recv       report_id=20 unkn  device=01 DEV1 type=02 MOUSE                   params=00 00 00 00  00 00 01 00  00 00 00 00 
14:48:42.825 Recv       report_id=20 unkn  device=01 DEV1 type=02 MOUSE                   params=00 00 00 00  00 00 00 00  00 00 00 00 
14:48:43.593 Recv       report_id=20 unkn  device=01 DEV1 type=02 MOUSE                   params=00 00 00 00  00 00 FF 00  00 00 00 00 
14:48:43.793 Recv       report_id=20 unkn  device=01 DEV1 type=02 MOUSE                   params=00 00 00 00  00 00 00 00  00 00 00 00 
14:48:44.297 Recv       report_id=20 unkn  device=01 DEV1 type=02 MOUSE                   params=00 00 00 00  00 00 01 00  00 00 00 00 
14:48:44.463 Recv       report_id=20 unkn  device=01 DEV1 type=02 MOUSE                   params=00 00 00 00  00 00 00 00  00 00 00 00 
14:48:45.703 Recv       report_id=20 unkn  device=01 DEV1 type=02 MOUSE                   params=00 00 00 00  00 00 FF 00  00 00 00 00 
14:48:45.831 Recv       report_id=20 unkn  device=01 DEV1 type=02 MOUSE                   params=00 00 00 00  00 00 00 00  00 00 00 00
Lekensteyn commented 11 years ago

Odd, I do not see the params=00 80 after you disabling side-scroll. Can you post your firmware version with ltunify show 1 or Solaar?

This 100% produces the bug I experience:

echo 10 01 80  01  00 00 00 | xxd -ps -r > /dev/hidraw2 # disable side-scroll
echo 10 01 81  01  00 00 00 | xxd -ps -r > /dev/hidraw2 # check register value

usbmon when side-scroll is disabled

# Disable side-scroll (00 00 00)
15:00:31.922 Send       report_id=10 short device=01 DEV1 type=80 SET_REG                 reg=01 KBD_HAND_DETECT?  params=00 00 00 
15:00:33.915 Recv       report_id=10 short device=01 DEV1 type=80 SET_REG                 reg=01 KBD_HAND_DETECT?  params=00 00 00 
# Note this response right after setting
15:00:33.927 Recv       report_id=20 unkn  device=01 DEV1 type=02 MOUSE                   params=00 80 00 00  00 00 00 00  00 00 00 00 

# move around in top-left corner
15:00:44.625 Recv       report_id=20 unkn  device=01 DEV1 type=02 MOUSE                   params=00 80 FF 0F  00 00 00 00  00 00 00 00 
15:00:44.633 Recv       report_id=20 unkn  device=01 DEV1 type=02 MOUSE                   params=00 80 FF 2F  00 00 00 00  00 00 00 00 
15:00:44.641 Recv       report_id=20 unkn  device=01 DEV1 type=02 MOUSE                   params=00 80 00 10  00 00 00 00  00 00 00 00

And when enabled (default):

# Enable side-scroll (02 00 00)
15:01:01.045 Send       report_id=10 short device=01 DEV1 type=80 SET_REG                 reg=01 KBD_HAND_DETECT?  params=02 00 00 
15:01:02.614 Recv       report_id=10 short device=01 DEV1 type=80 SET_REG                 reg=01 KBD_HAND_DETECT?  params=00 00 00 
# note this response right after changing side-scroll
15:01:02.628 Recv       report_id=20 unkn  device=01 DEV1 type=02 MOUSE                   params=00 00 00 00  00 00 00 00  00 00 00 00 

# moving around, blue triangle is visible
15:01:04.176 Recv       report_id=20 unkn  device=01 DEV1 type=02 MOUSE                   params=00 00 FD 0F  00 00 00 00  00 00 00 00 
15:01:04.184 Recv       report_id=20 unkn  device=01 DEV1 type=02 MOUSE                   params=00 00 FE DF  FF 00 00 00  00 00 00 00 
15:01:04.192 Recv       report_id=20 unkn  device=01 DEV1 type=02 MOUSE                   params=00 00 FF FF  FF 00 00 00  00 00 00 00 

Edit: .. cannot reproduce triangle corner bug on my brothers laptop which also runs Arch Linux, but with stock kernel and no testing repos enabled. This bug affects all pointer devices, the laptops touchpad and another connected M525 mouse (different receiver).

nexces commented 11 years ago

Firmware : 16.01.B0040 Bootloader : 02.10 Other : 00.06

Lekensteyn commented 11 years ago

I cannot reproduce it anymore, it must have been a butterfly.

pwr commented 11 years ago

@Lekensteyn did you update any packages in the meantime? What distro are you using?

Lekensteyn commented 11 years ago

@pwr I was using Arch Linux with kdebase-workspace 4.11.0-1 xf86-video-intel 2.21.14-2 Linux 3.11-rc6 (vanilla + hidraw memory corruption patch and revert of enumeration workaround, Lekensteyn/aur@79ff46c)

Another thing that could possibly affect this is ktouchpadenabler, in that session it was enabled, but it interfered with some touch gestures on the T650 so I disabled it. Although I stopped it that session, the TouchpadOff event was still grabbed until I restarted KDE (as I did yesterday).

Yet another possibility is me stopping solaar through Ctrl+C. It still has Python3 issues. (reported in #120)