SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Studio
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV Studio Discussion related to the SageTV Studio application produced by SageTV. Questions, issues, problems, suggestions, etc. relating to the Studio software application should be posted here.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 02-24-2011, 02:12 PM
bialio's Avatar
bialio bialio is offline
SageTVaholic
 
Join Date: May 2007
Location: Frisco, TX
Posts: 3,445
Preloading Images

This might seem like a very simple question.

I'm loading up some fanart posters as a list is navigated - how do you preload them so that there isn't a delay - I'm talking about getting them into memory.

If I take my time and navigate all the way through the list, eventually every image in use appear to be loaded and from that point on moving around in the list is lightning fast. So what I want is a way to do all that backend processing without actually having to navigate the list.

btl.
__________________
PHOENIX 3 is here!
Server : Linux V9, Clients : Win10 and Nvidia Shield Android Miniclient
Reply With Quote
  #2  
Old 02-24-2011, 02:27 PM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Quote:
Originally Posted by bialio View Post
This might seem like a very simple question.

I'm loading up some fanart posters as a list is navigated - how do you preload them so that there isn't a delay - I'm talking about getting them into memory.

If I take my time and navigate all the way through the list, eventually every image in use appear to be loaded and from that point on moving around in the list is lightning fast. So what I want is a way to do all that backend processing without actually having to navigate the list.

btl.
LoadImage(image) forces them into cache if there is room. On raw images you have to call it twice LoadImage(LoadImage(Image)).

I do it for smm in a forked thread during inactivity definately not something you want to do while the user is active as it can slow stuff down especially on extenders.
Reply With Quote
  #3  
Old 02-24-2011, 06:30 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by PLUCKYHD View Post
LoadImage(image) forces them into cache if there is room. On raw images you have to call it twice LoadImage(LoadImage(Image)).

I do it for smm in a forked thread during inactivity definately not something you want to do while the user is active as it can slow stuff down especially on extenders.
Just curious, but what's a "raw" image? And why do you have load it twice? The first LoadImage should return a MetaImage, so I would have thought that calling LoadImage on a MetaImage would do nothing.
Reply With Quote
  #4  
Old 02-24-2011, 07:14 PM
Opus4's Avatar
Opus4 Opus4 is offline
Administrator
 
Join Date: Sep 2003
Location: NJ
Posts: 19,624
Check the docs for LoadImage() again -- the 2nd call loads the image in to the image cache. The default STV does quite a bit of double calls like that too.

- Andy
__________________
SageTV Open Source v9 is available.
- Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1.
- Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus
- HD Extenders: A) FAQs B) URC MX-700 remote setup
Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request.
Reply With Quote
  #5  
Old 02-24-2011, 07:18 PM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Yup what Andy said you have to call it twice to load it into cache took me a while to figure that out as well.
Reply With Quote
  #6  
Old 02-24-2011, 08:01 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by Opus4 View Post
Check the docs for LoadImage() again -- the 2nd call loads the image in to the image cache. The default STV does quite a bit of double calls like that too.

- Andy
Quote:
Originally Posted by PLUCKYHD View Post
Yup what Andy said you have to call it twice to load it into cache took me a while to figure that out as well.
That's cool. That answers another question that I had outstanding about the LoadImage api. (I guess I should have checked the JavaDoc )
Reply With Quote
  #7  
Old 10-27-2011, 09:52 PM
evilpenguin's Avatar
evilpenguin evilpenguin is offline
SageTVaholic
 
Join Date: Aug 2003
Location: Seattle, WA
Posts: 3,696
Sorry to bring this back up, but i'm still not getting great performance on my HD300 (Client seems to be working fine).

So i've got a table that displays 5 posters on the screen at a time (w/background loading) in addition to a preloading thread running in the background. As I understand it, it should work this way...
  1. On MenuLoad the rendering thread will start he 5 visible posters loading in the background and they'll pop up on the sceen whenever their ready.
  2. Left alone, the background thread will run though the posters and run LoadImage(LoadImage()) to pre-caches them.
  3. With the images pre-cached they should be already visible when they're scrolled onto the screen.

