Skip to content

Report error state when out of sync#67

Merged
kahrendt merged 1 commit into
mainfrom
error-state-on-hard-sync
Jun 8, 2026
Merged

Report error state when out of sync#67
kahrendt merged 1 commit into
mainfrom
error-state-on-hard-sync

Conversation

@kahrendt

@kahrendt kahrendt commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Report error state when out of sync and report synchronized when recovered. Logs out of sync/resync events. This is required by the spec (https://github.com/Sendspin/spec/blob/133383e588bbf1ddcfcf9952626ede0bcdef79a3/README.md?plain=1#L175)

Closes #63

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Implements protocol-required client state transitions for sync loss/recovery in the sync task, adding explicit ERROR reporting when playback falls out of sync and SYNCHRONIZED when alignment is regained, with logging around these transitions.

Changes:

  • Add SyncContext flags to track alignment phases and edge-trigger ERROR/SYNCHRONIZED transitions.
  • Emit client/state=ERROR once when sync is lost (outside alignment phases), and client/state=SYNCHRONIZED when in-tolerance sync is regained.
  • Mark post-seek periods as “aligning” to avoid reporting expected hard-sync behavior as an error.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/sync_task.h Adds aligning / reported_error flags to track alignment lifecycle and state transition edges.
src/sync_task.cpp Reports ERROR on out-of-sync, reports SYNCHRONIZED on recovery, and treats post-seek as an expected alignment phase.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/sync_task.cpp
@kahrendt kahrendt merged commit 88ab89f into main Jun 8, 2026
6 checks passed
@kahrendt kahrendt deleted the error-state-on-hard-sync branch June 8, 2026 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Send client/state: 'error' on audio underflow

2 participants