Skip to content

Reconnect and resume after a mid-stream server drop (playback protocol v3 §6.2) #450

Open

Description

@Rhainland

Problem

When the server restarts or the connection drops mid-playback, a stream that was already playing should pause and resume at the same position once the server answers again (1.0 Core experience: "mid-stream drop → pause and auto-resume on reconnect"). Silo-Server/silo-server#1808 (fixing Silo-Server/silo-server#1792) implements this on the web and writes the rule down in docs/architecture/playback-protocol-v3.md §6.2 "A lost connection is not a failed route".

In silo-android, PlaybackSessionManager (android-shared/.../common/player/PlaybackSessionManager.kt) falls back to FAILURE_RECOVERY_V3_OPERATION for failures that are not a seek or an explicit intent, including a lost connection. A failure_recovery replan tells the server to exclude the current route, so after a network blip a direct-play viewer can come back on a transcode, and when the server is down the replan itself fails.

Proposed change

Follow §6.2:

  1. A network failure on a stream that has already shown a frame is a lost connection: pause, show a reconnecting state, keep the position.
  2. Retry with a no-op track_change replan at the saved position (keeps the route eligible), with backoff (the web uses 1, 2, 4, 8 s, then every 15 s, for 12 attempts) and one attempt in flight at a time.
  3. If the session is gone (404 after a server restart), start a new session at the saved position with the current audio and subtitle choice (omit the subtitle fields when subtitles are off), then stop the old session.
  4. Resume playing only if the viewer was playing. On give-up, show "Connection lost" with Try again.
  5. A stream that fails before its own first frame keeps the existing startup-failure path and failure_recovery, since that route may be unreachable from this device.

References

AI Disclosure

  • Harness: Claude Code (running in T3 Code)
  • Tool(s): Claude Code (Bash, Read, sub-agents, browser automation through the T3 Code preview), GitHub CLI, Docker, FFmpeg
  • Model(s): claude-opus-5-5
  • Involvement: Fully AI-generated, human verified
  • Adversarial review: n/a

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions