From 9a18326aecd53c5619109dd2c5da1f26689f2f7b Mon Sep 17 00:00:00 2001 From: yum Date: Sat, 9 Sep 2023 17:00:36 -0700 Subject: Bugfix: fix process leak in PythonWrapper::InvokeCommandWithArgs It now waits up to 10 seconds for a graceful exit and falls back on the equivalent of a SIGKILL. The caller is assumed to have signaled to the process through `in_cb` that an exit is desired. Also: * Fix graceful exit path of transcribe_v2.py. * Add toggle to enable/disable preview text. It is enabled by default. * Constrain transcription temperature to 0.0. This keeps latency more predictable at the cost of some accuracy. --- Scripts/steamvr.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Scripts/steamvr.py') diff --git a/Scripts/steamvr.py b/Scripts/steamvr.py index da07134..3e6c6c9 100644 --- a/Scripts/steamvr.py +++ b/Scripts/steamvr.py @@ -19,6 +19,7 @@ class InputEvent: def pollButtonPress( hand: str = "right", button: str = "b", + ctrl = None # ThreadControl object ) -> int: hands = {} hands["left"] = vr.TrackedControllerRole_LeftHand @@ -31,7 +32,7 @@ def pollButtonPress( system = None first = True - while not system: + while ctrl.run_app and not system: try: system = vr.init(vr.VRApplication_Background) except Exception as e: @@ -42,7 +43,7 @@ def pollButtonPress( last_packet = 0 event_high = False - while True: + while ctrl.run_app: time.sleep(0.01) lh_idx = system.getTrackedDeviceIndexForControllerRole(hands[hand]) -- cgit v1.2.3