Skip to content

Allow per-player delay configuration#67

Merged
kahrendt merged 3 commits intomainfrom
add-sync-delay
Feb 25, 2026
Merged

Allow per-player delay configuration#67
kahrendt merged 3 commits intomainfrom
add-sync-delay

Conversation

@maximmaxim345
Copy link
Member

@maximmaxim345 maximmaxim345 commented Jan 30, 2026

Players report static_delay_ms in client/state (always present, 0-5000ms range). Servers can adjust it via set_static_delay command for players that list it in supported_commands in the player roles client/state object.

Clients subtract static_delay_ms from server timestamps before scheduling playback (a 300ms delay means external equipment has 300ms latency, so playback starts earlier). Servers factor it into buffer calculations to maintain headroom. Value persists locally across reboots.

Example implementations

Scenario static_delay_ms set_static_delay supported
DIY speaker without pre-calibrated delay User adjustable Yes
Ready-made speaker with factory-measured delay 0 No
Active speakers connected to pre-calibrated audio port Delay matching speaker latency Yes
Active speakers with delay measured outside Sendspin Read-only value for buffer optimization No

Limitations

  • No way to reduce server buffer headroom for devices with inherent internal delay (e.g., 100ms DAC/DSP). Since 0 must remain the default baseline, that 100ms cannot be reclaimed. We will accept that players with a high latency DAC/DSP will need to advertise a larger buffer_capacity and compensate that themselves.

@maximmaxim345 maximmaxim345 marked this pull request as ready for review February 6, 2026 09:05
Copy link
Contributor

@kahrendt kahrendt left a comment

Choose a reason for hiding this comment

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

LGTM

@kahrendt kahrendt merged commit fb7d904 into main Feb 25, 2026
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.

2 participants