FAQ  •  Register  •  Login

Thumbnails mixed up

<<

jhb50

DLNA master

Posts: 2843

Joined: Thu Jun 30, 2011 9:32 pm

Post Mon Jul 02, 2012 5:17 pm

Re: Thumbnails mixed up

will wrote:OK lets get to the bottom of it. If you aren't already familure with logcat on android, spend a few minutes reading up. I'll edit this post in a min with a build that will show you what it is doing, i'll then post some instructions.

Happy to help! What's another day LOL!
<<

will

DLNA master

Posts: 2138

Joined: Mon Aug 30, 2010 11:18 am

Location: UK

Post Mon Jul 02, 2012 5:24 pm

Re: Thumbnails mixed up

There may be a bug in ServiiGo, but I'm not sure how it could cause this problem (Instead the problem would be reused resource ids for the thumbnails).

Download: https://bitbucket.org/willlunniss/servi ... -DEBUG.apk

Do you have adb setup on your PC?

If so open up two consoles. In the first type (otherwise set it up or try one of these apps http://forum.xda-developers.com/showthr ... ?t=1726238)

  Code:
adb logcat -s "ServiiGo" > ServiiGo.log.txt

to keep a record and in the second type
  Code:
adb logcat -s "ServiiGo"


If an image isn't in cache you will get this chain of events (note it is a first in last out queue so they will go in one order, and come out in reverse (except for the first entry):
  Code:
D/ServiiGo(23069): [ImageManager:displayImage] Queuing image : http://192.168.15.100:23424/cds/resource/1000000000020004/COVER_IMAGE,serviigo?authToken=80b1b5468ee64a31bf460b145affe36e

D/ServiiGo(23069): [ImageManager:getBitmap] Url : http://192.168.15.100:23424/cds/resource/1000000000020004/COVER_IMAGE,serviigo?authToken=80b1b5468ee64a31bf460b145affe36e

D/ServiiGo(23069): [ImageManager:writeFile] File : file:/mnt/sdcard/ServiiGo/ThumbnailCache/192.168.15.100-23424/-1133382581

D/ServiiGo(23069): [ImageManager:displayImage] Url : http://192.168.15.100:23424/cds/resource/1000000000020004/COVER_IMAGE,serviigo?authToken=80b1b5468ee64a31bf460b145affe36e


If an image is in the disk cache, but not the memory one you will get:
  Code:
D/ServiiGo(23069): [ImageManager:displayImage] Queuing image : http://192.168.15.100:23424/cds/resource/1000000000020004/COVER_IMAGE,serviigo?authToken=ecb6c803696346629baaea94b000bc95

D/ServiiGo(23069): [ImageManager:getBitmap] From SD Card : /mnt/sdcard/ServiiGo/ThumbnailCache/192.168.15.100-23424/-1133382581

D/ServiiGo(23069): [ImageManager:displayImage] Url : http://192.168.15.100:23424/cds/resource/1000000000020004/COVER_IMAGE,serviigo?authToken=ecb6c803696346629baaea94b000bc95


and finally, if the image is in the memory cache you will get:
  Code:
D/ServiiGo(23069): [ImageManager:displayImage] From cache : http://192.168.15.100:23424/cds/resource/1000000000020004/COVER_IMAGE,serviigo?authToken=ecb6c803696346629baaea94b000bc95


So can you go through those steps you did before and at each stage check manually what the image is, to see if the image changes while still keeping the same url.

Additionally, check the data comming from Serviio by looking for a line like this and appending http://server:23424/cds/ to it
  Code:
D/ServiiGo(23069): [Application:browse] Url : browse/serviigo/V_OF%5EFOL_FD2/BrowseDirectChildren/all/0/0?authToken=ecb6c803696346629baaea94b000bc95


If you get stuck, post the whole log and I will look through it. Provided you access your server locally, there is nothing in there of any use so it is safe to post.

So some points to look for, in my example, I would keep http://192.168.15.100:23424/cds/browse/ ... 94b000bc95 open in my browser, and refresh to watch the content change.
If the content title changed, but the thumbnail under thumbnailUrl didn't change (which is what I / zip expect), then serviigo will display the wrong thumbnail. This can be fixed by not caching thumbnails for online content.
Will

ServiiDroid (Android Console) Developer: Download | Home | Support
ServiiGo (Android 3G/4G/WiFi Playback App) Developer: Download | Home | Support
<<

jhb50

DLNA master

Posts: 2843

Joined: Thu Jun 30, 2011 9:32 pm

Post Mon Jul 02, 2012 6:03 pm

Re: Thumbnails mixed up

jhb50 wrote:
zip wrote:Might be the problem then. the online IDs are reused and start with 1 at the end (for each online repository), and keep increasing by 1 for each feed item. I think I added the http header for not caching these images on the client side, which is probably why the browser works ok.

Serviio caches them by the thumbnail URL, so it's ok (provided then don't get overwritten), but might serve different image for the same ID after the feed is refreshed.


