macOS + Node server: Latency with high polling rate devices
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 20/100
- Tipo de issue
- Error
- Claridad
- Necesita aclaración
- Estado de actividad
- Estancado
- Stack tecnológico
- cpp, macos, node.js
- Área
- desktop, operating-systems
Línea de trabajo
Comienza con bindings/Node/libpointing/pointing/pointing.cc e inspecciona el cambio en el procesamiento de eventos de macOS del commit 11bb753de457cfce719e1edbe4509739f557cbbc. Reproduce el binding de Node en macOS con un dispositivo que sondee por encima de 125Hz y, a continuación, investiga el equilibrio entre la latencia del callback HID y la capacidad de respuesta de JavaScript. Se considera completado cuando los callbacks llegan puntualmente sin congelar la aplicación.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
With libpointing's new nodejs binding on macOS, devices with high polling rate (i.e. > 125Hz) "lag": the js client receives the reports much later than it should, creating a very high latency.
After some digging, it seems to be related to the cohabitation of the Cocoa's event loop with Node's main loop. Long story short: Node does not process all macOS events in its main loop and therefore HID callbacks are never called. libpointing solves this problem by processing macOS events every tick for Xms (see https://github.com/INRIA/libpointing/blob/master/bindings/Node/libpointing/pointing/pointing.cc#L30, the time given to macOS event processing was recently reduced in 11bb753de457cfce719e1edbe4509739f557cbbc). This solution is basically a trade-off: if we give more time to process macOS events, then JS events are not treated as quickly and the app freezes, but if we prioritize the JS event loop, then the HID callbacks are not called as quickly. I experimented with different values to find a better trade-off, but nothing seemed ideal. The current value seems fine for devices with low poll rates (<125Hz).
Related StackOverflow issue (no answer): https://stackoverflow.com/questions/33599653/c-callbacks-are-not-called-for-node-bindings
It seems that this problem could also be solved from the js code, by re-writing node's main loop to process macOS events, but it is pretty involved and require the use of platform dependent APIs in JS: https://github.com/TooTallNate/NodObjC/issues/2
Tested on macOS Catalina.
- Lenguaje dominante
- C++
- Estrellas
- 54
- Forks
- 14
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
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 INRIA/libpointing
-
Dificultad 3/5 1-2 días Aptitud para principiantes 42/100
INRIA/libpointing#40 ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 38/100
INRIA/libpointing#26 ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
INRIA/libpointing#22 ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 28/100
INRIA/libpointing#17 · 1 comentario ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 20/100
INRIA/libpointing#10 ·
Todos los issues de INRIA/libpointing
Issues similares
-
Eval bug: minimax-m3: build_moe_ffn() drops the per-expert NVFP4 scale → garbled output (M3.1 Flash)Abiertobug-unconfirmed
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
Status: Needs confirmation Status: Needs triage
Dificultad 1/5 Menos de una hora Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
[BUG] Failed archive extraction deletes the dataset cachePosiblemente ocupada @dajiaohuang la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
alibaba/GraphScope#4674 ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 93/100
webarkit/WebARKitLib#107 ·
Los mantenedores suelen responder en 1 día