mikebrady / shairport-sync

AirPlay and AirPlay 2 audio player
Other
7.2k stars 571 forks source link

Pausing for a while causes stop of airplay service broadcasting in lan, not the shairport-sync daemon itself. #995

Closed tanovich closed 3 years ago

tanovich commented 4 years ago

Problem occurs while using forked-daap and audio streaming from ios device (such as spotify or youtube app), when playback is paused for a while (apr. 1 minute). I've tried shairport-sync from raspbian repository and self-compiled git version, with no luck. Playing itself works flawless. After that 'crash' shairport-sync device is no longer visible in iOS or forked-daapd.

my setup is: raspberry pi zero with USB soundcard and USB ethernet card.

I'm using shairport-sync in other projects, and it's great piece of software. Thank you for your work. log.txt

mikebrady commented 4 years ago

Thanks for the post. By coincidence, another user with a Pi Zero and an Ethernet adapter has just posted issue #994. Please refer to it for some hints. After the 'crash' you report, it would be interesting to see if the service had disappeared at the iOS end (checking with TildeSoft's Discovery) and yet was still being advertised at the Pi end (checking with avahi-browse).

BTW, the latest version, 3.3.6, is considerably more robust than 3.3.2, but the log doesn't really show anything unusual.

tanovich commented 4 years ago

Somehow Ethernet adapter making the problem. I did several tests, on different router without internet connection. Two tested devices i have, looks pretty different but they run same chip: 'ICS Advent DM9601'. Connecting Raspberry Pi to network by wifi adapter solving the problem. I also found third ethernet adapter with 'Realtek Semiconductor Corp. RTL8152' wich works well and seem not to affect shairport.

Weird thing about DM9601 is that it keeps ssh conection, and when i manualy restart shairport-sync everything works again for a while. After Airplay stops responding, Shairport is stiil visible localy, but no at network (Discovery screenshot attached).

pi@raspberrypi:~ $ avahi-browse -a
+   eth0 IPv6 AF31192A3A11@Raspberrypi                      AirTunes Remote Audio local
+   eth0 IPv4 AF31192A3A11@Raspberrypi                      AirTunes Remote Audio local

Will it be a kernel-related issue? Maybe Avahi? Any idea where i should report it?

IMG_0914

thetyrantcbass commented 4 years ago

I’m experiencing pretty much this same behavior with shairport-sync on a Pi 3A+ with piCorePlayer 6.0.0; the distro maintainer upgraded the package to 3.3.6 around the end of March. pCP doesn’t have avahi (and trying to install it just threw me into dependency hell) so I can’t see if the broadcast is still going on the Pi’s side of things.

Network-wise I’m using openwrt stable 19.07. The Pi receives a static DHCP lease from the router. The Pi and my iDevices are on wifi. I’ve tried disabling and re-enabling IGMP snooping as it’s reputed to affect multicast, no change either way. I’ve even tried hardcoding an avahi.hosts file entry pointing at the Pi. The only thing that really seems to work is rebooting the Pi and connecting to Shairport as soon as it appears. If the process is left idle after starting or if playback stops for more than a few minutes or the connection is otherwise interrupted it’ll disappear from the local domain and doesn’t rebroadcast. The port does appear to still be claimed; if I SSH in and run shairport-sync -v it’ll complain that there’s already something listening on the port and exit.

I’m going to cross post this to the pCP discussion thread and see if anyone there has any ideas.

mikebrady commented 4 years ago

Thanks for this. I wonder if it’s a power management issue on the Pi. Worth checking in the TROUBLESHOOTING guide.

thetyrantcbass commented 4 years ago

I added the command to disable the wifi power management to the startup commands, but it didn't appear to have any effect. When I do have a connection it's very stable with no skips or hiccups. pCP's Squeezelite client also has a steady connection for streaming audio.

I also have an AirServer install on my Mac and that's always visible even when the Shairport instance isn't.

Since pCP doesn't log Shairport-sync's output, I'm going to try flashing a more full-featured distro (moode) instead and see if I have any better results.

mikebrady commented 4 years ago

Moode is very stable, in my experience.

mikebrady commented 4 years ago

Will it be a kernel-related issue? Maybe Avahi? Any idea where i should report it?

IMG_0914

Not too sure about this. I guess it might be worth seeing if that DM9601 is showing as a problem elsewhere and seeing if it might make sense to contribute there. Doing a quick search for "DM9601 linux problems" reveals quite a few...

thetyrantcbass commented 4 years ago

Moode is very stable, in my experience.

Zero problems or dropouts since switching to Moode. I guess something's strange with the way the package was built for pCP, or having a full Avahi stack is better than tinysvcmdns, or both.

mikebrady commented 4 years ago

Thanks. That is interesting alright.

I wonder whether pCP is built with a different set of ethernet drivers – I guess that might be another possible explanation.

varon commented 4 years ago

I'm seeing the same issue with this running on Cygwin over ethernet.

Restarting the CYGWIN Shairport Sync service restores connectivity again.

github-actions[bot] commented 3 years ago

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