Page 2 of 6 FirstFirst 1234 ... LastLast
Results 11 to 20 of 51

Thread: More "efficient" redraw?

  1. #11
    Join Date
    Nov 2003
    Location
    NextPVR HQ, Wellington, New Zealand
    Posts
    76,336
    Quote Originally Posted by cncb View Post
    Well, as I said the built-in NPVR screensaver causes a temporary power spike when it moves the fixed image around so I imagine if it did this every second instead of every several seconds I would see the same constant extra power usage.
    Did you try my suggestion of adding a logging message in GetRenderList() function of your plugin and your screen saver?

  2. #12
    Join Date
    May 2006
    Location
    Canada
    Posts
    21,282
    I create UIStatic for the elements that make up regions on the screen and only render changes

    Code:
                albumArtScreen = new UiStatic("AlbumArt", new Hashtable(), skinHelperJukebox);
                playbackTime = new UiStatic("Playback", new Hashtable(), skinHelperJukebox);
                if (skinHelper.ElementIsDefined("TimeBar"))
                {
                    timeBar = new UiStatic("TimeBar", new Hashtable(), skinHelperJukebox);
                }
                else
                {
                    timeBar = null;
                }
                playlistDetails = new UiStatic("Current", new Hashtable(), skinHelperJukebox);
    NPVR the helps by only changing elements that need to change.

    Martin
    Last edited by mvallevand; 2011-12-29 at 07:15 PM.

  3. #13
    Join Date
    Aug 2011
    Location
    Virginia, USA
    Posts
    485
    Quote Originally Posted by sub View Post
    Did you try my suggestion of adding a logging message in GetRenderList() function of your plugin and your screen saver?
    I just did and you are of course right. It calls it once a second for several seconds and then starts calling it ~40 times each second when the power usage spikes. What issue in NeedsRendering() could cause this?

  4. #14
    Join Date
    Nov 2003
    Location
    NextPVR HQ, Wellington, New Zealand
    Posts
    76,336
    Did you put a different message in each of the two so you know if the problem is with the plugin or screensaver? Since you indicated it did it with the default screen saver, I'm guessing plugin?

  5. #15
    Join Date
    Aug 2011
    Location
    Virginia, USA
    Posts
    485
    I only logged a message for my plugin's "screensaver" which is just a popup with a Black background and content that is refreshed every second.

  6. #16
    Join Date
    Nov 2003
    Location
    NextPVR HQ, Wellington, New Zealand
    Posts
    76,336
    Its probably something to do with NeedsRendering() returning true, but not getting a chance to render because of the screensaver being on top and gets rendered instead, so it gets in a bit of a tight loop.

    There is a few ways to fix it, but given your code isnt in front of me, the easiest fix is probably what Martin suggested. at the top of your plugin's NeedsRendering() method add:

    Code:
                if (PluginHelperFactory.GetPluginHelper().ScreenSaverIsActive())
                {
                    return false;
                }

  7. #17
    Join Date
    Nov 2003
    Location
    NextPVR HQ, Wellington, New Zealand
    Posts
    76,336
    If it's not the plugin, and seems to be caused by the screensaver (ie, happens regardless of what screen it's sitting on), then you'd need to take a look at your screen saver NeedsRendering() call to see what exactly is returning true continually and modify it to only true in the situations where you want the screen updated.

  8. #18
    Join Date
    May 2006
    Location
    Canada
    Posts
    21,282
    Quote Originally Posted by cncb View Post
    I only logged a message for my plugin's "screensaver" which is just a popup with a Black background and content that is refreshed every second.
    That's why I also return false on the main skin NeedsRendering() when PluginHelperFactory.GetPluginHelper().GetActivePop up() is true.

    Martin

  9. #19
    Join Date
    Aug 2011
    Location
    Virginia, USA
    Posts
    485
    I put another logging message in for GetRenderList() on the plugin screen (not the popup/screensaver). I then put in the check at the top of NeedsRendering() that you and Martin suggested. Testing with the default NPVR "FixedImage" screensaver, GetRenderList() for the plugin screen is still being called multiple times even with NeedsRendering() returning false? I also am logging when it returns false so I have verified it is returning false when the screensaver is active.

  10. #20
    Join Date
    Nov 2003
    Location
    NextPVR HQ, Wellington, New Zealand
    Posts
    76,336
    I know the built in screensaver isnt very optimal. With some options it produces a hole through which you can see the plugin below, so it renders the plugin too. Wattage wasnt high on my list of considerations. You're probably better off just focusing on your own plugin.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •