mikebrady / shairport-sync

AirPlay and AirPlay 2 audio player
Other
7.27k stars 573 forks source link

[Problem]: recurring error message: "failed to accept connection: Too many open files" #1830

Closed LukeWinikates closed 7 months ago

LukeWinikates commented 7 months ago

What happened?

I am running two Raspberry Pi devices using Hifiberry OS, which bundles shairport-sync.

Both devices eventually stop accepting new Airplay connections after running for some amount of time. On my iOS device, I can see the Hifiberry device in the Airplay menu, but if I tap that speaker option, I will eventually get an error modal and the music will fail to play. If I reboot the device and start playing music right away, it will play.

I notice that HifiberryOS hasn't been updated in a while, and the bundled shairport-sync version is also behind.

Relevant log output

Here's an example of the `journalctl` output from a few days ago.

Mar 10 00:19:07 hifi-master-bedroom shairport-sync[814]: failed to accept connection: Too many open files
Mar 10 00:19:07 hifi-master-bedroom shairport-sync[814]: failed to accept connection: Too many open files
Mar 10 00:19:20 hifi-master-bedroom node[744]: Loading user interface for default appearance...
Mar 10 00:19:36 hifi-master-bedroom node[744]: Loading user interface for default appearance...
Mar 10 00:19:37 hifi-master-bedroom systemd-journald[264]: Suppressed 513583 messages from shairport-sync.service
Mar 10 00:19:37 hifi-master-bedroom shairport-sync[814]: failed to accept connection: Too many open files
Mar 10 00:19:37 hifi-master-bedroom shairport-sync[814]: failed to accept connection: Too many open files
Mar 10 00:19:37 hifi-master-bedroom shairport-sync[814]: failed to accept connection: Too many open files
Mar 10 00:19:37 hifi-master-bedroom shairport-sync[814]: failed to accept connection: Too many open files
Mar 10 00:19:37 hifi-master-bedroom shairport-sync[814]: failed to accept connection: Too many open files
Mar 10 00:19:37 hifi-master-bedroom shairport-sync[814]: failed to accept connection: Too many open files
Mar 10 00:19:37 hifi-master-bedroom shairport-sync[814]: failed to accept connection: Too many open files
Mar 10 00:19:37 hifi-master-bedroom shairport-sync[814]: failed to accept connection: Too many open files
Mar 10 00:19:37 hifi-master-bedroom shairport-sync[814]: failed to accept connection: Too many open files
Mar 10 00:19:37 hifi-master-bedroom shairport-sync[814]: failed to accept connection: Too many open files
Mar 10 00:19:37 hifi-master-bedroom shairport-sync[814]: failed to accept connection: Too many open files
Mar 10 00:19:37 hifi-master-bedroom shairport-sync[814]: failed to accept connection: Too many open files
Mar 10 00:19:37 hifi-master-bedroom shairport-sync[814]: failed to accept connection: Too many open files
Mar 10 00:19:37 hifi-master-bedroom shairport-sync[814]: failed to accept connection: Too many open files

System Information.

HifiberryOS 20230404 Raspberry Pi 3 Model B Rev 1.2 Hifiberry DAC+/Amp2

Configuration Information.

