voice: tolerate the wake-tail pause; harden the front end
Endpointing fix. The wake detector usually fires inside the wake phrase, so the first speech captured after it is the phrase's tail (plus the cue beep echoing back through the mic), not the command. A fixed 500 ms trailing-silence endpoint then ended the capture during the natural pause before the command: the utterance held 240-400 ms of speech and STT returned empty. In a recorded session 18 of 30 wakes dropped the command that way (only 10 transcribed). The endpoint now uses a longer silence tolerance (vad.initial_silence_ms, default 1500) until vad.min_command_ms (default 700) of speech is in hand, then reverts to vad.silence_ms, so a pause before the command is tolerated while a real command still ends promptly. Front-end hardening (the ways it was silently dying or losing work): - Utterances run on a worker thread, not the audio thread, and a task error is traced and spoken rather than propagated, so one bad command cannot stop the mic or take the front end down. - Capture-stream watchdog: read with a timeout and close/reopen the input after a sustained stall, so a wedged PortAudio/ALSA callback recovers instead of hanging the gateway (traced voice_stream_stalled/reopened). - faulthandler enabled (CLI + unit) so a fatal signal dumps every thread's stack to the journal. - The scheduler's answer-side entry points (answer, answer_question, resolve_repair, answer_approval) are guarded like submit_request: an EngineUnavailable is fatal-and-reported and any other resume/repair error returns a reply instead of propagating into a front end.
This commit is contained in:
1 parent
e86ed805ee
commit
f6ef66b532
9 files changed
+391
-33
No files matched your search
@@ -13,6 +13,7 @@ Run on a host with SemIf + a GGUF + a local OpenAI-compatible server:
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import faulthandler
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
@@ -822,6 +823,12 @@ def run_gateway(
|
||||
run two scheduler processes over one skill store), so each gets its own
|
||||
transport thread but they route through one `GatewayService`.
|
||||
"""
|
||||
# Dump every thread's Python stack on a fatal signal (SIGSEGV/SIGABRT/...):
|
||||
# a wedged front end (e.g. a voice loop stuck on the mic) leaves a trace in
|
||||
# the journal instead of dying silently. Also enabled by the unit's
|
||||
# PYTHONFAULTHANDLER=1; harmless when set twice.
|
||||
faulthandler.enable()
|
||||
|
||||
gateway_cfg = config.get("gateway", {}) or {}
|
||||
platforms = _resolve_platforms(platform, gateway_cfg)
|
||||
|
||||
|
||||
Reference in new issue
Block a user