/
/
/
1# Discovery Controller Architecture
2
3This core controller owns network discovery in Music Assistant:
4
5- the shared `AsyncZeroconf` instance and interface selection used by discovery consumers
6- mDNS/Zeroconf browsing for provider-declared `mdns_discovery` subscriptions
7- SSDP/UPnP search cycles for provider-declared `upnp_discovery` subscriptions
8- Music Assistant server advertisement on `_mass._tcp.local.`
9
10## Responsibilities
11
12- Build a single shared Zeroconf browser from all provider manifests.
13- Periodically run SSDP discovery for active providers and fan out results through provider callbacks.
14- Replay cached mDNS results when a provider loads so providers do not need to wait for the next announcement.
15- Register and unregister the Music Assistant server's own Zeroconf service.
16
17## Provider Integration
18
19Providers opt into discovery in `manifest.json`:
20
21- `mdns_discovery`: list of Zeroconf service types
22- `upnp_discovery`: list of SSDP search targets
23
24Providers then implement the matching callbacks in their provider class:
25
26- `on_mdns_service_state_change(...)`
27- `on_upnp_service_discovered(...)`
28
29Player providers can still keep `discover_players()` for provider-specific discovery paths that are not covered by shared network discovery, such as manual IP configuration or controller-side refresh logic.
30