udev: touchscreen pointer never pressed/released correctly (KMS, UDEV_TOUCH_SUPPORT)
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 72/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- c, linux
Direzione di ricerca
Start with the three reported locations in input/drivers/udev_input.c: pointer button state around line 2393, pointer state reporting around lines 3037-3041, and touch event handling around lines 2659-2729. Trace how touch contacts update pointer state and MT slots, then reproduce with the issue’s udev touchscreen setup. Done means taps register, pointer state follows contact press and release, and multi-touch scrolling produces no phantom releases.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Is there an existing issue for this?
- This is a bug in RetroArch frontend
- I have searched the existing issues
Description
With the udev input driver built with -DUDEV_TOUCH_SUPPORT, taps on a touchscreen do nothing in the menu. I found three bugs in input/drivers/udev_input.c. All three are still in master (49582a9, line numbers below are from that commit).
1. The simulated pointer is reported pressed after release (line 2393)
/* Release the pointer only after all contacts are released */
if (touch->pointer_enabled)
touch->pointer_btn_pp = (touch->staging_active == 0);
staging_active has already been decremented here, so the condition is inverted: the pointer is pressed after the last finger is lifted and released while a finger is still down. The menu acts on release, so taps never register. Fix: (touch->staging_active > 0).
2. udev_input_touch_state() always returns 0 for the pointer (lines 3037-3041)
case RETRO_DEVICE_POINTER:
case RARCH_DEVICE_POINTER_SCREEN:
screen = (device == RARCH_DEVICE_MOUSE_SCREEN);
break;
switch (id)
The stray break leaves before switch (id), so pointer X/Y/pressed are never reported. The comparison also uses RARCH_DEVICE_MOUSE_SCREEN instead of RARCH_DEVICE_POINTER_SCREEN. Fix: remove the break and compare with RARCH_DEVICE_POINTER_SCREEN.
3. Single-touch emulation is mixed into MT slot 0 (ABS_X line 2659, ABS_Y around line 2683, BTN_TOUCH line 2729)
For multi-touch devices the kernel also sends single-touch emulation (ABS_X, ABS_Y, BTN_TOUCH) that follows the oldest active contact. The code writes it into slot 0 (BTN_TOUCH even into the current slot) on top of the MT slot data. When a second contact outlives the first one, the emulation jumps to it: slot 0 gets that position and a second touch up, the log shows Cannot report touch up since there are no active points. and the menu sees phantom releases and taps while scrolling. The MT slots carry the same data, so the fix is to skip these three events when the device has MT slots:
if (touch->info_slots.enabled && touch->info_slots.range > 1)
break;
Single-touch devices (no ABS_MT_SLOT) are not affected by this change.
Bugs 1 and 2 seem to date back to the touch rewrite in #15282 (2023).
Side note: nothing in the build system defines UDEV_TOUCH_SUPPORT (configure, Makefile.common), so distribution builds have no touchscreen support in udev at all. Maybe it could become a configure option once these bugs are fixed.
I have patches against v1.20.0 tested on hardware and can open a PR against master if that helps:
https://github.com/cyryllo/banana-a20/tree/arkada20-v1.0-trixie-6.18.62/armbian-build/konsola/latki-retroarch (0001, 0002, 0007)
Expected behavior
A tap selects a menu entry, the pointer is pressed while a finger is down and released when the last finger is lifted.
Steps to reproduce the bug
- Build RetroArch for Linux with KMS and udev,
CFLAGS=-DUDEV_TOUCH_SUPPORT. - Run it on a device with a multi-touch touchscreen (evdev with
ABS_MT_SLOT),input_driver = "udev",menu_pointer_enable = "true",input_touch_vmouse_pointer = "true". - Tap a menu entry: nothing happens. With 1 and 2 fixed, taps work, but with two contacts the menu gets phantom releases (bug 3).
Version/Commit
1.20.0 (built from the v1.20.0 tag). The same code is in master 49582a9.
Bisect Results
Probably since #15282 (2023), not bisected.
Present in the nightly version
I don't know
Platform & operating system
Linux armhf, Debian 13 (Armbian), kernel 6.18.62, LeMaker Banana Pro (Allwinner A20)
Affected Cores
None (menu)
Environment information
KMS + EGL + OpenGL ES 2 (Mesa lima, Mali-400), udev input, no X11/Wayland. Touchscreen: FocalTech FT5x06 (edt-ft5x06 driver), 1024x600, multi-touch with slots.
Relevant log output
`[udev] Cannot report touch up since there are no active points.` (bug 3)
- Lingua principale
- C
- Stelle
- 14.6k
- Fork
- 2.4k
- Merge medio
- 2g 3h
- PR unite (30g)
- 64
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di libretro/RetroArch
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 2 giorni
-
Outdated labels in Menu Item Visibility (`Show 'Quit RetroArch'` / `Show 'Restart RetroArch'`)Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
libretro/RetroArch#20061 · 3 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
[Feature Request] [UX] Improve descriptions for "Rewind Buffer Size" and "Rewind Buffer Size Step"Apertafeature request
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
libretro/RetroArch#19915 · 2 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di libretro/RetroArch
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
libretro/parallel-n64#858 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
Mbed-TLS/TF-PSA-Crypto#984 ·
I maintainer di solito rispondono entro 2 giorni
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
type: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
create a QEMU test scriptApertaenhancement help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100