Kodi Community Forum

Full Version: [partially solved] upnp send "bads" files to client
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

Just bought a Denon Piccolo today because it has no CD player (who needs it in 2013 ??), and also because it's dlna (upnp) certified.
Music is playing great from Xbmc, sound is amasing, but, on some albums I've a nice error message on the Piccolo :
"File Format Error" (or something like that)

So, I checked into the Xbmc log, and saw what happens :
Code:
18:50:27 T:140259010414336   DEBUG: Preparing upnp object for item 'musicdb://2/214/?albumartistsonly=false'
18:50:27 T:140259010414336   DEBUG: Building didl for object 'musicdb://2/214/?albumartistsonly=false'
18:50:27 T:140259010414336   DEBUG: Returning UPnP response with 50 items out of 274 total matches
18:50:29 T:140259010414336   DEBUG: UPnP Translated id to 'musicdb://2/279/?albumartistsonly=false'
18:50:29 T:140259010414336    INFO: UPnP: Received Browse DirectChildren request for object 'musicdb://2/279/?albumartistsonly=false', with sort criteria +dc:title
18:50:29 T:140259010414336   DEBUG: GetAlbumsByWhere query: SELECT albumview.* FROM albumview  WHERE albumview.idAlbum IN (SELECT song.idAlbum FROM song JOIN song_artist ON song.idSong = song_artist.idSong WHERE song_artist.idArtist = 279) OR albumview.idAlbum IN (SELECT album_artist.idAlbum FROM album_artist WHERE album_artist.idArtist = 279)
18:50:30 T:140259010414336   DEBUG: GetAlbumsByWhere - query took 132 ms
18:50:30 T:140259010414336   DEBUG: Album format left  = [%B]
18:50:30 T:140259010414336   DEBUG: Album format right = [%A]
18:50:30 T:140259010414336   DEBUG: Building UPnP response with filter '@childCount,dc:creator,upnp:album,upnp:artist,res,res@protection,res@duration,res@size,upnp:albumArtURI,upnp:searchClass', starting @ 0 with 50 requested
18:50:30 T:140259010414336   DEBUG: Preparing upnp object for item 'musicdb://2/279/-1/?albumartistsonly=false&artistid=279'
18:50:30 T:140259010414336   DEBUG: Building didl for object 'musicdb://2/279/-1/?albumartistsonly=false&artistid=279'
18:50:30 T:140259010414336   DEBUG: Preparing upnp object for item 'musicdb://2/279/683/?albumartistsonly=false&artistid=279'
18:50:30 T:140259010414336   DEBUG: Building didl for object 'musicdb://2/279/683/?albumartistsonly=false&artistid=279'
18:50:30 T:140259010414336   DEBUG: Preparing upnp object for item 'musicdb://2/279/682/?albumartistsonly=false&artistid=279'
18:50:30 T:140259010414336   DEBUG: Building didl for object 'musicdb://2/279/682/?albumartistsonly=false&artistid=279'
18:50:30 T:140259010414336   DEBUG: Preparing upnp object for item 'musicdb://2/279/684/?albumartistsonly=false&artistid=279'
18:50:30 T:140259010414336   DEBUG: Building didl for object 'musicdb://2/279/684/?albumartistsonly=false&artistid=279'
18:50:30 T:140259010414336   DEBUG: Preparing upnp object for item 'musicdb://2/279/685/?albumartistsonly=false&artistid=279'
18:50:30 T:140259010414336   DEBUG: Building didl for object 'musicdb://2/279/685/?albumartistsonly=false&artistid=279'
18:50:30 T:140259010414336   DEBUG: Returning UPnP response with 5 items out of 5 total matches
18:50:44 T:140259010414336   DEBUG: Received request to serve '4DA32258B2AB0AF22A56646139256830/folder.jpg' = 'image://%2fnfs4exports%2fhome%2faudio%2fJe.Dis.Aime_M_1999%2ffolder.jpg/'

Xbmc sent the covert (in JPEG) to Piccolo, and as it just try to play it without checking the format, the error pops up.
If I "clean" the directory, then retry to play it, it's working (very !!!) well.

