Tools to debug a broken input device

Benjamin Tissoires

2015-09-16

who am I?

General problem: input bug reports

To: linux-input@vger.kernel.org
Date: back in April
Subject: PROBLEM: Touchpad works just like a mouse

[1.] Touchpad works just like a mouse.

[2.] Touchpad features like scrolling, tapping, etc. do not work at all. Also, I cannot disable touchpad, even if I try to do it using special key functions (fn) for notebooks. Touchpad multitouch gestures doesn't work. It's simple to reproduce. I just boot my Linux system and I try to use my touchpad. System doesn't recognize it as a touchpad 8 (I cannot enable touchpad functions). My notebook model is ASUSTeK COMPUTER INC. PU551LA.

General problem: input bug reports

Triage:

Can we do something better?

the input layers

trying to narrow down the problem

https://xkcd.com/1172/ ... the workflow problem

kernel or libinput?

kernel or libinput?

evemu

http://www.freedesktop.org/wiki/Evemu/

If the kernel is doing OK, most of the time, you blame Peter :)

other tools

kernel is OK

libinput-debug-events

then you talk to Peter

The kernel fails

Many reasons

The kernel can send garbage:

bug in the driver (commit e9e8520f229....)

Put one, two, three, two fingers down.

E: 0.000000 0001 014a 0001      # EV_KEY / BTN_TOUCH            1
E: 0.000000 0001 0145 0001      # EV_KEY / BTN_TOOL_FINGER      1
E: 0.770008 0001 0145 0000      # EV_KEY / BTN_TOOL_FINGER      0
E: 0.770008 0001 014d 0001      # EV_KEY / BTN_TOOL_DOUBLETAP   1
E: 1.924716 0001 014d 0000      # EV_KEY / BTN_TOOL_DOUBLETAP   0
E: 1.924716 0001 014e 0001      # EV_KEY / BTN_TOOL_TRIPLETAP   1

.. changing from 3 to 2 fingers now

E: 3.152641 0001 014a 0000      # EV_KEY / BTN_TOUCH            0
E: 3.152641 0001 014d 0001      # EV_KEY / BTN_TOOL_DOUBLETAP   1
E: 3.152641 0001 014e 0000      # EV_KEY / BTN_TOOL_TRIPLETAP   0
E: 3.176948 0001 014a 0001      # EV_KEY / BTN_TOUCH            1

So the kernel fails

Know your enemy

PS/2 I2C SMBus USB Bluetooth serial
public HID, psmouse
semi-public RMI4, HID++ 2.0
proprietary reverse-engineered, documentation under NDA

Know your enemy (continued)

Combinations:

  • PS/2 over RMI4 over SMBus
  • HID++ over HID over DJ over HID over USB
  • WTF over GTFO over SNAFU

Finding out which bus/protocol is used

PS/2 I2C SMBus USB Bluetooth serial

=> dmesg | grep input:

[19679.866042] input: Logitech MX Master as /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.2/0003:046D:C52B.0008/0003:046D:4041.0009/input/input15

[19679.866630] logitech-hidpp-device 0003:046D:4041.0009: input,hidraw1: USB HID v1.11 Keyboard [Logitech MX Master] on usb-0000:00:14.0-2:1

HID

hid-replay

http://bentiss.github.io/hid-replay-docs/

If the kernel is doing not doing OK, most of the time, you blame me :)

USB

usbmon

PS/2

ps2emu

https://github.com/Lyude/ps2emu

Other transport layers

Wrapping up

regressions tests?

Reporting an input bug

Reporting an input bug