Bump yandex_ynison to v2.2.0: handoff state-sync FSM and opt-in stream-mode UI integration#3856
Open
trudenboy wants to merge 5 commits intomusic-assistant:devfrom
Open
Bump yandex_ynison to v2.2.0: handoff state-sync FSM and opt-in stream-mode UI integration#3856trudenboy wants to merge 5 commits intomusic-assistant:devfrom
trudenboy wants to merge 5 commits intomusic-assistant:devfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the yandex_ynison provider to upstream v2.2.0, bringing in a handoff-mode FSM rewrite, improved echo/reconnect handling in the Ynison client, and an opt-in stream-mode UI integration that publishes a frontend-only “fake queue” for richer UI rendering.
Changes:
- Reworks echo detection and reconnect behavior in
YnisonClient(AND-based author checks + post-reconnect settle window + session params update). - Adds a handoff playback mode with explicit FSM bookkeeping, heartbeat progress reporting, and idempotency/REPLACE handling.
- Adds opt-in stream-mode UI integration (fake queue events + output format stamping) and format prefetch/hinting to improve output format accuracy.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
music_assistant/providers/yandex_ynison/__init__.py |
Adds playback mode selection and UI integration / handoff heartbeat config entries; features vary by mode. |
music_assistant/providers/yandex_ynison/constants.py |
Introduces new config keys and handoff tuning constants. |
music_assistant/providers/yandex_ynison/protocols.py |
Extends the Yandex Music provider protocol with instance_id for instance-scoped URIs. |
music_assistant/providers/yandex_ynison/provider.py |
Implements handoff FSM + heartbeat, stream-mode UI integration (fake queue), and format prefetch/hints. |
music_assistant/providers/yandex_ynison/streaming.py |
Adjusts default lossless PCM params to 44.1kHz. |
music_assistant/providers/yandex_ynison/ynison_client.py |
Adds reconnect settle logic, session param updates, and AND-based echo classification. |
tests/providers/yandex_ynison/test_provider.py |
Updates/extends provider tests for prefetch + normalized format behavior. |
tests/providers/yandex_ynison/test_provider_handoff.py |
New comprehensive test suite for handoff mode FSM/heartbeat/idempotency behavior. |
tests/providers/yandex_ynison/test_streaming.py |
Updates streaming tests for 44.1kHz lossless defaults. |
tests/providers/yandex_ynison/test_ynison_client.py |
Updates Ynison client tests for new echo + reconnect semantics. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Bump
yandex_ynisonplugin provider to v2.2.0. The diff againstdevintroduces a real two-way state-sync layer for the experimentalhandoffplayback mode and adds an opt-in stream-mode UI integration so MA's player card renders fully while aPluginSourceis active.Source: trudenboy/ma-provider-yandex-ynison@v2.2.0.
Highlights
Handoff state-sync
Two-way sync between the Yandex Music app and MA's player queue is driven by an explicit
HandoffPhaseFSM (IDLE/ACTIVATING/PLAYING/PAUSED/ENDING)._handoff_activate→_apply_track_change/_apply_idle_resume/_apply_same_track_sync._cancel_pending_play_media()cancels the in-flightplay_mediatask before issuing a new one.cmd_pause/cmd_play(avoids the queue's_watch_pausewatchdog dropping to IDLE on long pauses).play_media(REPLACE) + seekwrapped incmd_pause/seek/cmd_play(avoids the audible 0-then-jump).PLAYING → IDLEqueue-state transition, gated on_expected_phase == PLAYINGand_is_at_natural_end_of_track. Heartbeat-side polling (≤ 5 s) as a fallback when MA's event bus drops the transition.queue.version.device_idandstatus.version.device_id. Lamport-style watermarks are intentionally not used — Ynison documentsversion.versionasrandom(int64)and re-stamps it._connect_statealways sends a fresh initial state._classify_drift(queue-rebuild guard, prevents stream mode from treating a Ynisonprogress=0echo as a seek),_pick_resume_position._handoff_pauseechoespaused=Trueto Ynison immediately and bumps the heartbeat watermark so the next tick doesn't race the user's pause.Stream-mode MA UI integration (opt-in)
New advanced config —
enable_ui_integration(default off) — publishes a frontend-only fake queue under the provider'sinstance_id, so MA's UI renders the seek bar, signal-chain panel, and quality indicator while aPluginSourceis active._register_plugin_queuefiresQUEUE_ADDED/QUEUE_UPDATEDevents without touchingplayer_queues._queues— backend command routing stays on thePluginSourcecallbacks._set_player_output_formatstampsplayer.extra_data["output_format"]for the signal-chain panel; cleared inunload()and_clear_active_player._signal_seek_to_frontendsnaps the frontend bar via a publicQUEUE_TIME_UPDATEDevent (no private-attribute writes).statederived from the liveYnisonState.is_pausedflag so pause / resume reflect immediately.Config UX
playback_modeandDevice name in Yandex Music(publish_name) moved out of the advanced section.enable_ui_integration(hidden in handoff mode).Stats
10 files changed, 2958 insertions(+), 89 deletions(-)(vsdev). One new test file:tests/providers/yandex_ynison/test_provider_handoff.py(993 lines). 283 unit tests,ruffandmypyclean on the source repo.Test plan
playback_mode: streamandplayback_mode: handoff: track change, pause / resume (short and long), next / prev, seek (forward and backward), mid-track handoff from the Yandex Music app, natural-end auto-advance.CI sync
Published via
trudenboy/ma-provider-tools/reusable-sync-to-fork.yml(targetupstream/yandex_ynison).