Bug 18162 - UPnP/DLNA Plugin does not resend alive packets for server - client lose connection after 30 min
: UPnP/DLNA Plugin does not resend alive packets for server - client lose conne...
Status: UNCONFIRMED
Product: Logitech Media Server
Classification: Unclassified
Component: UPnP
: 7.9.x
: PC RedHat Linux
: -- major (vote)
: ---
Assigned To: Unassigned bug - please assign me!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2018-03-18 21:48 UTC by Claude-Nicolas Fiechter
Modified: 2018-04-02 09:13 UTC (History)
3 users (show)

See Also:
Category: ---


Attachments
"Fix" made to validate root cause hypothesis (14.37 KB, text/x-perl-script)
2018-03-18 21:50 UTC, Claude-Nicolas Fiechter
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Claude-Nicolas Fiechter 2018-03-18 21:48:03 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.
Comment 1 Claude-Nicolas Fiechter 2018-03-18 21:50:36 UTC
Created attachment 7764 [details]
"Fix" made to validate root cause hypothesis
Comment 2 Michael Herger 2018-04-02 09:13:02 UTC
Could you please send a patch against 7.9.1?