Skip to content

Fix sync group volume capabilities - #6281

Open
teancom wants to merge 4 commits into
devfrom
fix/sync-group-volume-features
Open

teancom wants to merge 4 commits into
devfrom
fix/sync-group-volume-features

Conversation

@teancom

@teancom teancom commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

What does this implement/fix?

If you have a mixed sync group including Players and Screens, the front-end could end up in a state where the volume value was shown but the control was disabled, if one of the Screens became the group leader.

Types of changes

  • Bugfix (non-breaking change which fixes an issue) — bugfix
  • New feature (non-breaking change which adds functionality) — new-feature
  • Enhancement to an existing feature — enhancement
  • New music/player/metadata/plugin provider — new-provider
  • Breaking change (fix or feature that would cause existing functionality to not work as expected) — breaking-change
  • Refactor (no behaviour change) — refactor
  • Documentation only — documentation
  • Maintenance / chore — maintenance
  • CI / workflow change — ci
  • Dependencies bump — dependencies

Checklist

  • The code change is tested and works locally.
  • pre-commit run --all-files passes.
  • pytest passes, and tests have been added/updated under tests/ where applicable.
  • For changes to shared models, the companion PR in music-assistant/models is linked.
  • For changes affecting the UI, the companion PR in music-assistant/frontend is linked.
  • I have read and complied with the project's AI Policy for any AI-assisted contributions.
  • I have raised a PR against the documentation repository targeting the main or beta branch as appropriate.

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.

🟡 Changes recommended

Follower-only playback capabilities are incorrectly advertised even though commands remain leader-bound.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Fixes sync-group volume controls when a volume-less player becomes leader.

Changes:

  • Aggregates supported features from all active group members.
  • Preserves group-derived volume capabilities in serialized player state.
  • Adds regression coverage for mixed-capability sync groups.
File summaries
File Description
music_assistant/providers/sync_group/player.py Aggregates member capabilities.
music_assistant/models/player.py Preserves group volume features.
tests/providers/sync_group/test_sync_group.py Tests mixed leader/member capabilities.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 1
  • Review effort level: Balanced (auto)

Note

Copilot is running an experiment and ran this review at Balanced.


💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread music_assistant/providers/sync_group/player.py Outdated

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.

🟡 Changes recommended

The regression test does not currently exercise the core group-feature finalization fix.

Get a fresh assessment by requesting another Copilot review.

Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Comment thread tests/providers/sync_group/test_sync_group.py
@OzGav

OzGav commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

Hi David. Just marking this one as draft due to open copilot conversation so we can keep focussed on the ones that need our attention. Please mark as ready for review when you want another look.

@OzGav
OzGav marked this pull request as draft September 24, 2026 23:31
@teancom

teancom commented Sep 24, 2026

Copy link
Copy Markdown
Contributor Author

SIGH I knew I should audit my open PRs. Thank you, I'd missed that this was waiting on me.

@teancom
teancom force-pushed the fix/sync-group-volume-features branch from a0c3597 to a426dec Compare September 25, 2026 01:20
Derive volume and mute support from available group members, including when a volume-less display is the sync leader. Preserve these member-derived capabilities during final PlayerState normalization and add mixed-group regression coverage.
Uniting every member feature into the group advertised enqueue, gapless
playback and multi-device DSP from followers, although those commands are
only ever forwarded to the sync leader. Only volume and mute are fanned
out to every member, so only those are now taken from the members while
a leader exists; a dormant group still derives everything from its
configured members.

The regression test now stores "none" as the group's volume and mute
control, so it fails without the group-specific finalization in the
player model instead of passing through an unconfigured mock.
Group volume and mute are fanned out to the members of the sync leader's
live session, so a configured member that never joined must not add a
volume control the group cannot drive. Use the same member list the
commands use, which still falls back to the configured members while
the group is dormant.

Also correct the README on the power feature and the leader/member
split, and tighten the new tests to assert the positive cases too.
Group volume and mute are always fanned out to the members and use each
member's own control, so the group's own volume/mute control selection
(and the min/max volume limits that hang off it) never had an effect on
routing and, now that a group's features come from its members, no
longer affects what is advertised either. Only the opt-in power control
remains for groups. Values already stored for a group are left in place;
nothing consults them anymore.
@teancom
teancom force-pushed the fix/sync-group-volume-features branch from 0a71ed0 to 57b530c Compare September 25, 2026 04:41
@teancom
teancom marked this pull request as ready for review September 25, 2026 04:42
@teancom

teancom commented Sep 25, 2026

Copy link
Copy Markdown
Contributor Author

Okay, findings addressed, as well as one that I discovered while reviewing the new code - the group-level volume/mute config was wholly vestigial after this. It mostly was before (setting the volume control to 'Native' on a group was never actually doing anything, for example) but now it is completely. So now only the fake Power is at the group-level config.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants