Skip to content

Use SyncedPlayer for drift-corrected playback#1

Merged
maximmaxim345 merged 12 commits intomainfrom
feat-synced-playback
Jan 22, 2026
Merged

Use SyncedPlayer for drift-corrected playback#1
maximmaxim345 merged 12 commits intomainfrom
feat-synced-playback

Conversation

@maximmaxim345
Copy link
Copy Markdown
Member

@maximmaxim345 maximmaxim345 commented Jan 22, 2026

Switches to sendspin's SyncedPlayer with ClockSync for timestamp-accurate playback synchronized to server time.

Replaces manual AudioScheduler with a channel-driven architecture where a dedicated thread owns the SyncedPlayer. Clock synchronization now uses Kalman filter-based drift correction via NTP-style timestamp exchange.

Use sendspin's SyncedPlayer with ClockSync for timestamp-accurate
playback synchronized to server time. Replace manual AudioScheduler
with command-driven architecture for thread-safe playback control.
# Conflicts:
#	src-tauri/Cargo.lock
#	src-tauri/Cargo.toml
#	src-tauri/src/sendspin/mod.rs
The `[lints.rust]` and `[lints.clippy]` sections were accidentally
removed, which disabled `unsafe_code = "forbid"` and clippy pedantic
warnings.
The comment said "parking_lot::Mutex" but the code uses TokioMutex.
These structs are deserialized by serde from JSON, not constructed
directly in Rust code.
Ports sendspin-rs change: the audio callback needs synchronous locking,
not async. TokioMutex is designed for async contexts while parking_lot
is more appropriate for real-time audio callbacks.
@maximmaxim345 maximmaxim345 marked this pull request as ready for review January 22, 2026 15:33
Required by cpal/sendspin for audio playback on Linux.
- Add backticks to code references in doc comments
- Remove redundant `continue` statements
- Use `map_or` instead of `map().unwrap_or()`
@maximmaxim345 maximmaxim345 merged commit af898b8 into main Jan 22, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant