Solved Album art with UPnP
#1
Hi,

My Kodi acts as a DNLA/UPnP client (renderer + controller) against my TwonkyServer 8.5.1 DLNA Server.

TwonkyServer does serve thumbnails, based on Folder.jpg files stored in each album's folder -- see Twonky Server FAQ for End-users

I have tested this works using VLC as a DLNA client.

But I don't get any thumbnails for songs / albums in Kodi 18.4 Leia.

Do I miss something? Is this supposed to work? Do I need special settings for this to work?

Thanks in advance for your help.
Reply
#2
(2019-09-29, 15:24)sba923 Wrote: Hi,

My Kodi acts as a DNLA/UPnP client (renderer + controller) against my TwonkyServer 8.5.1 DLNA Server.

TwonkyServer does serve thumbnails, based on Folder.jpg files stored in each album's folder -- see Twonky Server FAQ for End-users

I have tested this works using VLC as a DLNA client.

But I don't get any thumbnails for songs / albums in Kodi 18.4 Leia.

Do I miss something? Is this supposed to work? Do I need special settings for this to work?

Thanks in advance for your help.

Any idea?
Reply
#3
Why don't you just point Kodi to where your albums are and let Kodi add them locally, leaving your Twonky Media Server to serve them to anything else you might have connected ?
Learning Linux the hard way !!
Reply
#4
(2020-04-08, 19:42)black_eagle Wrote: Why don't you just point Kodi to where your albums are and let Kodi add them locally, leaving your Twonky Media Server to serve them to anything else you might have connected ?
I've actually considered this when I started my "Noxon replacement project" (Raspberry Pi with standard 7" touchscreen) but rejected that option for multiple reasons:

1. the storage tree (currently 8,100+ songs, 622 artists, 605 albums, in 701 folders) would have to be accessed over SMB/CIFS, and enumerating that over Wi-Fi would take some time
2. I was unsure how taking updates (file changes, additions, removals, moves...) into account would work: would Kodi need to re-enumerate the tree periodically? At each start?
3. Navigating such a large tree using the standard Kodi UI is rather inconvenient: the top-level list in Kodi is the list of artists, finding a particular artist or album by scrolling such a long list on such a small screen is impractical. This is why I have configured TwonkyServer to serve several trees: by artist * / ABCDEFG / HIJKLMN / OPQRSTU / VWXYZ then AB / CD / EF / GH..., by album # / * ABCDEFG / HIJKLMN / OPQRSTU / VWXYZ then AB / CD / EF / GH.... you get the idea -- and UPnP only transfers the currently displayed list when navigating those trees, not the whole hierarchy.
Reply
#5
(2020-04-09, 11:31)sba923 Wrote: 1. the storage tree (currently 8,100+ songs, 622 artists, 605 albums, in 701 folders) would have to be accessed over SMB/CIFS, and enumerating that over Wi-Fi would take some time

Initially yes.  It will be quicker if you turn off 'fetch additional information during updates' and get that information overnight maybe, whilst the Pi isn't in use.  It depends on if you want that information too.  If not and your tags are decent, Kodi will build a library anyway.  Once it's done, the library is held locally on the Pi and the art will be cached there too. If the art doesn't change, Kodi will use the locally cached copy.  It will only need to access the files over smb when you play them.
 
(2020-04-09, 11:31)sba923 Wrote: 2. I was unsure how taking updates (file changes, additions, removals, moves...) into account would work: would Kodi need to re-enumerate the tree periodically? At each start?

No. You only need to update the library if you have changed something.  Also, if you haven't changed any tags you don't need to do the full tag scan and Kodi will just pick up removed/moved/added files.
(2020-04-09, 11:31)sba923 Wrote: Navigating such a large tree using the standard Kodi UI is rather inconvenient: the top-level list in Kodi is the list of artists,

That should be skin dependant, but I think you should have a look at 'nodes' which you can use to get exactly the behaviour that Twonky is giving you.  There are some examples in this thread https://forum.kodi.tv/showthread.php?tid=257378  Note that nodes are not skin dependant and that any skin should be able to use them although the initial method of navigation to them may vary.
Learning Linux the hard way !!
Reply
#6
(2020-04-09, 15:08)black_eagle Wrote:
(2020-04-09, 11:31)sba923 Wrote: 1. the storage tree (currently 8,100+ songs, 622 artists, 605 albums, in 701 folders) would have to be accessed over SMB/CIFS, and enumerating that over Wi-Fi would take some time

Initially yes.  It will be quicker if you turn off 'fetch additional information during updates' and get that information overnight maybe, whilst the Pi isn't in use.  It depends on if you want that information too.  If not and your tags are decent, Kodi will build a library anyway.  Once it's done, the library is held locally on the Pi and the art will be cached there too. If the art doesn't change, Kodi will use the locally cached copy.  It will only need to access the files over smb when you play them.
 
(2020-04-09, 11:31)sba923 Wrote: 2. I was unsure how taking updates (file changes, additions, removals, moves...) into account would work: would Kodi need to re-enumerate the tree periodically? At each start?

No. You only need to update the library if you have changed something.  Also, if you haven't changed any tags you don't need to do the full tag scan and Kodi will just pick up removed/moved/added files.
(2020-04-09, 11:31)sba923 Wrote: Navigating such a large tree using the standard Kodi UI is rather inconvenient: the top-level list in Kodi is the list of artists,

That should be skin dependant, but I think you should have a look at 'nodes' which you can use to get exactly the behaviour that Twonky is giving you.  There are some examples in this thread https://forum.kodi.tv/showthread.php?tid=257378  Note that nodes are not skin dependant and that any skin should be able to use them although the initial method of navigation to them may vary. 

How would Kodi find out I have changed (maybe fixed a typo in some tag) or added some files (ripped a new CD) in the tree? Can it reliably depend on some "file system change notification" over SMB/CIFS (like TwonkServer does on the NAS's local filesystem)? What would happen when I restart the NAS? Is there a means to force a quick (filenames only) or full (file contents) rescan?

I might look into all this, although it would only be a way to reproduce the behavior I'm expecting from Kodi's UPnP client... with a non-negligible investment if you ask me ;-)