So how does this explain why the 5th feed item moving up to be the 3rd feed item retains the original icon for the 3rd feed item? If so why does ServiiGo get the correct icons after the plugin refresh when one logs out and restarts? Surely it gets the same info from Serviio as Serviio sent it after the feed refresh. I don't think this explains it. UPnP correctly refreshes the icon after its "Settings/More/Clear album art cache" is cleared. I think its a ServiiGo refresh issue.

Thinking this over, if he sends back the same id(which btw is not the new cachekey)'for the new 3rd item then you will assume(rightfully so)that the icon has not changed. You will only get the correct icon when you need to rebuild the cache. Why dont you update the icons as well when I click Refresh in ServiiGo? It would solve all these problems.
<<

will

DLNA master

Posts: 2138

Joined: Mon Aug 30, 2010 11:18 am

Location: UK

Post Mon Jul 02, 2012 6:22 pm

Re: Thumbnails mixed up

jhb50 wrote:Thinking this over, if he sends back the same id(which btw is not the new cachekey)'for the new 3rd item then you will assume(rightfully so)that the icon has not changed. You will only get the correct icon when you need to rebuild the cache. Why dont you update the icons as well when I click Refresh in ServiiGo? It would solve all these problems.


Do you mean when you press refresh, go through all the current thumbnails belonging to the current content and delete them from the memory cache and delete them from the disk cache? I guess I could do that for Online folders only. Although that would add a noticable delay on some devices when there are a large number of items, but would be better than not caching them for users which use online content that doesn't have this problem. Will take me a little while to implement, I'll try and send you a test build tomorrow.

However, if this is the problem, then it will keep coming back in apps like BubleUPnP etc...
Will

ServiiDroid (Android Console) Developer: Download | Home | Support
ServiiGo (Android 3G/4G/WiFi Playback App) Developer: Download | Home | Support
<<

will

DLNA master

Posts: 2138

Joined: Mon Aug 30, 2010 11:18 am

Location: UK

Post Mon Jul 02, 2012 6:57 pm

Re: Thumbnails mixed up

OK here is a quick fix. If this works I will improve it future for 1.0 by not saving the images to the sd card in the first place, for now when refreshing an online folder, I go and clear out any thumbnails from memory and disk. So logging out then loading an online folder will shown the wrong thumnails, until you refresh. Once I implement the proper workaround, this won't be needed.

https://bitbucket.org/willlunniss/servi ... -DEBUG.apk
Will

ServiiDroid (Android Console) Developer: Download | Home | Support
ServiiGo (Android 3G/4G/WiFi Playback App) Developer: Download | Home | Support
<<

jhb50

DLNA master

Posts: 2843

Joined: Thu Jun 30, 2011 9:32 pm

Post Mon Jul 02, 2012 10:16 pm

Re: Thumbnails mixed up

Re your last 2 notes, once you clear the memory and cache, I think all that will happen is that the current few displayed icons in each folder will show the film strip and will need to be reloaded from Serviio. That is no more delay than when users go to the next few icons for the first time.
You are correct about Bubble. It shows the wrong icons now but has a clear setting that I posted above that clears the memory and causes the correct icons to be displayed.

Once zip fixes it to send a new id when the item changes, I think everything will work ok without you doing anything and you I think you should continue to cache, but I think having the easy to access refresh of cache and memory is a worthwhile feature anyway that isolates ServiiGo from anyones screwups. When something does not work its real nice to be able to start clean.

On the other issue of long start times for online feeds, I think it might be MX player. A quick test using VPlayer started quickly. I'll test more.
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17212

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Mon Jul 02, 2012 10:21 pm

Re: Thumbnails mixed up