Is there any option to ask Xbmc to not send unsupported formats to client ?
(I didn't found anything useful for this case in system/parameters/upnp)

Some infos about version I used :
15:12:45 T:140260266235840 NOTICE: -----------------------------------------------------------------------
15:12:45 T:140260266235840 NOTICE: Starting XBMC (12.2 Git:20130502-32b1a5e), Platform: Linux (Debian GNU/Linux 7.1 (wheezy), 3.9.9 x86_64). Built on Jun 25 2013
15:12:45 T:140260266235840 NOTICE: special://xbmc/ is mapped to: /usr/local/share/xbmc
15:12:45 T:140260266235840 NOTICE: special://xbmcbin/ is mapped to: /usr/local/lib/xbmc
15:12:45 T:140260266235840 NOTICE: special://masterprofile/ is mapped to: /home/freevo/.xbmc/userdata
15:12:45 T:140260266235840 NOTICE: special://home/ is mapped to: /home/freevo/.xbmc
15:12:45 T:140260266235840 NOTICE: special://temp/ is mapped to: /home/freevo/.xbmc/temp
15:12:45 T:140260266235840 NOTICE: The executable running is: /usr/local/lib/xbmc/xbmc.bin
15:12:45 T:140260266235840 NOTICE: Local hostname: stargate
15:12:45 T:140260266235840 NOTICE: Log File is located: /home/freevo/.xbmc/temp/xbmc.log
15:12:45 T:140260266235840 NOTICE: -----------------------------------------------------------------------

Locally compiled Xbmc because as I use latest Nvidia drivers I patched like that :

Code:
stargate:/home/xbmc/frodo# git diff
diff --git a/xbmc/Util.cpp b/xbmc/Util.cpp
index a503ee5..758da6d 100644
--- a/xbmc/Util.cpp
+++ b/xbmc/Util.cpp
@@ -1632,6 +1632,15 @@ bool CUtil::Command(const CStdStringArray& arrArgs, bool waitExit)
   int n = 0;
   if (child == 0)
   {
+    if (!waitExit)
+    {
+      // fork again in order not to leave a zombie process
+      child = fork();
+      if (child == -1)
+        _exit(2);
+      else if (child != 0)
+        _exit(0);
+    }
     close(0);
     close(1);
     close(2);
@@ -1646,7 +1655,7 @@ bool CUtil::Command(const CStdStringArray& arrArgs, bool waitExit)
   }
   else
   {
-    if (waitExit) waitpid(child, &n, 0);
+    waitpid(child, &n, 0);
   }

   return (waitExit) ? (WEXITSTATUS(n) == 0) : true;
diff --git a/xbmc/main/main.cpp b/xbmc/main/main.cpp
index 8fe4226..81181a0 100644
--- a/xbmc/main/main.cpp
+++ b/xbmc/main/main.cpp
@@ -66,13 +66,6 @@ int main(int argc, char* argv[])
   if (setrlimit(RLIMIT_CORE, &rlim) == -1)
     CLog::Log(LOGDEBUG, "Failed to set core size limit (%s)", strerror(errno));
#endif
-  // Prevent child processes from becoming zombies on exit if not waited upon. See also Util::Command
-  struct sigaction sa;
-  memset(&sa, 0, sizeof(sa));
-
-  sa.sa_flags = SA_NOCLDWAIT;
-  sa.sa_handler = SIG_IGN;
-  sigaction(SIGCHLD, &sa, NULL);
#endif
   setlocale(LC_NUMERIC, "C");
   g_advancedSettings.Initialize();
stargate:/home/xbmc/frodo#

Many thanks for your help
So, found yesterday evenning (night ...) a way to get it working without any modification, but "problem" still exist.

The Piccolo gives two ways to play an album when it is selected :
- Enter/OK key : retrieve informations about album and play it.
- Right direction : go into the album and show titles

The first is the one where problem occures, because Xbmc sends covert.jpg, and Piccolo doesn't know what to do with (I would be curious to know what is in the DLNA specifications about coverts or others infos).
Using the second way is fine. Only music titles are showed, and can be played. Problem : when you want to play an album you looked for, you need to "enter" it and play the first track ("Hooo my god, I need to press 2 mores keys !!!!"), so ... not really a big problem.

I ask a friend who has a Philips Streamium NP2900 (color graphic screen instead of the multi lines of Piccolo) and he told me that coverts are well displayed on it.
So I know, now, why Xbmc is sending it, but what about devices that are unable to display pictures ?
this is exactly what the upnp profile stuff we gsoc is about. device specific settings since every retard and its friend is attempting to do dlna these days and they usually fail in some way..
"Grumpy Bastard Developer"

Ok, now I understand this fabulous title Smile
Hey everyone - i stopped here because of the Denon Piccolo being mentioned.

I studied the text above about the Enter Ok/Right distinction... but i think that does not explain the following:

I have my Denon N5 PIccolo and a Raspberry Pi with Kodi in the same network. I only use the Music Library.

I can play everything just fine from the Music Library if I use the "Genre" options, or "Songs" or even "Year".

But NOT if I choose "Artists" !

If I choose that one on the Denon i get the option All Albums/ All Genres, but nothing plays.

Everything works fine if I use the HDMI connection and play from my TV. All tags have been changed and corrected so I am quite sure they are OK.

Any solutions out there ?

Thanks in advance