app: replace audio send polling with blocking queue.get

Deterministic wake on data arrival instead of 5ms sleep loop.
Reduces CPU wake-ups and eliminates up to 5ms of added latency.
This commit is contained in:
Username
2026-02-24 16:25:42 +01:00
parent 7a2c8e3a5d
commit bfa79eadcb

View File

@@ -676,13 +676,11 @@ class TuimbleApp(App):
@work(thread=True)
def _audio_send_loop(self) -> None:
"""Poll capture queue and send encoded frames to server."""
"""Send captured audio frames to the server."""
while self._client.connected:
frame = self._audio.get_capture_frame()
frame = self._audio.get_capture_frame(timeout=0.02)
if frame is not None:
self._client.send_audio(frame)
else:
time.sleep(0.005)
# -- channel tree --------------------------------------------------------