udev: touchscreen pointer never pressed/released correctly (KMS, UDEV_TOUCH_SUPPORT)
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 72/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- c, linux
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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)
- Lenguaje dominante
- C
- Estrellas
- 14.6k
- Forks
- 2.4k
- Merge medio
- 2 d 3 h
- PR fusionados (30 d)
- 64
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de libretro/RetroArch
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 2 días
-
Outdated labels in Menu Item Visibility (`Show 'Quit RetroArch'` / `Show 'Restart RetroArch'`)Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 78/100
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
libretro/RetroArch#20061 · 3 comentarios ·
Los mantenedores suelen responder en 2 días
-
[Feature Request] [UX] Improve descriptions for "Rewind Buffer Size" and "Rewind Buffer Size Step"Abiertofeature request
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
libretro/RetroArch#19915 · 2 comentarios ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 2 días
Todos los issues de libretro/RetroArch
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
libretro/parallel-n64#858 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Mbed-TLS/TF-PSA-Crypto#984 ·
Los mantenedores suelen responder en 2 días
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
type: bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
create a QEMU test scriptAbiertoenhancement help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100