Mike Brady [Mon, 1 Apr 2024 12:02:20 +0000 (13:02 +0100)]
Merge pull request #1831 from kuzhylol/master
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.
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.
porg [Thu, 7 Mar 2024 09:31:27 +0000 (10:31 +0100)]
Update AIRPLAY2.md - Version introduced + Supported devices
The introduction paragraph now more clearly mentions the hard facts/requirements with "as of v4.1 and newer" and the supported devices are displayed in bullet list format for better readabilty.
Mike Brady [Mon, 4 Mar 2024 11:13:56 +0000 (11:13 +0000)]
Build scripts/shairport-sync.service, scripts/shairport-sync.service-avahi and scripts/shairport-sync unconditionally for Linux to facilitate different installation methods.
Klemens Nanni [Wed, 31 Jan 2024 04:01:55 +0000 (05:01 +0100)]
Fix crash on double pthread_cancel(3) on exit
On OpenBSD 7.4-current, failure to listen on the RTSP socket(s) results
the `rtsp_listener_thread` being pthread_cancel(3)'ed twice, once through
`rtsp_listen_loop()` and again via atexit(3) handler `exit_rtsp_listener()`:
```
$ nc -4l 5000 &
$ nc -6l 5000 &
$ shairport-sync -c/dev/null
warning: could not establish a service on port 5000 -- program terminating. Is another instance of Shairport Sync running on this device?
Segmentation fault (core dumped)
```
```
Program terminated with signal SIGSEGV, Segmentation fault.
433 if (tib->tib_canceled == 0 && tid != 0 &&
[Current thread is 1 (process 290061)]
```
`die()` -> `exit(EXIT_FAILURE)` normally in this case, thus forgoing the
first cancel and relying on the atexit handler alone.
Klemens Nanni [Tue, 30 Jan 2024 02:43:44 +0000 (03:43 +0100)]
Exit on config read error to avoid crash on EACCES
Failure to read does not exit despite
` /* Read the file. If there is an error, report it and exit. */`
EACCES (e.g. insufficient filesystem permissions) is enough to crash
on access through later `config_*()` such as those when either of
either of D-Bus, MPRIS or MQTT is used.
Seen `--with-mpris-interface` and
```
$ ls -l /etc/shairport-sync.conf
-rw-r----- 1 root _shairport 28114 Jan 25 01:53 /etc/shairport-sync.conf
$ shairport-sync
Segmentation fault (core dumped)
```
Klemens Nanni [Tue, 30 Jan 2024 02:14:52 +0000 (03:14 +0100)]
clarify root privilege requirements
NQPTP works and runs as _shairport user on OpenBSD.
Linux capabilities(7) allow starting as unprivileged user in the first
place, otherwise programs only need to start and perform privileged
actions such as bind(2)ing sockets as root, after that they can and
should! drop privileges.
Instead of updating/repeating supported systems, drop listings.
Adds a "install-config-files" Makefile target that installs the config
files and dbus policies to DESTDIR=, regardless of whether
--with{,out}-configfiles is specified.
Klemens Nanni [Sat, 27 Jan 2024 18:40:04 +0000 (19:40 +0100)]
Move shairport-sync manual from section 7 to 1
From mandoc man(1) [-s] section:
1 General commands (tools and utilities).
[...]
7 Miscellaneous information.
From GNU man(1) DESCRIPTION:
1 Executable programs or shell commands
[...]
7 Miscellaneous (including macro packages and conventions), e.g.
man(7), groff(7)
shairport-sync is an executable, shairport-sync(1) ought to be its
documentation, not merely miscellaneous information.
OpenBSD adjusts this in its audio/shairport-sync port/package ever since.
Klemens Nanni [Sat, 27 Jan 2024 07:27:46 +0000 (08:27 +0100)]
Connect to NQPTP control socket on localhost
nqptp.c listens on "localhost", but shairport-sync connectes to the wildcard
address 0/0. This apparently works on Linux and FreeBSD, but OpenBSD fails:
Resolve and connect to "localhost" just like NQPTP does, resulting in
127.0.0.1 or ::1 as socket addresses.
This is required to run when configured `--with-airplay-2`.
Tested on OpenBSD/amd64 7.4-current with shairport-sync 2.4.3 and nqptp
1.2.5-dev cfa8315 (plus OpenBSD fixes).
I expect Linux and FreeBSD to work as before, but have not tested it.
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).