uPnP Announcement Frequency
#1
Hello, I'm a new XBMC user and it's worked beautifully for everything I've tried with it until now. I just bought a tablet to stream music over uPnP, and I'm trying to get that working. The problem I have is that the XBMC uPnP server is only occasionally detected by the uPnP client running on my tablet.

I've done some simple testing and I think I've narrowed the problem down to the fact that XBMC doesn't seem to put out "uPnP Announcements" often enough. If I start my uPnP client, it won't detect the XBMC server for a long time (5-15 minutes?). If I then toggle the "Share video and music libraries through uPnP" option in XBMC off and on again, it immediately shows up in my client.

Is there some advanced configuration item that will allow me to increase how often XBMC announces itself to the network?

I am running XBMC 10.1 (08 Mar 2011) for Windows 7 64-bit.

Thanks!
Reply
#2
I know this is an old thread, but for anyone searching, there isn't a config option as of 12.0. It's hardcoded in ./lib/libUPnP/Platinum/Source/Core/PltDeviceHost.cpp and derives either the cache-control setting or uses a default of 30 seconds.

Here's a little patch that will set it to 15 seconds. You can, of course, move around that value. I did a bit of work on adding it to the GUISettings / UPnP but it took more than 20 mins to figure out how I'd pass that information into this file way down deep, so I gave up for the time being. I'm sure someone with more familiarity with the XBMC code can hack it out pretty quickly.

Code:
diff --git a/lib/libUPnP/Platinum/Source/Core/PltDeviceHost.cpp b/lib/libUPnP/Platinum/Source/Core/PltDeviceHost.cpp
index cecfc27..ad55753 100644
--- a/lib/libUPnP/Platinum/Source/Core/PltDeviceHost.cpp
+++ b/lib/libUPnP/Platinum/Source/Core/PltDeviceHost.cpp
@@ -188,7 +188,7 @@ PLT_DeviceHost::Start(PLT_SsdpListenTask* task)
     // calculate when we should send another announcement
     NPT_Size leaseTime = (NPT_Size)GetLeaseTime().ToSeconds();
     NPT_TimeInterval repeat;
-    repeat.SetSeconds(leaseTime?(int)((leaseTime >> 1) - 10):30);
+    repeat.SetSeconds(15);

     PLT_ThreadTask* announce_task = new PLT_SsdpDeviceAnnounceTask(
         this,
Reply

Logout Mark Read Team Forum Stats Members Help
uPnP Announcement Frequency0