Allow user-configured shairport-sync instances on the same host to be discovered...
authorCopilot <198982749+Copilot@users.noreply.github.com>
Wed, 25 Feb 2026 16:11:01 +0000 (17:11 +0100)
committerGitHub <noreply@github.com>
Wed, 25 Feb 2026 16:11:01 +0000 (17:11 +0100)
* Initial plan

* fix: only filter local ShairportSync instances matching MA's own AirPlay Receiver ports

Co-authored-by: MarvinSchenkel <17671719+MarvinSchenkel@users.noreply.github.com>
---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: MarvinSchenkel <17671719+MarvinSchenkel@users.noreply.github.com>
music_assistant/providers/airplay/provider.py

index 2b9214aadd48d07200f6638800c69c6e6814d8a0..cd6eeb28267a63900537305e007bedac001448a0 100644 (file)
@@ -152,7 +152,16 @@ class AirPlayProvider(PlayerProvider):
         if model == "ShairportSync":
             # Check if this is a local address (127.x.x.x or matches our server's IP)
             if address.startswith("127.") or address == self.mass.streams.publish_ip:
-                return
+                # Only filter if the port matches one of MA's own AirPlay Receiver instances.
+                # This allows user-configured shairport-sync instances on the same machine
+                # to be used as AirPlay players (e.g., multiple audio outputs via shairport-sync).
+                receiver_ports = {
+                    port
+                    for prov in self.mass.get_provider_instances("airplay_receiver")
+                    if (port := getattr(prov, "airplay_port", None)) is not None
+                }
+                if discovery_info.port in receiver_ports:
+                    return
 
         if not self.mass.config.get_raw_player_config_value(player_id, "enabled", True):
             self.logger.debug("Ignoring %s in discovery as it is disabled.", display_name)