Skip to content

Specification updates#3

Merged
maximmaxim345 merged 13 commits intomainfrom
spec-updates
Sep 15, 2025
Merged

Specification updates#3
maximmaxim345 merged 13 commits intomainfrom
spec-updates

Conversation

@kahrendt
Copy link
Copy Markdown
Contributor

@kahrendt kahrendt commented Sep 11, 2025

This PR introduces significant breaking changes to the Resonate protocol, fundamentally restructuring how clients, groups, and streams are managed. Having proven the underlying technical basis for the protocol is sound, these changes establish a more consistent data model and build a flexible architecture for future improvements. It also lays the groundwork for supporting visualizer clients.

Unresolved Questions

  • Server -> client volume/mute messages were removed and need replacing. How should these messages be named? (They only should be sent to clients with the player role)
  • The group/get-list, group/list, group/join, and group/unjoin message details need further discussion
    • Determine if any client roles need awareness of stream or group IDs
    • If not needed, only send IDs when specifically requested via these messages
  • Some server -> client message fields should be conditionally sent based on client role

Breaking Changes

New Architecture Concepts

  • Client Roles System: Clients now declare capabilities through roles (player, controller, metadata, visualizer)
  • Groups: Proper group definition, where clients belong to exactly one group
  • Sessions: Separated from streams - sessions track media/playback state while streams handle encoding

Protocol Message Changes

Added Messages

  • stream/start, stream/update, stream/end - Manage client-specific stream encoding
  • session/update - Replaces metadata updates with session-scoped information
  • group/update, group/command - Group state and controls
  • player/update - Player state reporting
  • stream/request-format - Dynamic format changes

Removed Messages

  • session/start, session/end - Replaced by stream messages
  • metadata/update - Replaced by session/update
  • stream/command - Replaced by group/command
  • player/state - Replaced by player/update
  • volume/set, mute/set - Now handled through group commands in the client -> server direction. They need replacement in the server -> client direction.

Modified Messages

  • client/hello - Restructured to support multiple roles and capability declarations
  • Binary messages - Added timestamps for synchronization; expanded to include visualization data

Key Improvements

Synchronization

  • All binary messages include synchronized timestamps

Flexibility

  • Per-client encoding based on capabilities and network conditions
  • Dynamic format changes during playback

Protocol Clarifications

  • Continuous clock synchronization via client/time messages
  • Client-side synchronization with interpolation for drift compensation
  • Support for heterogeneous devices within the same group

Documentation Clarity

  • Comprehensive field descriptions with optional field notation (?)
  • Clearer state management descriptions for groups, sessions, and streams
  • Improved mermaid sequence diagram showing interaction flow
  • Consistent message structure and naming conventions

@maximmaxim345 maximmaxim345 merged commit 9e42404 into main Sep 15, 2025
maximmaxim345 added a commit to Sendspin/aiosendspin that referenced this pull request Sep 22, 2025
This PR updates `aioresonate` to use the new spec version merged in:
- Sendspin/spec#3.

Closes: Sendspin/backlog#7
Closes: Sendspin/backlog#6

With this PR, `aioresonate` should mostly comply with the spec upto
[this
version](https://github.com/Resonate-Protocol/spec/tree/6478bec14aff8a209d8bcdd237f705ca41a394a8)
and these [mDNS
addtions](Sendspin/spec#8),
Specifically:

### Core Protocol
Should be fully compliant

### Player Role
- Buffer size is not correctly calculated (and not used from the
`client/hello` message)

### Controller Role
- `group/get-list`, `group/join`, `group/unjoin` are not implemented
- `group/list` response is never sent
- `group/update` is never sent, therefore `supported_commands` is never
sent as well
- `group/command` does not handle volume commands by itself, just relays
it to the library user

### Metadata Role
- `track_progress` is always `None`

### Visualizer Role
- Completely unimplemented, since spec is not complete yet
@maximmaxim345 maximmaxim345 deleted the spec-updates branch October 6, 2025 06:54
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