directory browsing hiccup using DLNA
#1
This may be a well known issue and discussed before.

Last weekend I tested xbmc for iPad after I tested a few other players. Yes it's all about DLNA. xbmc 11.0 eden for iPad works very well, more than my expectation. It can handle 1080p smoothly (with tuning to A/V sync setting).

But I did notice a hiccup when traversing into directories containing directories. The hiccup is just sensible for directory containing 4 directories, but painful long for directories containing much more directories. Actually, according to my mediaserver (minidlna running on debian), it reports errors below for 284 times in about 6 seconds. Yes, 6 SECONDS.

[2012/09/03 18:44:55] upnpsoap.c:1739: warn: Returning UPnPError 701: No such object error
[2012/09/03 18:44:55] upnpsoap.c:1739: warn: Returning UPnPError 701: No such object error
...
...
[2012/09/03 18:45:01] upnpsoap.c:1739: warn: Returning UPnPError 701: No such object error
[2012/09/03 18:45:01] upnpsoap.c:1739: warn: Returning UPnPError 701: No such object error

The offending code is in xbmc/FileItem.cpp, void CFileItemList::StackFolders()
Code:
void CFileItemList::StackFolders()
{
...
  // stack folders
  for (int i = 0; i < Size(); i++)
  {
    CFileItemPtr item = Get(i);
    // combined the folder checks
    if (item->m_bIsFolder)
    {
      // only check known fast sources?
      // NOTES:
      // 1. rars and zips may be on slow sources? is this supposed to be allowed?
      if( !item->IsRemote()
        || item->IsSmb()
        || item->IsNfs()
        || item->IsAfp()
        || URIUtils::IsInRAR(item->GetPath())
        || URIUtils::IsInZIP(item->GetPath())
        || URIUtils::IsOnLAN(item->GetPath())
        )
      {
...

Here, DLNA uses Upnp method to probe to see if the directories in question are DVD or BD. If we are using wireless link, the RTT is not ignorable, and it will take about 20ms for each probe. Four entries, VIDEO_TS.IFO, VIDEO_TS/VIDEO_TS.IFO, index.bdmv and BDMV/index.bdmv are probed for a single directory, that is about 80ms. That means, for every 12.5 directories, 1 second delay is added.

My suggestion is UPNP should be treated as slow sources for this operation. Here is patch agains HEAD


Code:
diff --git a/xbmc/utils/URIUtils.cpp b/xbmc/utils/URIUtils.cpp
index 376d2d7..6478f1f 100644
--- a/xbmc/utils/URIUtils.cpp
+++ b/xbmc/utils/URIUtils.cpp
@@ -456,7 +456,7 @@ bool URIUtils::IsOnLAN(const CStdString& strPath)
     return true;

   if(IsUPnP(strPath))
-    return true;
+    return false;

   CURL url(strPath);
   if (url.GetProtocol() == "rar" || url.GetProtocol() == "zip")

I can't test it now because I have no build environment for iOS.
Reply

Logout Mark Read Team Forum Stats Members Help
directory browsing hiccup using DLNA0