Bugzilla – Bug 18162
UPnP/DLNA Plugin does not resend alive packets for server - client lose connection after 30 min
Last modified: 2018-04-02 09:13:11 UTC
There appears to be a bug in Plugin/UPnP/Discovery.pm that causes it to (re)send the periodic notify/alive packets only for one UUID (server or renderer) instead of all of them. The bug exists both in version 7.7.x and in 7.9.0 (build 1488878280). Symptom/Impact: A DNLA media player (in my case a Onkyo TX-NR676 receiver) sees the Squeezebox server only for the first 30 minutes (advertized TTL) after the server is started and then loses the connection and cannot play any more music from the server. Likely Cause: Plugin/UPnP/Discovery.pm only sends periodic notify/alive UPnP/SSDP packets for one UUID, typically the last renderer (e.g., squeezebox client) that registered. This seems to be caused by the call to Slim::Utils::Timers::killTimers() (on line before scheduling a new timer for resending the notify packet for one of the UUID. I don't really know Perl but I suspect that the killTimers() call kills the notify resend timer for _all_ UUID, and not just the one for the UUID being registered. Thus the server only resend notify/alive packets for the last UUID that gets registered. To verify this hypothesis a commented out the Slim::Utils::Timers::killTimers() calls in Plugin/UPnP/Discovery.pm (attached) and sure enough all notify/alive are getting properly periodically resend and my Onkyo receiver no longer loses connection to the Squeezebox server. The calls to Slim::Utils::Timers::killTimers() appear to be somewhat unnecessary defensive code but there is probably a better fix than just commenting them out that somewhat familiar Perl and with the code can figure out.
Created attachment 7764 [details] "Fix" made to validate root cause hypothesis
Could you please send a patch against 7.9.1?