... or I could try looking at the code... where should I start? (this would apply to: this issue about album art, but also about the sort order issue that's being discussed in another thread)
Reply
#7
(2020-04-09, 18:10)sba923 Wrote: How would Kodi find out I have changed (maybe fixed a typo in some tag) or added some files (ripped a new CD) in the tree? Can it reliably depend on some "file system change notification" over SMB/CIFS (like TwonkServer does on the NAS's local filesystem)? What would happen when I restart the NAS? Is there a means to force a quick (filenames only) or full (file contents) rescan?

No, you have to re-scan if you change something.  However, you can choose to do a full scan of the tags, or to skip over those that have not changed and just scan anything that has.  You can also navigate to specific directories and just scan those.
(2020-04-09, 18:10)sba923 Wrote: ... or I could try looking at the code... where should I start?

Cool.  I guess https://github.com/xbmc/xbmc/tree/master...twork/upnp and https://github.com/xbmc/xbmc/blob/master...ectory.cpp would be places to look at.  Also the view that you see possibly comes from https://github.com/xbmc/xbmc/blob/master...wState.cpp although there are also specific viewstates for the music library too.  Lot of code to dig through but it can be very rewarding when you find the issue.
Learning Linux the hard way !!
Reply
#8
(2020-04-10, 14:26)black_eagle Wrote:
(2020-04-09, 18:10)sba923 Wrote: How would Kodi find out I have changed (maybe fixed a typo in some tag) or added some files (ripped a new CD) in the tree? Can it reliably depend on some "file system change notification" over SMB/CIFS (like TwonkServer does on the NAS's local filesystem)? What would happen when I restart the NAS? Is there a means to force a quick (filenames only) or full (file contents) rescan?

No, you have to re-scan if you change something.  However, you can choose to do a full scan of the tags, or to skip over those that have not changed and just scan anything that has.  You can also navigate to specific directories and just scan those.
(2020-04-09, 18:10)sba923 Wrote: ... or I could try looking at the code... where should I start?

Cool.  I guess https://github.com/xbmc/xbmc/tree/master...twork/upnp and https://github.com/xbmc/xbmc/blob/master...ectory.cpp would be places to look at.  Also the view that you see possibly comes from https://github.com/xbmc/xbmc/blob/master...wState.cpp although there are also specific viewstates for the music library too.  Lot of code to dig through but it can be very rewarding when you find the issue. 

Thanks for the hints. I think it's better to discuss the sorting issue in the other thread, so.... see you there  Wink
Reply
#9
First finding: when Kodi doesn't show the album art for an album (I've seen the album art for some album, and later on it was no longer shown for the same album), Kodi attempts to retrieve the album art as follows:

http://192.168.1.3:9000/disk/DLNA-PNJPEG...defaa/A/O0$1$8I1819659.jpg?scale=1920x1080

TwonkyServer returns a dummy thumbnail in that case.

For the situations where I do get album art displayed properly, the URL is something like:

http://192.168.1.3:9000/disk/DLNA-PNJPEG...defaa/A/O0$1$8I1819659.jpg?scale=org
Reply
#10
(2020-04-12, 10:49)sba923 Wrote: First finding: when Kodi doesn't show the album art for an album (I've seen the album art for some album, and later on it was no longer shown for the same album), Kodi attempts to retrieve the album art as follows:

http://192.168.1.3:9000/disk/DLNA-PNJPEG...defaa/A/O0$1$8I1819659.jpg?scale=1920x1080

TwonkyServer returns a dummy thumbnail in that case.

For the situations where I do get album art displayed properly, the URL is something like:

http://192.168.1.3:9000/disk/DLNA-PNJPEG...defaa/A/O0$1$8I1819659.jpg?scale=org

Wireshark seems to indicate the URI is what TwonkyServer actually returns:

 <upnp:albumArtURI>http://192.168.1.3:9000/disk/DLNA-PNJPEG_TN-OP01-CI1-FLAGS00d00000/defaa/C/O0$1$11$117$216$3575$5528.jpg?scale=1920x1080</upnp:albumArtURI>

When I use VLC or Windows Media Player as the UPnP client I see data such as:

<upnp:albumArtURI dlna:profileID="JPEG_TN" >http://192.168.1.3:9000/disk/DLNA-PNJPEG_TN-OP01-CI1-FLAGS00d00000/defaa/A/O0$1$8I2098955.jpg?scale=org</upnp:albumArtURI>

What in Kodi could cause TwonkyServer to return "scaled to 1920x1080" thumbnails (which doesn't make any sense if you ask me)?
Reply
#11
(2020-04-12, 13:00)sba923 Wrote:
(2020-04-12, 10:49)sba923 Wrote: First finding: when Kodi doesn't show the album art for an album (I've seen the album art for some album, and later on it was no longer shown for the same album), Kodi attempts to retrieve the album art as follows:

http://192.168.1.3:9000/disk/DLNA-PNJPEG...defaa/A/O0$1$8I1819659.jpg?scale=1920x1080

TwonkyServer returns a dummy thumbnail in that case.

For the situations where I do get album art displayed properly, the URL is something like:

http://192.168.1.3:9000/disk/DLNA-PNJPEG...defaa/A/O0$1$8I1819659.jpg?scale=org

Wireshark seems to indicate the URI is what TwonkyServer actually returns:

 <upnp:albumArtURI>http://192.168.1.3:9000/disk/DLNA-PNJPEG_TN-OP01-CI1-FLAGS00d00000/defaa/C/O0$1$11$117$216$3575$5528.jpg?scale=1920x1080</upnp:albumArtURI>

When I use VLC or Windows Media Player as the UPnP client I see data such as:

<upnp:albumArtURI dlna:profileID="JPEG_TN" >http://192.168.1.3:9000/disk/DLNA-PNJPEG_TN-OP01-CI1-FLAGS00d00000/defaa/A/O0$1$8I2098955.jpg?scale=org</upnp:albumArtURI>

What in Kodi could cause TwonkyServer to return "scaled to 1920x1080" thumbnails (which doesn't make any sense if you ask me)? 

Does anyone have a clue?

I've tested with VLC on Android, album art works fine there too...
Reply
#12
Sorry @sba923 using music library via uPNP you are out on your own.
Reply
#13
(2020-05-09, 18:52)DaveBlake Wrote: Sorry @sba923 using music library via uPNP you are out on your own.

Isn't there someone out there who knows the code?
Reply
#14
(2019-09-29, 15:24)sba923 Wrote: Hi,

My Kodi acts as a DNLA/UPnP client (renderer + controller) against my TwonkyServer 8.5.1 DLNA Server.

TwonkyServer does serve thumbnails, based on Folder.jpg files stored in each album's folder -- see Twonky Server FAQ for End-users

I have tested this works using VLC as a DLNA client.

But I don't get any thumbnails for songs / albums in Kodi 18.4 Leia.

Do I miss something? Is this supposed to work? Do I need special settings for this to work?

Thanks in advance for your help.

I assume you are using the official Kodi MPD client addon. is not it ?
I never use it but after reading your post I wanted to try it (Version: Twonky Server 8.3-19 and LibreElec ). to compare with the logitechmediaserver and my squeezebox receiver to listen to music.
What is certain on my kodi system is that the covers of the songs, albums ... music are correctly displayed.
So the problem probably should not come from Kodi but from the settings of your Twonky. (look in twonky settings)
What is curious is that my client Kodi is seen by Twonky as an O2 joggler
Reply
#15
(2020-05-10, 09:52)sitro Wrote:
(2019-09-29, 15:24)sba923 Wrote: Hi,

My Kodi acts as a DNLA/UPnP client (renderer + controller) against my TwonkyServer 8.5.1 DLNA Server.

TwonkyServer does serve thumbnails, based on Folder.jpg files stored in each album's folder -- see Twonky Server FAQ for End-users

I have tested this works using VLC as a DLNA client.

But I don't get any thumbnails for songs / albums in Kodi 18.4 Leia.

Do I miss something? Is this supposed to work? Do I need special settings for this to work?

Thanks in advance for your help.

I assume you are using the official Kodi MPD client addon. is not it ?
I never use it but after reading your post I wanted to try it (Version: Twonky Server 8.3-19 and LibreElec ). to compare with the logitechmediaserver and my squeezebox receiver to listen to music.
What is certain on my kodi system is that the covers of the songs, albums ... music are correctly displayed.
So the problem probably should not come from Kodi but from the settings of your Twonky. (look in twonky settings)
What is curious is that my client Kodi is seen by Twonky as an O2 joggler 

No, I'm not using any add-on, I'm using the Kodi built-in UPnP client.

What is this add-on doing that the built-in mechanism isn't supposed to do?

For sure, I wouldn't want a solution that copies the contents of my TwonkyServer to Kodi local storage, 'cos this would at least require some synchronization scheme, would increase the amount of I/O (esp. writes) on the Raspberry Pi's µSD card...

As discussed elsewhere, I have verified that VLC (on Windows and on Android) does get the thumbnails served by TwonkyServer, but something in Kodi causes TwonkyServer to return incorrect thumbnail URIs.
Reply

Logout Mark Read Team Forum Stats Members Help
Album art with UPnP0