[mythtv] UPnP AutoDiscovery changes

Nigel Pearson nigel at ind.tansu.com.au
Tue Nov 27 02:09:18 UTC 2007


Changeset 14964 fixes some minor problems
with David's UPnP backend autodiscovery.
I forgot to say in the commit message that this
will cause a large recompile. Sorry about that.

Outstanding problems:

1) PIN entry on a remote without number buttons
(e.g. Apple Remote users) isn't currently possible

2) On slow machines/networks, there are annoying pauses
with no user feedback. I tried adding MythBusyDialogs,
but they tended to not update (animate) very well

3) Those with sleeping backends will probably be stuck.
If there are people in that situation, try this patch:

Index: libs/libmyth/mythcontext.cpp
===================================================================
--- libs/libmyth/mythcontext.cpp        (revision 14966)
+++ libs/libmyth/mythcontext.cpp        (working copy)
@@ -1089,6 +1089,28 @@
      if (host == "localhost" || host == "127.0.0.1" || host ==  
m_localhostname)
          doPing = false;

+
+    // If WOL is setup, the backend might be sleeping:
+    if (doPing && m_DBparams.wolEnabled)
+        for (int attempt = 0; attempt < m_DBparams.wolRetry; ++attempt)
+        {
+            int wakeupTime = m_DBparams.wolReconnect;
+
+            if (ping(host, wakeupTime))
+            {
+                doPing = false;
+                break;
+            }
+
+            VERBOSE(VB_GENERAL, "Trying to wake up host "
+                                + host + ", attempt " + attempt);
+            system(m_DBparams.wolCommand);
+
+            VERBOSE(VB_GENERAL, "Waiting for " + wakeupTime + "  
seconds");
+            sleep(m_DBparams.wolReconnect);
+        }
+
+
      if (doPing)
          VERBOSE(VB_GENERAL, "Testing network connectivity to " +  
host);
      if (doPing && !ping(host, 3))  // Fail after trying for 3 seconds

--
Nigel Pearson, nigel at ind.tansu.com.au|"Things you own-
Telstra Net. Eng., Sydney, Australia | end up owning you"
Office: 9202 3900    Fax:  9261 3912 |      Tyler,
Mobile: 0408 664435  Home: 9792 6998 |    Fight Club


More information about the mythtv-dev mailing list