Oleh Kuzhylnyi [Sun, 24 Mar 2024 16:05:40 +0000 (13:05 -0300)]
Add version-based visibility of shairport-sync endpoints
This patch introduces modification to AirPlay attributes allowing AirPlay clients
seeing only appropriate Endpoints of specific version of AirPlay protocol.
[Test]
Run two instances of shairport-sync - built for version 1 and for version 2.
TuneBlade recognizes only AirPlay version 1 instance running.
MacOS/iOS recognizes only AirPlay version 2 instance running.
Without that patch, both MacOS/iOS detect two endpoints at the same time.
The TuneBlade detects only AirPlay version 1 since it doesn't support AirPlay version 2.
Mike Brady [Sun, 15 Oct 2023 17:20:18 +0000 (18:20 +0100)]
Merge branch 'development'
Update to 4.3.2
**Enhancements**
* A totally new PipeWire backend featuring full synchronisation.
**Bug Fixes**
* Stability improvements for the PulseAudio backend.
* Fix a crash when the Avahi subsystem became disconnected. This is normally a rare occurrence, but Shairport Sync was not dereferencing obsolete data correctly when it happened.
* Set and reset Bonjour flags correctly when it's a Classic Airplay session in AirPlay 2 operation.
* Fix a number of FreeBSD compilation errors and warnings.
* Fix various errors when breaking into an existing session to terminate it. Thanks again to [aaronk6](https://github.com/aaronk6).
* Fix some debug message errors, sigh. Thanks to [Nathan Gray](https://github.com/n8gray).
Mike Brady [Sat, 30 Sep 2023 14:45:41 +0000 (15:45 +0100)]
Replace the pipewire backend completely. Play writes to a buffer. The on_process() function reads from the buffer and updates timing information for the delay() function. Barebones -- can't set the app name or the volume. Assumes no further delays and no buffers when on_process is called. But it works!
Mike Brady [Wed, 27 Sep 2023 09:36:28 +0000 (10:36 +0100)]
Very very rarely, the avahi client becomes disconnected.
This usually means there are problems in the system as a whole rahter than with Shairport Sync.
However, Shairport Sync was not cleaning up properly before deleting the now-disconnected avahi client and
creating a new one in an attempt to reconnect. That caused Shairport Sync to crash even if the new avahi client
was created successfully.
So this commit has code to delete the avahi group and broswer callback before deleting the disconnected avahi client.
Mike Brady [Sun, 24 Sep 2023 16:22:22 +0000 (17:22 +0100)]
When a connection termiates abruptly while is it the principal_conn, make sure it sets the principal_conn
to NULL and cleans up the bonjour flags, if appropriate.
Simplify the TEARDOWN handlers and the thress teardown functions by incporporating
the above code in the teardown_phase_two (for AP2) and teardown (fpr AP1) functions.
It means that closing a connection will block on the principal_conn_lock, so if
you have the principal_conn_lock, closing will not complete until you release it.
Maybe we need a principal_conn_acquisition_lock for that...
Mike Brady [Thu, 21 Sep 2023 15:04:23 +0000 (16:04 +0100)]
Change principal_conn_lock from a regular mutex to a read-write mutex, so it can be used to check and hold the current principal_conn unless it's being altered in get_play_lock or a release_play_lock.
Only allow access to the config.airplay_statusflags, build_bonjour_strings(NULL), mdns_update(NULL, secondary_txt_records) when read_lock is acquired on the principal_conn_lock.
Only allow changes to config.airplay_statusflags and only allow access to mdns_update if you are the principal conn.
The bonjour status flags and the info response plist calculations are still a dirty rotten hack.