shairport-sync icon indicating copy to clipboard operation
shairport-sync copied to clipboard

[Problem]: Airplay 2 - Loss of audio after a while

Open nicosea opened this issue 7 months ago • 16 comments

What happened?

Audio goes off after some minutes. If I stop the music or the video (or go backwards or forwards) audio is on again but for few seconds. Issue with Airplay 2. If I install version with Airplay 1, no issues.

Relevant log output


System Information.

System: Raspberry Pi4 with DietPi Output USB DAC (different models same results) Streamers: iPhone, iPad or Apple TV, same results, all upgraded to latest IOS (iOS26, iPadOS26 and tvOS26).

Configuration Information.

>> Display Config Start.

From "uname -a":
 Linux Studio 6.12.47+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.12.47-1+rpt1~bookworm (2025-09-16) aarch64 GNU/Linux

From /etc/os-release:
 Debian GNU/Linux 12 (bookworm)

From /sys/firmware/devicetree/base/model:
 Raspberry Pi 4 Model B Rev 1.5

Shairport Sync Version String:
 4.3.7-AirPlay2-smi10-OpenSSL-Avahi-ALSA-stdout-pipe-soxr-metadata-mqtt-dbus-mpris-sysconfdir:/usr/local/etc

Command Line:
 shairport-sync --displayConfig

Configuration File:
 /usr/local/etc/shairport-sync.conf

Configuration File Settings:
 general : 
 {
   interpolation = "soxr";
 };
 alsa : 
 {
   output_device = "hw:Loopback,1";
 };

>> Display Config End.
>> Goodbye!
root@Studio:~#

PulseAudio or PipeWire installed?

  • [ ] Check if your system uses a Sound Server.

How did you install Shairport Sync?

A package manager (apt, apt install, yum, pkg, etc.)

Check previous issues

  • [x] Confirm

nicosea avatar Sep 26 '25 15:09 nicosea

Thanks for the post. Could you give us a scenario that would reliably cause the fault?

Also, a couple of questions, please:

  1. Is this a Docker image you're running?
  2. Is your system on WiFi, and if so, is WiFi Power Management off?

Thanks.

mikebrady avatar Sep 26 '25 15:09 mikebrady

Thanks for the post. Could you give us a scenario that would reliably cause the fault?

Also, a couple of questions, please:

  1. Is this a Docker image you're running?
  2. Is your system on WiFi, and if so, is WiFi Power Management off?

Thanks.

I am not running a docker image, I installed the package by DietPi on raspberry Pi4.

Both streamer and receiver are on the same WiFi and WiFi Power Management is off.

If I use Airplay 1 no issues. If I use Airplay 2, afer a while no sound anymore.

It usually happens when I'm watching a video.

nicosea avatar Sep 26 '25 17:09 nicosea

Thanks. I'm just trying this on my own system -- A fully-up-to-date MacBook Pro M1 on WiFi playing an Apple TV movie to three Shairport Sync devices set for AirPlay 2: a RaspberryPiB, a 2B and a 3B, all on WiFi and running Raspberry Pi OS (not DietPi) with the development version of Shairport Sync on the PiB. All going well so far from the TV app on the Mac.

Also, separately, played a one-hour YouTube movie using the PiB as the Mac's System Sound Output and no problems.

Perhaps you could try running on Raspberry Pi OS, at least temporarily, to see if the problem goes away?

mikebrady avatar Sep 26 '25 18:09 mikebrady

OK, tested on two different raspberries, both on Dietpi and I think I found a possible root cause.

On raspberry with CamillaDSP (a package to have PEQ equalizer) I still have issues. On the other raspberry with a clean installation of shairport, no issues at all.

nicosea avatar Sep 27 '25 06:09 nicosea

Thanks. It does seem as if CamillaDSP might be the culprit alright. I can’t explain the difference between AirPlay 2 and Classic AirPlay though…

mikebrady avatar Sep 27 '25 07:09 mikebrady

Tested and retested, Dietpi with a clean installation and no CamillaDSP works perfectly.

I have just discovered that I can also use DSP with Shairport! I am using a FIR filter (.wav) downloaded from AutoEQ, for my HD660S. This way I do not need PEQ.

Please note that in the DSP guide there is a small mistake: Edit your /etc/shairpoint-sync.conf file and at the following section:

dsp
{
    convolution = "yes";
    convolution_ir_file = "/path/to/impulse.wav";
};

= is missing after dsp

nicosea avatar Sep 29 '25 21:09 nicosea

That’s great, and many thanks for the correction. Also for the great-looking source for FIR filters!

BTW, the advantage of Shairport Sync's built-in DSP is that it maintains synchronisation.

mikebrady avatar Sep 29 '25 21:09 mikebrady

