Recovering from a device outage reports a sync error and plays silence for the swallowed lookahead
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
- issue の種類
- バグ
- 明瞭さ
- 説明が足りない
- 活発さ
- 活発
- 技術スタック
- cpp
- 領域
- audio-video-rtc, cli
調査の方向性
Start by reading the existing write() deadline and wait-slice behavior, then trace SyncTask::process_playback_progress during device recovery. Compare the four sink implementations and the mentioned sendspin-cpp alignment API before choosing an approach. Done requires an agreed recovery behavior that avoids the reported error and long silence, with scope confirmed for all affected sinks.
索引モデルが issue の本文から書いたものです。
説明
Split off from #55, which fixes the #54 playback-clock bug for ALSA. The recovery is correct and bounded now, but it still costs one sync error and a long silence.
What happens
Measured on #55's hardware test, a 14 s USB DAC replug at 48 kHz:
- While the device is absent,
write()swallows audio immediately. Nothing back-pressures the sync task, so it drains its decode pipeline and keeps feeding whatever arrives. The stream pointer ends up ahead of real time by the server's send-ahead. - At reopen, the retired outage gap resets the playtime estimate to the device's finish timestamp (
SyncTask::process_playback_progress). The playhead is correct from here on. - The next chunk is not due for about 10.8 s, far past the 5 ms
HARD_SYNC_THRESHOLD_US, so the sync task reports ERROR once (Lost sync (10840302us off)) and inserts silence until the timeline catches up. Sync is regained roughly 11 s later.
So it is one bounded event rather than the loop #54 reported, but an operator still sees an ERROR state and about 11 s of silence after every recovery.
Two ways to avoid it
1. Pace the discard (this repo). While the device is absent, consume audio at roughly real time — waiting out write()'s existing deadline rather than returning at once — so the pipeline keeps its lookahead and the stream pointer stays near real time. The correction at reopen then lands inside the soft-sync range and nothing reports an error. write() already has a deadline and waits in slices, so the shape is there. The risks are a sink that blocks longer than the player expects during an outage, and that it should apply to all four sinks (#58).
2. Signal the outage to the library (needs sendspin-cpp). The sync task already suppresses the ERROR state while aligning, for initial sync and post-seek alignment. A sink that reported "I lost the device and have retired the gap" could get one silent realignment instead of an ERROR/SYNCHRONIZED pair. That needs an upstream API, so it would carry Requires-Upstream.
Option 1 shortens the silence as well as removing the error; option 2 only relabels it. Worth deciding which behaviour is wanted before implementing either.
- 主要言語
- C++
- スター
- 3
- フォーク
- 3
- 平均マージ
- 5時間 26分
- マージ済み PR(30日)
- 35
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Sendspin/sendspin-cpp-cli のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 78/100
Sendspin/sendspin-cpp-cli#70 · コメント 2 件 ·
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
Sendspin/sendspin-cpp-cli#32 · コメント 1 件 ·
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 38/100
Sendspin/sendspin-cpp-cli#30 · コメント 3 件 ·
Sendspin/sendspin-cpp-cli の issue をすべて見る
似ている issue
-
bug build
難易度 1/5 1時間未満 初心者へのやさしさ 91/100
facebookincubator/velox#19194 ·
-
JIT-compiled number -> Decimal conversion silently overflows instead of raising DECIMAL_OVERFLOW オープンfuzz
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
ClickHouse/ClickHouse#122114 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
-
module/agent platform/macos type/bug/regression
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
-
enhancement PyCDE
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100