Intermittent Delayed Touch Events on Raspberry Pi Kivy App

40 views
Skip to first unread message

GrantS

unread,
Dec 5, 2020, 2:08:34 PM12/5/20
to Kivy users support
Hi everyone. I have a touch events problem which is proving very difficult to resolve, so I'm hoping that someone might be able to help!

Problem description: When a basic Kivy app is running, the touch response is very poor with some touches being completely missed. Also some touches appear to be held, even though they’re not. Some touch events are delayed by a number of seconds (approx. 2-4). When using the app via VNC, all mouse clicks are instant and responsive.

When running a basic PyQt5 app the touch response is fine.


The latest Kivy source has been downloaded, built and installed.


The latest libSDL2 code has built built and installed.


Have tried sdl2 as well as egl_rpi window providers.


When running evtest alone (or at the same time as another GUI app such as the calculator) then touch events are instantly output to the console.
However, when evtest is run at the same time as the Kivy app then its touch event output follows the poor behaviour in the app, i.e. if a touch reaction is delayed by a few seconds then the output from evtest is also delayed by a few seconds.


The following is an example output from evtest when there was just a short 'tap' on the screen:


  Event: time 1607155807.606990, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1
  Event: time 1607155810.496377, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0

Note the timestamp of the 'up' event - approx. 3 seconds after the 'down' event. This leads to a few questions:

  • How, possibly, could a Kivy app (or any high-level GUI app) delay low-level touch events being output from evtest?

  • Where/when is the event timestamp set? - is it set by the evdev driver? If so, then is the app somehow delaying the kernel driver from reading the event from hardware?

Have experimented with various different input providers configuration in config.ini. In summary:

  • Having provider=hidinput entries seems to have no effect at all.

  • When running with X - (DISPLAY=:0.0) then only the mouse entry is required for touch to work. Touch events AND VNC mouse events are consistently delayed by a few seconds but output from evtest is instant.

  • If not running with X then you MUST have the provider=mtdev entry for touch to work. However, touch events are intermittent and sometimes delayed. evtest output reflects this also.

Hardware: Raspberry Pi Zero W

OS version: Linux raspberrypi 5.4.72+ #1356 Thu Oct 22 13:56:00 BST 2020 armv6l GNU/Linux

Touchscreen: Goodix Capacitive TouchScreen


I'd be really grateful for any suggestions, ideas or diagnostics tips which help me to overcome this very challenging problem!


Many thanks,

Grant



Reply all
Reply to author
Forward
0 new messages