Repository navigation
Reduce scheduling horizon on Cast - #83
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adjusts AudioProcessor scheduling behavior specifically for Google Cast receiver runtimes to reduce stuttering/disconnects by limiting how far ahead audio is scheduled into the browser playback pipeline.
Changes:
- Added Cast runtime detection (
CrKeyuser agent) inSendspinPlayer. - Threaded an
isCastRuntimeflag intoAudioProcessor. - Introduced much shorter Cast-specific scheduling horizon constants and applied them in horizon selection logic.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/index.ts | Detects Cast runtime and passes the flag into AudioProcessor construction. |
| src/audio-processor.ts | Adds Cast-specific horizon constants and selects shorter scheduling horizons when running on Cast. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
balloob
pushed a commit
that referenced
this pull request
Apr 13, 2026
Port two upstream bug fixes into the modular Core/Scheduler architecture: - #83 Reduce scheduling horizon on Cast: Add CAST_SCHEDULE_HORIZON_* constants and isCastRuntime parameter to AudioScheduler. Cast receivers now use shorter horizons (1.5s/1s/0.5s) to reduce stuttering. - #84 Reduce playback gaps after disconnects: Add measureBufferedPlaybackRunwaySec() and refill scheduling to AudioScheduler. SendspinPlayer defers playback reset on disconnect until buffered audio is exhausted, using new onConnectionOpen/ onConnectionClose events from Core. https://claude.ai/code/session_018UYYEXUZVuQ2Z4Texa7W6m
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.
When running on Cast receivers,
AudioProcessornow uses a much shorter scheduling horizon.This seams to reduce stuttering and disconnects, especially on the Nest Hub.
Total buffer size stays the same; the scheduling horizon just limits how much in advance audio is passed to the browser’s playback pipeline.