From 5ff68074e5581a8833ad104f77395f2038ae9ef7 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Wed, 25 Feb 2026 17:11:01 +0100 Subject: [PATCH] Allow user-configured shairport-sync instances on the same host to be discovered as AirPlay players (#3221) * 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 | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/music_assistant/providers/airplay/provider.py b/music_assistant/providers/airplay/provider.py index 2b9214aa..cd6eeb28 100644 --- a/music_assistant/providers/airplay/provider.py +++ b/music_assistant/providers/airplay/provider.py @@ -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) -- 2.34.1