I've verified in the logs that the background preloading thread is working and running LoadImage(LoadImage()) on all of the posters, but when I scroll around the list the posters still seem like they're only geting cached once they become visible for the first time. Of coarse once i've scrolled through the list and all the posters have been visible once, everything is fast and smooth, but I thought that pre-loading the images would accomplish that on its own
__________________
Clients: 1xHD200 Connected to 50" TH-50PZ750U Plasma
Server : Shuttle SFF SSH55J2 w/ Win7 Home, SageTV v7, Core i3 540, 2GB RAM, 30GB SSD for OS, 1.5TB+2x1TB WDGP for Recordings, BluRay, 2xHDHR, 1xFirewire
SageTV : PlayOn, SJQ, MediaShrink, Comskip, Jetty, Web Client, BMT


Having a problem? Don't forget to include a log! (Instructions for: PlayOn For SageTV v1.5, MediaShrink)
Reply With Quote
  #8  
Old 10-27-2011, 09:55 PM
bialio's Avatar
bialio bialio is offline
SageTVaholic
 
Join Date: May 2007
Location: Frisco, TX
Posts: 3,445
That matches my experience exactly - in the 'Grid' view in phoenix when I do a LoadImage(LoadImage()) call I don't see a speed increase. Only after it's visible does it flow smoothly.

btl.
__________________
PHOENIX 3 is here!
Server : Linux V9, Clients : Win10 and Nvidia Shield Android Miniclient
Reply With Quote
  #9  
Old 10-27-2011, 11:35 PM
evilpenguin's Avatar
evilpenguin evilpenguin is offline
SageTVaholic
 
Join Date: Aug 2003
Location: Seattle, WA
Posts: 3,696
Think I got it, I turned off background loading in the image widget and now its working like I expect it to. Granted this caused the scrolling to pause whenever it gets to an image that isn't pre-loaded but I think that's fixable too.

I'm thinking about trying two things...

1) In the rendering chain use IsImageLoaded() to conditionally enable background loading in the image widget.
2) Only show images that have been pre-loaded in the rendering chain and call Refresh() from the background thread when images are loaded.
__________________
Clients: 1xHD200 Connected to 50" TH-50PZ750U Plasma
Server : Shuttle SFF SSH55J2 w/ Win7 Home, SageTV v7, Core i3 540, 2GB RAM, 30GB SSD for OS, 1.5TB+2x1TB WDGP for Recordings, BluRay, 2xHDHR, 1xFirewire
SageTV : PlayOn, SJQ, MediaShrink, Comskip, Jetty, Web Client, BMT


Having a problem? Don't forget to include a log! (Instructions for: PlayOn For SageTV v1.5, MediaShrink)
Reply With Quote
  #10  
Old 10-28-2011, 07:43 AM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Correct background loading must be off or they will still be loaded in the background regardless of wether or not they are cached I have found you can preload about 100 posters on a hd300 without overloading it. and makes a huge speed difference.

Also I wouldn't do it that way EP calling refresh is going to make it even slower experience and isn't needed. Keep in mind with BG loading off if they scroll to a page that isn't cached the scrolling won't happen until the images are loaded.
Reply With Quote
  #11  
Old 12-29-2011, 05:29 PM
jaminben jaminben is offline
Sage Icon
 
Join Date: Sep 2007
Location: Norwich, UK
Posts: 1,754
Send a message via MSN to jaminben
Probably a silly question but I'll ask anyway like I always do

Is there a way to tell how much space is left in the cache so you could carry on pre-loading images to the maximum?
__________________
Server - Win7 64bit, 2.4Ghz Intel Core 2 Duo, TBS 6284 PCI-E Quad DVB-T2 Tuner, 3 x HD200 & 1 x HD300 extenders
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Caching of images sciguy Sage My Movies 14 11-21-2010 09:04 AM
Will preloading of thumbnails be ported to SageMC? scm SageMC Custom Interface 4 04-24-2009 06:18 PM
Aligning Images peternm22 SageTV Studio 8 02-03-2009 02:30 PM
Images not getting reloaded GKusnick SageTV Studio 1 01-06-2006 07:53 AM


All times are GMT -6. The time now is 12:56 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.