I could not get FIR filters to work, but PEQ filters worked for me with shairport sync. Something could be wrong with the way I'm generating FIR filters.

24fpsDaVinci avatar Sep 30 '25 06:09 24fpsDaVinci

Hi there. Just FYI, the convolution and loudness facilities have been updated on the development branch . The 44.1k and stereo-only restrictions are gone. Some of the settings in the configuration file and some the properties and methods in the D-Bus interface have changed.

mikebrady avatar Oct 13 '25 16:10 mikebrady

I experience this issue occasionally, too, but without camillaDSP. I'm using the 5.0-dev docker image. Just now audio output stopped even though my iPhone continued to play the stream. Audio resumed when i forwarded a couple of seconds in the music app. Here's my log:

2025-10-16T10:06:36.105119909Z          7.965320588 "player.c:3988"               1.94          -51.9           51.9                  0.16            5588            15              831k         47997.37         47997.14
2025-10-16T10:06:44.150860732Z          8.045639421 "player.c:3988"               1.94          -62.3           62.3                  0.16            5618            14              568k         47997.37         47997.14
2025-10-16T10:06:52.196880805Z          8.045801439 "player.c:3988"               1.96          -51.9           51.9                  0.15            5608            15              306k         47997.37         47997.14
2025-10-16T10:07:00.157034896Z          7.960351903 "player.c:3988"               1.93          -62.3           62.3                  0.16            5600            15               43k         47997.37         47997.14
2025-10-16T10:20:52.705179537Z        832.544504374 "player.c:3988"               0.52          -15.6           15.6                  0.34            5520             0                 0              N/A              N/A
2025-10-16T10:21:00.671731311Z          7.966749847 "player.c:3988"               0.72            0.0            0.0                  0.14            5508            14             2468k         47996.94         47996.69
2025-10-16T10:21:08.714237384Z          8.042395718 "player.c:3988"               1.20            0.0            0.0                  0.13            5514            15             3056k         47997.19         47996.93
2025-10-16T10:21:16.743015016Z          8.028628014 "player.c:3988"               1.65            0.0            0.0                  0.13            5514            14             3021k         47997.37         47997.11
2025-10-16T10:21:24.734145488Z          7.991274050 "player.c:3988"               1.94          -62.3           62.3                  0.15            5512            14             2984k         47997.37         47997.11
2025-10-16T10:21:32.759114032Z          8.024892162 "player.c:3988"               1.92          -41.6           41.6                  0.17            5500            14             2969k         47997.33         47997.08

keefar avatar Oct 16 '25 10:10 keefar

Thanks. If we could get this to happen in a way that was easy to repeat, it would be verrry useful!

mikebrady avatar Oct 16 '25 10:10 mikebrady

Unfortunately, I don't have any clue how. I usually start a station in apple music and at some seemingly random point, audio stops. I can't see any related events or circumstances. It doesn't happen that often at the moment. This morning, I had one hour of listening without any problems.

keefar avatar Oct 17 '25 15:10 keefar

Thanks. No worries.

mikebrady avatar Oct 17 '25 16:10 mikebrady

This issue has been inactive for 28 days so will be closed 7 days from now. To prevent this, please remove the "stale" label or post a comment.

github-actions[bot] avatar Dec 17 '25 01:12 github-actions[bot]

Just an update on this issue as it still occurs, all though not as frequently as it used to back in October. It happens from 1 - 3 times per week up to (seldomly) several times per day. I'm usually using shairport-sync several hours per day. The issue persisted through all recent iOS betas, currently I'm using 26.3 beta 1. I'm using the newest docker development image.

Audio just stops, all though shairport seems to remain in the playing state according to the mqtt service. The device also keeps on playing. I often get the impression that audio stops upon the beginning or end of an automix transition. I can resume audio by skipping a couple of seconds or pressing pause/play.

The logs just show a gap in the statistics:

2025-12-20T09:37:54.803252061Z          7.987959384 "player.c:4026"               1.94          -51.9           51.9                  0.15            5499            14              298k         47997.40         47997.06
2025-12-20T09:38:02.781358323Z          7.978006680 "player.c:4026"               1.94          -72.7           72.7                  0.17            5517            15               34k         47997.40         47997.06
2025-12-20T09:55:53.954520449Z       1071.167388399 "player.c:4026"               0.49            0.0            0.0                  0.32            5508             0                 0              N/A              N/A
2025-12-20T09:56:01.989735176Z          8.035114995 "player.c:4026"               0.68            0.0            0.0                  0.14            5502            14             2486k         47997.55         47997.27

keefar avatar Dec 20 '25 10:12 keefar

Thanks for the update.

mikebrady avatar Dec 20 '25 10:12 mikebrady