fix(audiotap): drop misfiring silent-death watchdog#2
Merged
Conversation
silent-death watchdog (2b) が「鳴っているはずなのに tap が無音」を IsRunningOutput で判定していたが、IsRunningOutput は出力ストリームを 開いているだけで真になる。Teams やブラウザは無音でもストリームを握り 続けるため currentOutputAppNames() が常時非空になり、silent 15s + backoff 45s ごとに延々と tap を recreate していた(実機 1 日で 679 回、 うち 661 回は内蔵スピーカー上 — BT は無関係)。 recreate のたびに tap を teardown/rebuild するため、その窓で相手の発話を 取りこぼし、結果として system 音声がほぼ拾えなくなっていた。 silent-death が独自に救う失敗モードは既に他の経路でカバーされている: - 完全死 → frames-stall (1) - BT プロファイル/レート変化 → format listener + device-rate reconciliation このため 2b を削除し、養うためだけにあった state(lastLoudAt / lastRecreateAt / silentThreshold / recreateBackoff)と handleIO の hot-path ピーク走査も除去する。 実機で再起動後 0 recreate / tap 安定を確認。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
症状
system 音声(通話相手側)がほとんど文字起こしされない。実機ログで
~/.config/steno/transcriptsの system 発話が 1 日 1 件まで落ちていた。原因
silent-death watchdog (2b) の誤爆。発火条件は「
silent 15s経過 +backoff 45s経過 + 出力中アプリが存在」だが、その「出力中」の根拠がkAudioProcessPropertyIsRunningOutput。これは出力ストリームを開いているだけで真になり、Teams やブラウザは無音でもストリームを握り続ける。結果としてcurrentOutputAppNames()が常時非空になり、何も鳴っていなくても 45s おきに tap を recreate していた。実機 1 日のログ:
silent ...output device format changeddefault output device changedうち 661 回は内蔵スピーカー上で発生。Bluetooth プロファイル切り替えとは無関係の純粋な誤爆だった。
recreate のたびに tap を teardown→rebuild するため、相手が喋った瞬間がその窓に当たると取りこぼす。churn 自体が「拾えない」の正体。
修正
silent-death (2b) を削除。これが独自に救う失敗モードは既に他経路でカバー済み:
合わせて、2b を養うためだけに存在した state(
lastLoudAt/lastRecreateAt/silentThreshold/recreateBackoff)と、handleIOhot-path のピーク走査を除去した。検証
修正版を install して再起動後、約 30 秒で silent recreate 0 / tap は起動 1 回のまま安定を実機で確認。
🤖 Generated with Claude Code