Another source - stop playing zone
Hi,
It would be possible to add the following feature.
I’m streaming from Loxone via AirPlay. I play music from my phone on the same output device. Playback on the Audio Server zone continues. It would be good if playback on the Loxone audio zone stopped when another source is used.
Tnx
Did I understood this correctly?
- Lox AudioServer plays song on AirPlay client
- Phone takes over the AirPlay client
- Lox AudioServer should stop
Yes, correct.
I added support for this indirectly through @lox-audioserver/[email protected]. The sender now exposes a session-ended event with the RTSP/session end reason, such as busy, disconnected, timeout, etc. Lox AudioServer consumes that event and stops the zone when the AirPlay output session ends unexpectedly.
There is a small guard so our own local actions, like stop, pause, or track restart, are not treated as an external takeover.
One limitation remains: AirPlay does not necessarily provide a clean "taken over by another sender" event. So this works when the target closes/invalidates our session or reports an error. If a device silently ignores our UDP audio without closing the RTSP session, that may not be detectable reliably.
I did not test it myself, but if you want to try it you can use the dev branch. It will also be part of the next beta.
Validated using latest dev container