Shairport sync SEGV / AirPlay tvOS 17.1

Running Volumio 3.546 (and at least one previous version) with an Apple TV tvOS 17.1 results in broken AirPlay connection.

How to reproduce
Select Volumio as playback device from Apple TV. Directly after starting the playback, the connection will reset (i.e. Volumio is deselected as playback device).

Details
SSHing on volumio shows that the shairport-sync process was killed with 11/SEGV. Last lines in journalctl were

Nov 01 16:29:22 volumio shairport-sync[3735]: ALSA lib /home/pi/volumio-alsa-plugin/src/pcm_volumioswitch.c:143:(_snd_pcm_volumioswitch_open_target_pcm) PCM Volumio ALSA Switch Plugin failed to open the switcher target pcm volumioLocalPlayback
Nov 01 16:29:22 volumio systemd[1]: shairport-sync.service: Main process exited, code=killed, status=11/SEGV
Nov 01 16:29:22 volumio volumio[833]: info: Airplay started streaming, receiving metadatas
Nov 01 16:29:22 volumio volumio[833]: info: CorePlayQueue::getTrack 0
Nov 01 16:29:22 volumio volumio[833]: info: CoreCommandRouter::volumioStop
Nov 01 16:29:22 volumio volumio[833]: info: CoreStateMachine::stop
Nov 01 16:29:22 volumio volumio[833]: info: CoreStateMachine::setConsumeUpdateService undefined
Nov 01 16:29:22 volumio systemd[1]: shairport-sync.service: Failed with result ‘signal’.
Nov 01 16:29:22 volumio volumio[833]: info: sendMpdCommand stop took 47 milliseconds

Workaround
The SEGV error does not occur during all connection attempts. Once the connection is established successfully it will remain working for at least one hour. To simplify this retry procedure I have set the shairport-sync process to restart after failure.

  • Edit /lib/systemd/system/shairport-sync.service
  • Add restart directive (see below)
[Service]
ExecStart=/usr/bin/shairport-sync --configfile=/tmp/shairport-sync.conf
User=shairport-sync
Group=shairport-sync
 
Restart=on-failure
RestartSec=2s

This is likely related to an old version of shairport-sync, version >4.3 seem to have a fix for that (see [Problem]: Sometimes getting a Segmentation Fault when trying to connect · Issue #1723 · mikebrady/shairport-sync · GitHub). As volumio is based on Debian 10, I was unable to compile shairport-sync 4.3 for it. So for now I switched to another RPi3 with Debian 12 and a freshly compiled shairport-sync 4.3.2-1. This has solved the problem but it would be great if Volumio can updated its shairport-sync (and likely its whole Debian base) in the near future.