<<

jhb50

DLNA master

Posts: 2843

Joined: Thu Jun 30, 2011 9:32 pm

Post Tue Jul 03, 2012 12:58 am

Re: Thumbnails mixed up

OK here is a quick fix.


Worked like a charm!

Logged on, opened feed, 2 items now containing the icons from the previous items 1 an 2. Pressed refresh, both items switched to film icon then quickly populated with the correct icons.

I will work on the stream start delay now and post over in ServiiGo thread.

Consider this SOLVED!
<<

will

DLNA master

Posts: 2138

Joined: Mon Aug 30, 2010 11:18 am

Location: UK

Post Tue Jul 03, 2012 7:46 am

Re: Thumbnails mixed up

Thats good.

Here is the revised version I talked about which won't store the images on the SD card in the first place, plus debug logging is turned off. https://bitbucket.org/willlunniss/servi ... .0-PRE.apk
Will

ServiiDroid (Android Console) Developer: Download | Home | Support
ServiiGo (Android 3G/4G/WiFi Playback App) Developer: Download | Home | Support
<<

jhb50

DLNA master

Posts: 2843

Joined: Thu Jun 30, 2011 9:32 pm

Post Tue Jul 03, 2012 1:24 pm

Re: Thumbnails mixed up

Ooops...that one does not work. Displays previous bad icons and refresh does not correct them. Reverted to DEBUG version and refresh corrects them correctly.
<<

will

DLNA master

Posts: 2138

Joined: Mon Aug 30, 2010 11:18 am

Location: UK

Post Tue Jul 03, 2012 1:32 pm

Re: Thumbnails mixed up

jhb50 wrote:Ooops...that one does not work. Displays previous bad icons and refresh does not correct them. Reverted to DEBUG version and refresh corrects them correctly.


Clean the thumbnail cache. This new one doesn't put stuff on the sd card, so doesn't have code in it to remove it from the sd card (=faster as no point saving something just to delete it later).
Will

ServiiDroid (Android Console) Developer: Download | Home | Support
ServiiGo (Android 3G/4G/WiFi Playback App) Developer: Download | Home | Support
<<

jhb50

DLNA master

Posts: 2843

Joined: Thu Jun 30, 2011 9:32 pm

Post Tue Jul 03, 2012 5:47 pm

Re: Thumbnails mixed up

OK, that worked.
<<

jhb50

DLNA master

Posts: 2843

Joined: Thu Jun 30, 2011 9:32 pm

Post Wed Jul 04, 2012 6:11 pm

Re: Thumbnails mixed up

Well this morning I opened the feed (ServiiGo remained Active overnight)
and I expected the correct icons for the Serviio refreshed feed , having cleared the cache yesterday, but alas I got the same icons as yesterday (for the items that were there then plus two correct icons for the 2 additional items on the latest feed.

So it seems that you recognize the feed has been updated and you get the 2 additional items and their icons, but the original 5 items (which will reuse the ids from yesterday) don't trigger a refresh of what is already in memory for them. That's not a problem to me because I know I can force it with your refresh button,(which I did and it worked) but I think you were trying to display the correct items by not saving the old icons on sd, and it looks like you also need to clear memory as well, until zip fixes the ids.
<<

will

DLNA master

Posts: 2138

Joined: Mon Aug 30, 2010 11:18 am

Location: UK

Post Thu Jul 05, 2012 7:20 am

Re: Thumbnails mixed up

Just press refresh and it will sort itself out. I cannot delete an image from the memory cache if I don't know what it is, which cannot happen until you explicitly refresh a folder.
Will

ServiiDroid (Android Console) Developer: Download | Home | Support
ServiiGo (Android 3G/4G/WiFi Playback App) Developer: Download | Home | Support
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17212

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Mon Oct 29, 2012 9:34 pm

Re: Thumbnails mixed up

I have now updated the ID generation for 1.1. Please test this when 1.1 beta is out. Each feed refresh should give all the items new ID, meaning a client cache will reload the image as the URL will be unique.
<<

jhb50

DLNA master

Posts: 2843

Joined: Thu Jun 30, 2011 9:32 pm

Post Mon Oct 29, 2012 9:41 pm

Re: Thumbnails mixed up

Noted.
Previous

Return to Plugin development

Who is online

Users browsing this forum: No registered users and 13 guests

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.