Skip to content

Capturing a HID Recording

A. Skomra edited this page Feb 13, 2023 · 3 revisions

Developers may as you to create a recording of the HID events sent by your device. These are the low-level events sent from the hardware to the Linux kernel. Developers can inspect the recording to validate that valid event sequences are being received by the driver. They are also able to reply the recordings to examine how the driver responds.

To capture a HID recording:

  1. Clone the hid-tools repository: git clone https://gitlab.freedesktop.org/libevdev/hid-tools
  2. Install the "python-parse" or "python3-parse" package through your distro's package manager
  3. From inside the hid-tools directory, run sudo ./hid-recorder and then press CTRL+C rather than selecting any single device
  4. Note the paths of any Wacom devices listed (e.g. /dev/hidraw3 and /dev/hidraw4)
  5. Run sudo ./hid-recorder PATH1 PATH2 [...etc...] | tee recording.log. You should see a bunch of data printed to the screen; all this data describes the HID device(s) and their report formats
  6. Perform the specific actions requested by the developer. This may be e.g. touching the screen a certain number of times, tapping the screen with a specific pen button held, or pressing various ExpressKyes.
  7. When all actions have been completed, press CTRL+C to stop the recording
  8. Run gzip recording.log to compress the logfile prior to upload
  9. Attach the recording.log.gz file to your issue for analysis

Example

$ git clone https://gitlab.freedesktop.org/libevdev/hid-tools
Cloning into 'hid-tools'...
warning: redirecting to https://gitlab.freedesktop.org/libevdev/hid-tools.git/
remote: Enumerating objects: 3184, done.
remote: Total 3184 (delta 0), reused 0 (delta 0), pack-reused 3184
Receiving objects: 100% (3184/3184), 667.91 KiB | 1.18 MiB/s, done.
Resolving deltas: 100% (2302/2302), done.

$ cd hid-tools

$ sudo ./hid-recorder
[sudo] password for someuser: 
Available devices:
/dev/hidraw0:	Dell Dell USB Keyboard Hub
/dev/hidraw1:	Dell Dell USB Keyboard Hub
/dev/hidraw2:	Logitech USB-PS/2 Optical Mouse
/dev/hidraw3:	Wacom Co.,Ltd. Cintiq 24HDT Touch
/dev/hidraw4:	SE International USB Instrument
/dev/hidraw5:	Tablet Cintiq 24HDT Tablet
/dev/hidraw7:	Logitech Logitech Extreme 3D
Select the device event number [0-7]: ^C

$ sudo ./hid-recorder /dev/hidraw3 /dev/hidraw5 | tee recording.log

[ Lots of data printed to screen; Perform actions requested by developer ]

^C

$ gzip recording.log

[ Attach the recording.log.gz file to the issue ]
Clone this wiki locally