shairport-sync --displayConfig
         0.002853177 "shairport.c:1420" default metadata_pipename is "/tmp/shairport-sync-metadata".
         0.000805625 "shairport.c:1991" >> Display Config Start.
         0.028923125 "shairport.c:1991"
         0.000128073 "shairport.c:1991" From "uname -a":
         0.000615573 "shairport.c:1991"  Linux hifi-office 5.15.78-v7 #1 SMP Mon Apr 3 17:34:29 UTC 2023 armv7l GNU/Linux
         0.051662135 "shairport.c:1991"
         0.000126719 "shairport.c:1991" From /etc/os-release:
         0.000978438 "shairport.c:1991"  Buildroot 2021.11
         0.037733750 "shairport.c:1991"
         0.000159010 "shairport.c:1991" From /sys/firmware/devicetree/base/model:
         0.000120625 "shairport.c:1991"  Raspberry Pi 3 Model B Rev 1.2
         0.000278750 "shairport.c:1991"
         0.000119687 "shairport.c:1991" Shairport Sync Version String:
         0.000226042 "shairport.c:1991"  4.1-rc4-AirPlay2-OpenSSL-Avahi-ALSA-stdout-pipe-soxr-metadata-mpris-sysconfdir:/etc
         0.000220833 "shairport.c:1991"
         0.000158073 "shairport.c:1991" Command Line:
         0.000159115 "shairport.c:1991"  shairport-sync --displayConfig
         0.000444687 "shairport.c:1991"
         0.000632344 "shairport.c:1991" Configuration File:
         0.000078281 "shairport.c:1991"  /etc/shairport-sync.conf
         0.000049323 "shairport.c:1991"
         0.000043594 "shairport.c:1991" Configuration File Settings:
         0.000586198 "shairport.c:1991"  general :
         0.000122135 "shairport.c:1991"  {
         0.000044584 "shairport.c:1991"    name = "hifi-office";
         0.000044635 "shairport.c:1991"  };
         0.000231354 "shairport.c:1991"  alsa :
         0.000120052 "shairport.c:1991"  {
         0.000113959 "shairport.c:1991"    mixer_control_name = "Digital";
         0.000705208 "shairport.c:1991"  };
         0.000177865 "shairport.c:1991"  sessioncontrol :
         0.000116198 "shairport.c:1991"  {
         0.000119791 "shairport.c:1991"    run_this_before_play_begins = "/opt/hifiberry/bin/pause-all shairport";
         0.000119375 "shairport.c:1991"    wait_for_completion = "yes";
         0.000113177 "shairport.c:1991"    allow_session_interruption = "yes";
         0.000777709 "shairport.c:1991"    session_timeout = 20;
         0.000143646 "shairport.c:1991"  };
         0.000113958 "shairport.c:1991"  diagnostics :
         0.000150989 "shairport.c:1991"  {
         0.000735365 "shairport.c:1991"    log_verbosity = 2;
         0.000144583 "shairport.c:1991"  };
         0.000240730 "shairport.c:1991"
         0.000876093 "shairport.c:1991" >> Display Config End.
         0.000150782 "shairport.c:1993" >> Goodbye!
         0.000594166 "shairport.c:1534" exit function called...
         0.000329688 "shairport.c:1570" Stopping DACP Monitor
         0.000213021 "shairport.c:1572" Stopping DACP Monitor Done
         0.000118802 "shairport.c:1576" Stopping metadata hub
         0.000116562 "shairport.c:1578" Stopping metadata done
         0.000111511 "shairport.c:1582" Stopping metadata
         0.000109843 "shairport.c:1584" Stopping metadata done
         0.000116563 "shairport.c:1586" Stopping the activity monitor.
         0.000110521 "shairport.c:1588" Stopping the activity monitor done.
         0.000299323 "shairport.c:1670" normal exit

PulseAudio or PipeWire installed?

How did you install Shairport Sync?

Built from source

Check previous issues

mikebrady commented 7 months ago

Thanks for the post. I note that the version of Shairport Sync is a little out of date, and this bug may (?) have been fixed in 4.1.1. So, let me suggest that you update to the latest version and see if the problem goes away.

LukeWinikates commented 7 months ago

@mikebrady thanks for your response - I updated my devices to a prerelease version of HiFiBerryOS, running v4.3.2 of shairport-sync. I haven't seen the issue for the last few days, and by now I'm pretty sure that I would have.

In case anybody finds this from a search result in the future - here's the HiFiBerryOS forum thread where I got the advice to just jump to the latest prerelease version of HiFiBerryOS vNext: https://support.hifiberry.com/hc/en-us/community/posts/17703614535837