Tips for debugging touch-response latency for external touchscreen display?

DoofusOfDeath

New Member
Joined
Mar 28, 2023
Messages
2
Reaction score
0
Credits
38
Any suggestions for how I can efficiently find the root cause of the following issue? (Related to my question in this Reddit post.)

I've tried tweaking various things to no avail, so I'm hoping someone can recommend a good approach to narrowing down the problem space.

Background:
I have an AG Neovo IFP-6502 interactive display, which I'm trying to use an an external touchscreen for online whiteboard collaboration. It kinda works, but there's too much lag between (1) me dragging a finger/stylus across the board, and (2) when the desktop or application is updated accordingly.

For example, if I drag my finger across the desktop area, to provide a bounding box for icon selection, it takes (I'm guessing) about 300 ms for the box corner to catch up with my finger. Similar experience for finger/stylus dragging in programs with drawing canvases.

The problem only seems to occur with touch input. If I do those same things using my USB mouse, there's no perceptible lag. Also, if I simply use the IFP-6502's built-in Android apps for drawing, there's no lag either.

Here are some factors that are slowing down my investigation:
  • I'm not entirely clear how the raw USB touch/drag events are being handled on their way to the final form that applications (e.g., Krita) see.
  • Even if I knew the particular kernel drivers, x.org drivers, etc. that are processing those events, how can I accurately pinpoint which of those layers (if any) are introducing the problematic lag?
    • I've hacked together a technique involving high-framerate video recording while I drag the stylus, but it's a pretty flawed approach, and I'm not even sure I'm correlating the timestamps from the relevant pieces of software.
  • Are there certain USB modules and/or x.org drivers I should be using, or should be configuring differently?
  • Would this problem be easier to debug if I switched from x.org to Wayland?
    • IIUC I'd want to have an AMD GPU to use Wayland. I could do that if necessarily, but it would be expensive, so I'd only want to try this if it seemed necessary.
With a lag of (just guessing) 300ms on modern hardware, I'm suspicious that it's related to some software layer(s) waiting to see if an event should be converted to a tap event, or a gesture, or similar before passing the original event up to a higher layer in the stack. But I'd be surprised if that happened for drag events, and really I'm just blindly guessing.

My setup:
  • System76 Thelio desktop (12-core AMD Ryzen 9 5900X)
  • Pop!_OS 22.04 LTS (6.2.6-76060206-generic)
  • NVIDIA GA104 [GeForce RTX 3070] (with nVidia driver 525.89.02)
  • X.Org version 1.21.1.3
  • Desktop: Pop Shell (which AFAIK is Gnome?)
 
Last edited:



Members online


Top