Skip to content

Fix silent serve --workers on macOS after sleep - #317

Merged
maximmaxim345 merged 1 commit into
mainfrom
fix/serve-clock-macos
Oct 29, 2026
Merged

maximmaxim345 merged 1 commit into
mainfrom
fix/serve-clock-macos

Conversation

@maximmaxim345

Copy link
Copy Markdown
Member

What does this implement/fix?

On macOS, sendspin serve --workers sent no audio after the Mac had slept, since the main process and the workers read two clocks that drift apart during sleep. Players connected but stayed silent, and the log filled with "Role queue full".

The main process now uses the same clock as the workers. On Linux and Windows both sides already read the same clock, so nothing changes there.

Related issue (if applicable):

Types of changes

  • Bugfix (non-breaking change which fixes an issue): bugfix
  • New feature (non-breaking change which adds functionality): new-feature
  • Enhancement to an existing feature: enhancement
  • Breaking change (changes CLI options, settings, hooks or the protocol in a way that is not backwards compatible): breaking-change
  • Refactor (no behavior change): refactor
  • Documentation only: documentation
  • Maintenance / chore: maintenance
  • CI / workflow change: ci
  • Dependencies bump: dependencies

On macOS, players heard no audio from a multi-worker serve after the
Mac had slept, and the log filled with "Role queue full".
Copilot AI balanced review requested due to automatic review settings October 29, 2026 11:48
@github-actions github-actions Bot added the bugfix Fixes a bug label Oct 29, 2026

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.

🟢 Approval recommended

No active review issues are recorded for the coordinator audio-clock alignment change.

No open issues 🎉

What changed in this PR

This PR fixes silent audio in multi-worker serve mode on macOS after sleep by aligning the coordinator’s audio clock with the workers’ clock.

Changes:

  • Replace the platform-specific clock helper with RawMonotonicClock for audio timestamps and buffer pacing.
  • Add a regression test verifying that chunk timestamps use the worker clock plus the initial playback delay.
File Description
tests/​serve/​test_coordinator.py Adds a regression test for worker-compatible chunk timestamps.
sendspin/​serve/​coordinator.py Uses RawMonotonicClock for stream timing and buffer pacing.

Review effort: Balanced

@maximmaxim345
maximmaxim345 merged commit e9a80e6 into main Oct 29, 2026
4 checks passed
@maximmaxim345
maximmaxim345 deleted the fix/serve-clock-macos branch October 29, 2026 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants