NameDateSize

..11-Jun-20184 KiB

.gitignore11-Jun-20181 KiB

LICENSE11-Jun-201811.1 KiB

plothist.py11-Jun-2018853

pywalt/11-Jun-20184 KiB

README.md11-Jun-20183.9 KiB

setup.py11-Jun-2018372

walt11-Jun-201891

README.md

1# PyWALT
2Python scripts for [WALT Latency Timer](https://github.com/google/walt) on Linux and ChromeOS.
3
4 * Based on [ChromeOS scroll test implementation](https://chromium.googlesource.com/chromiumos/platform/touchbot/+/master/quickstep/)
5 * Currently supprots tap and drag (scroll) latency measurements
6 * For tests using evetest or drm (all touch and screen tests) pywalt needs to run as root
7 * In order to find the name/number of your touch device run `evtest`. It will list available input devices and once you enter a device number it will show incoming events when you touch that touchpad / touchscreen.
8
9
10Synopsis:
11```
12$ ./walt.py --help
13usage: walt.py [-h] [-i INPUT] [-s SERIAL] [-t TYPE] [-l LOGDIR] [-n N]
14               [-p PORT] [-d]
15
16Run the touchpad drag latency test using WALT Latency Timer
17
18optional arguments:
19  -h, --help            show this help message and exit
20  -i INPUT, --input INPUT
21                        input device, e.g: 6 or /dev/input/event6 (default: )
22  -s SERIAL, --serial SERIAL
23                        WALT serial port (default: /dev/ttyACM0)
24  -t TYPE, --type TYPE  Test type: drag|tap|screen|sanity|curve|bridge
25                        (default: drag)
26  -l LOGDIR, --logdir LOGDIR
27                        where to store logs (default: /tmp)
28  -n N                  Number of laser toggles to read (default: 40)
29  -p PORT, --port PORT  Port to listen on for the TCP bridge (default: 50007)
30  -d, --debug           talk more (default: False)
31 ```
32
33
34## Tap Latency ##
35See the [tap latency section](../docs/usage/WALT_usage.md#tap-latency) in Android app usage doc.
36
37Below is output from an example run of a tap latency test that reads touch events from `/dev/input/event4` (in this case a touchpad). After 40 events (20 down and 20 up) are detected, the script prints median delays and exits.
38
39The input device option is mandatory since several touch devices might be preset (e.g. touchpad and touch screen). You can use a shorthand notation `-i 4` which is expanded to `-i /dev/input/event4`.
40
41The following must be run as root.
42
43```
44$ ./walt.py -t tap -n 40 -i /dev/input/event4
45
46Starting tap latency test
47Clock zeroed at 1487105210 (rt 0.250 ms)
48Event: time 1487105212.048997, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1
49
50shock t 1990338, tap t 1487105212.048997, tap val 1. dt=63738.9
51Event: time 1487105212.262449, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0
52
53shock t 2219992, tap t 1487105212.262449, tap val 0. dt=47537.0
54Event: time 1487105212.702711, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1
55
56...
57
58Processing data...
59dt_down = [63.74, 26.96, 27.14 ...
60dt_up = [47.54, 47.03, 41.52...
61
62Median latency, down: 23.9, up: 47.1
63```
64
65## Drag / Scroll Latency ##
66See the [drag latency section](../docs/usage/WALT_usage.md#dragscroll-latency) in Android app usage doc.
67
68Below is a drag latency measurement of the trackpad on Asus Flip. The trackpad input device is `/dev/input/event4` which was selected using the `-i 4` argument.
69
70The `-n 20` option tells the script to record 20 laser events. Any change in laser sensor reading counts as one event, therefore one crossing of the beam counts as two events (laser goes off and back on), and a full cycle of the finger going up and down counts as 4 events. This measurement recorded 20/4 = 5 full cycles of the finger moving up and down.
71
72In addition to moving your finger up and down please also move it slowly along the beam. The calculation used by pywalt needs some spread of the x coordinates for better precision.
73
74Drag latency uses evtest and must therefore be run as root.
75
76```
77#./walt.py -t drag -i 4 -n 20
78Starting drag latency test
79Input device   : /dev/input/event4
80Serial device  : /dev/ttyACM1
81Laser log file : /tmp/WALT_2017_03_07__1532_12_laser.log
82evtest log file: /tmp/WALT_2017_03_07__1532_12_evtest.log
83Clock zeroed at 1488918733 (rt 0.306 ms)
84....................
85Processing data, may take a minute or two...
86Drag latency (min method) = 21.07 ms
87```
88