Prefer active output protocol first when grouping members
authorMarcel van der Veldt <m.vanderveldt@outlook.com>
Wed, 25 Feb 2026 21:43:44 +0000 (22:43 +0100)
committerMarcel van der Veldt <m.vanderveldt@outlook.com>
Wed, 25 Feb 2026 21:43:44 +0000 (22:43 +0100)
music_assistant/controllers/players/protocol_linking.py

index 396eb3f8390bd24d203820c99a9b45d6de1a73c3..ed183b2c72dee032c8cffe16b561c3ae8e357282 100644 (file)
@@ -1205,8 +1205,8 @@ class ProtocolLinkingMixin:
 
         Selection priority when grouping:
         1. Try child's preferred output protocol (from player settings)
-        2. Try native grouping (if parent and child are compatible)
-        3. Try parent's active output protocol (if any and child supports it)
+        2. Try parent's active output protocol (if any and child supports it)
+        3. Try native grouping (if parent and child are compatible)
         4. Search for common protocol that supports set_members
         5. Log warning if no option works
 
@@ -1266,19 +1266,7 @@ class ProtocolLinkingMixin:
                 )
                 continue
 
-            # Priority 2: Try native grouping
-            if self._can_use_native_grouping(
-                child_player, parent_player, parent_supports_native_grouping
-            ):
-                native_members.append(child_player_id)
-                self.logger.log(
-                    VERBOSE_LOG_LEVEL,
-                    "Using native grouping for %s",
-                    child_player.state.name,
-                )
-                continue
-
-            # Priority 3: Try parent's active output protocol (if it supports SET_MEMBERS)
+            # Priority 2: Try parent's active output protocol (if it supports SET_MEMBERS)
             if parent_protocol_domain and parent_protocol_player:
                 # Verify the active protocol supports SET_MEMBERS
                 if PlayerFeature.SET_MEMBERS in parent_protocol_player.state.supported_features:
@@ -1303,6 +1291,18 @@ class ProtocolLinkingMixin:
                     parent_protocol_player = None
                     parent_protocol_domain = None
 
+            # Priority 3: Try native grouping
+            if self._can_use_native_grouping(
+                child_player, parent_player, parent_supports_native_grouping
+            ):
+                native_members.append(child_player_id)
+                self.logger.log(
+                    VERBOSE_LOG_LEVEL,
+                    "Using native grouping for %s",
+                    child_player.state.name,
+                )
+                continue
+
             # Priority 4: Search for common protocol that supports set_members
             parent_protocol, child_protocol = self._try_find_common_protocol(
                 child_player, parent_player