Skip to content

Add implementation guide for (sdk) developers on the spec repository #205

Closed

Description

@maximmaxim345

The spec should be joined by a non-normative implementation guide, and this issue proposes creating one and tracks what goes in it. Reviewers have deferred guidance to such a guide nine times so far, and because the guide does not exist, eight of those nine items survive only in closed review threads.

The split is clear in review: the spec says what goes on the wire, and the deferred items say how to build a client or server well. Each item below was kept out of the spec for that reason, not because anyone disagreed with it.

Add new items to this issue rather than opening separate ones, and link here from any thread that defers something.

What goes in it

Pairing method choice

A client with a usable out-channel should offer dynamic_pairing_code rather than static_pairing_code, and should offer qr_code when its display can render one. This is the one item whose text is still in the spec: pairing.md holds it with a lowercase should until the guide exists (#189, #184). Move it here at that point.

A client offers at most one pairing-code method because offering the user both is too complicated to explain and the difference between them is not something a user should have to understand (#186).

Timing and security

Pairing cooldowns must not be set too low, and the guide needs to explain what a low cooldown costs later. #194 requires a client to hold attempts back after 20 consecutive failures until an operator acts, and leaves any earlier cooldown to the client as a MAY, so the guide is where a client learns what to choose under that MAY. A product ships with a permissive cooldown, Sendspin adds a role with higher security requirements, the product gates that role behind pairing, and the operator then cannot tell an attacker's pairing record from a legitimate one, so only a factory reset restores security. Raising the cooldown when the role is added is already too late (#194).

The operator action that ends the 20-failure hold must be deliberate for that product, and the spec names no examples on purpose. Artur's test: if a reboot happens naturally during normal operation, it ceases to be a meaningful signal. So a plain power cycle only fits hardwired or otherwise stationary devices that nobody unplugs by accident, not devices on switched outlets or smart plug schedules, and not portable or battery devices. Those use a power-cycle pattern, a long press on a control, or the device's own UI. Whatever is chosen is reported in reason and described in message on client/pair-pending (#194).

A client needs a method for computing min_buffer_ms. The spec requires the field and gives no way to derive a value, unlike required_lead_time_ms. One suggested starting point is the distribution of time-message latencies at roughly the 95th percentile, pending experiments (#69).

A client needs a retry curve for reconnecting after a Noise handshake failure. The spec tells servers to apply backoff on repeated handshake failures and is deliberately silent on the client side. This was routed to the SDK repositories and Sendspin/conformance, so it may belong there instead of here (#92).

device_info.mac_address carries a stable hardware identifier for the interface the connection is opened on. Consent and privacy handling for it was judged deployment policy rather than wire format, and no field in the spec carries privacy prose, so the guidance exists nowhere today (#87).

Operational advice

An SDK needs a persistence hook for server_id and for output_delay_ms. The spec already requires both to persist, and the recommended hook shape was dropped as an SDK API concern, so one entry can cover the pattern (#92, #93).

A client with an amplifier or external output should power up when the group's playback_state is playing and power down after it has been stopped for a vendor-chosen interval, so the user never thinks about the amplifier. This was rejected as a protocol role, partly because a role would push the policy decision onto the user, which leaves the policy itself unwritten (#127).

A device with several audio outputs can run one client identity per output, each with its own group, volume, required_lead_time_ms and min_buffer_ms, and can sum them locally when they share a physical output, because both streams carry absolute timestamps and both time filters run off the same host clock. Multiple role instances were ruled out of scope, so this approach is recorded only in a closed issue (#151).

Pairing-code presentation

The server selects the pairing-code format (digits or qr_code), but does not select an output channel. The guide should explain how a client with both a display and a speaker chooses where to present the code, including whether to display and speak digits together.

Partly late audio chunks

Explain how players handle an audio chunk whose beginning is already late but whose remaining samples could still play on time. Cover the trade-off between discarding the whole chunk and decoding it while dropping only the late prefix, including codec-state continuity and maintaining synchronization.

Open questions

Where the guide lives decides part of its contents. If it sits in this repository it covers the reconnect curve and the persistence hooks, and if it sits with the SDKs those two items go to their existing home instead.

Whether the guide carries any normative weight needs settling before it is written. #100's keyword cleanup will keep surfacing sentences that are advice rather than requirements, and the answer decides whether they move here or stay in the spec with a lowercase keyword, as the pairing-method paragraph does today.

Activity

  1. added a commit that references this issue on Sep 7, 2026
  2. changed the title [-]Add an implementation guide as an amendment to the spec[/-] [+]Update implementation guide on the website[/+] on Sep 9, 2026
  3. changed the title [-]Update implementation guide on the website[/-] [+]Add implementation guide for (sdk) developers on the spec repository[/+] on Sep 9, 2026
  4. moved this from Triage to Later in Sendspin Project Boardon Sep 9, 2026
  5. added theissue type on Sep 9, 2026
  6. marcelveldt commented on Sep 9, 2026

    @marcelveldt
    Contributor

    decide what items should be in the spec and what should not be in the spec but just written down in the implementation guide file

  7. moved this from Later to Triage in Sendspin Project Boardon Sep 9, 2026
  8. moved this from Triage to Next in Sendspin Project Boardon Sep 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions