Skip to content

Bump aiosendspin to 3.0 - #2924

Merged
balloob merged 6 commits into
devfrom
bump-aiosendspin-2.0
Jan 20, 2026
Merged

Bump aiosendspin to 3.0#2924
balloob merged 6 commits into
devfrom
bump-aiosendspin-2.0

Conversation

@balloob

@balloob balloob commented Jan 4, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR shows a preview of the changes needed to adapt to breaking changes in aiosendspin 2.0 and 3.0.

The changes are due to breaking changes in Sendspin/aiosendspin#112 and Sendspin/aiosendspin#115 that we're testing out:

  • start_server now accepts multiple addresses to listen on for discovery
  • Event listener callbacks changed from async (Coroutine) to synchronous
  • start_server() API changed from advertise_host: str to advertise_addresses: list[str] | None

Changes made

provider.py:

  • Changed event_cb() from async to sync
  • Extracted async logic into _handle_client_added() and _handle_client_removed() helper methods scheduled via self.mass.create_task()

player.py:

  • Changed event_cb() from async to sync (no async operations needed)
  • Changed group_event_cb() from async to sync
  • Extracted async group.stop() logic into _handle_member_removed() helper method scheduled via self.mass.create_task()
  • Changed advertise_host parameter to advertise_addresses list

Adapt to breaking changes in aiosendspin:
- Change event listener callbacks from async to synchronous
- Change start_server advertise_host to advertise_addresses
@balloob balloob changed the title Bump aiosendspin to 2.0 Bump aiosendspin to 3.0 Jan 4, 2026
Check if client still exists after waiting for pending unregister,
preventing player registration attempts for disconnected clients.
@maximmaxim345
maximmaxim345 marked this pull request as ready for review January 16, 2026 12:27
Copilot AI review requested due to automatic review settings January 16, 2026 12:27
@maximmaxim345
maximmaxim345 marked this pull request as draft January 16, 2026 14:06
@maximmaxim345

maximmaxim345 commented Jan 16, 2026

Copy link
Copy Markdown
Member

Have some weird syncing issues with aiosendspin version 3.0.0. After grouping and ungrouping players (in my case cast and web players) a couple of times, some players start playing out of sync or sometimes don't play at all.

Will investigate more into why this happens.

Edit: underlying issue was probably already existing before 3.0.0, but the changed logic in determine_optimal_format (Sendspin/aiosendspin#129) "activated" it.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@maximmaxim345
maximmaxim345 marked this pull request as ready for review January 20, 2026 10:59

@maximmaxim345 maximmaxim345 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Turns out the issue with out of sync players wasn't due this bump to aiosendspin 3.0.0.
The main issue was a bug in sendspin-js, which caused out of sync playback after stream restarts. Its now fixed in sendspin-js version 1.0.1

@balloob
balloob merged commit 1d6fec3 into dev Jan 20, 2026
10 checks passed
@balloob
balloob deleted the bump-aiosendspin-2.0 branch January 20, 2026 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants