IVRInput: 1-frame input drop (bActive = false) after lowering action set nPriority while input is held

Abierto
#1,932 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
18/100
Tipo de issue
Error
Claridad
Necesita aclaración
Estado de actividad
Activo
Stack tecnológico
cpp
Área
api

Línea de trabajo

The payload names no source files. The entry points are IVRInput::UpdateActionState and GetAnalogActionData, and the priority field is VRActiveActionSet_t::nPriority. Reproducing needs SteamVR, a controller and an overlay app, so start by checking whether the one-frame bActive == false gap happens with other headsets. The issue does not say what to change: the reporter asks whether the gap is intended and whether it should be fixed or documented. Done would mean a maintainer decision plus either a corrected input path or documentation of the gap.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Summary

I'm writing an overlay application that uses IVRInput. While the pointer is on one of its overlays, it raises the priority of the trigger action set for that hand to vr::k_nActionSetOverlayGlobalPriorityMin (so the game doesn't receive the trigger). When the pointer leaves, it lowers the priority back to 0.

When the priority is lowered while the trigger is still physically held, the next GetAnalogActionData call for the trigger returns VRInputError_None with bActive == false and x == 0 for exactly one frame. On the following frame it returns bActive == true with the real value again.

An application that treats "inactive" as "0" sees a release followed immediately by a new press, although the user never released the trigger.

Raising the priority (0 → global overlay priority) did not show this in my logs.

Environment

  • SteamVR version: SteamVR 2.17.10
  • OS: Windows 11
  • Headset / controllers: Meta Quest 2, connected through Virtual Desktop (Touch controllers)
  • Input: IVRInput with a custom action manifest; the trigger is a vector1 action in its own action set (one action set per input group, each activated per hand with ulRestrictedToDevice = /user/hand/right etc.)
  • SteamVR's setting that allows overlay apps to take input priority is enabled:

What the app does each frame

// sets[] contains one VRActiveActionSet_t per (action set, hand).
// For the trigger set of the right hand:
sets[i].ulActionSet          = triggerSet;
sets[i].ulRestrictedToDevice = rightHandSource;
sets[i].nPriority            = blocked ? vr::k_nActionSetOverlayGlobalPriorityMin : 0;

vr::VRInput()->UpdateActionState(sets, sizeof(sets[0]), count);

vr::InputAnalogActionData_t d{};
vr::VRInput()->GetAnalogActionData(triggerAction, &d, sizeof(d), vr::k_ulInvalidInputValueHandle);
// d.bActive, d.x are used as the trigger value

blocked becomes true while the ray is on one of our overlays and false when it is not (or when the overlay under the ray is destroyed).

Observed log

f is my frame counter (one UpdateActionState + one read per frame), t is milliseconds. block lines are printed when I change nPriority for the trigger set (it takes effect on the next UpdateActionState). trigger input lines are printed when bActive changes.

f=1198 block   trigger=0 (before: trigger=1)       t=16060   <- priority lowered while the trigger is held
f=1199 trigger input active=0 (error=0, bActive=0, value=0.00)  t=16082   <- one frame, no data
f=1199 block   trigger=1 (before: trigger=0)       t=16085   <- (my app raised it again)
f=1200 trigger input active=1 (error=0, bActive=1, value=0.74)  t=16102   <- real value is back

The same pattern appeared every time the priority was lowered while the trigger was held (3 of 3 cases):

priority lowered at bActive == false at bActive == true again at
f=1198 f=1199 f=1200 (0.74)
f=1226 f=1227 f=1228
f=1282 f=1283 f=1284 (0.85)

Raising the priority (f=1255, trigger not held) was followed by no bActive change. The frame interval is about 16 ms.

Expected behavior

One of:

  1. bActive stays true and the held value keeps being reported across the priority change; or
  2. If a one-frame gap is expected, it should be documented (for UpdateActionState / VRActiveActionSet_t::nPriority), together with the recommended way to tell it apart from a real release.

Actual behavior

For one frame after the priority is lowered, bActive == false and x == 0, even though the trigger is held and the call returns VRInputError_None.

Impact

The app sees "trigger 0.61 → 0.00 → 0.74": a release and a new press within two frames, which a human cannot do. In my case a click on a button that disappears (so the ray ends up on another overlay behind it) was delivered twice, and the second one clicked the overlay behind it.

Workaround

When bActive is false, keep the previous value for up to 3 frames, then fall back to 0.

Questions

  • Is this gap intended when nPriority is lowered? Is it specific to this priority transition (global overlay priority → 0)?
  • Is there a recommended way to avoid it (for example, delaying the priority change until the input is released, or reading the data with a specific ulRestrictedToDevice)?

Notes / what I have not verified

  • I only tested Quest 2 through Virtual Desktop. I don't know whether it also happens with a native SteamVR headset or other controllers.
  • In one earlier run with the input-priority setting turned off, I saw a similar 0.00 → 0.94 jump, but that build had no bActive logging, so I can't say whether bActive was false there.
Lenguaje dominante
C++
Estrellas
6.7k
Forks
1.3k
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

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de ValveSoftware/openvr

Todos los issues de ValveSoftware/openvr

Issues similares

Más issues de C++

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.