Page 1 of 6 123 ... LastLast
Results 1 to 10 of 51

Thread: More "efficient" redraw?

Hybrid View

  1. #1
    Join Date
    Aug 2011
    Location
    Virginia, USA
    Posts
    453

    More "efficient" redraw?

    I just got a power usage meter as a gift and now, of course, am scrutinizing all my electronics to death . In any case, when in my MusicMonkey plugin and showing the (static) list of songs in Now Playing my PC uses ~19W. When I go into the MusicMonkey screensaver where it forces an update/redraw every second for the elapsed time, it jumps to ~37W which is pretty much the same usage when watching HD video. When I am using the built-in "FixedImage" NPVR screensaver, every time the image moves the usage temporarily jumps to ~30W and then goes back down.

    Is there any conceivable way to improve the redraw "efficiency" or is it just the way it is? Note that in the MusicMonkey screensaver the CPU usage only goes up a few percent from when viewing the Now Playing list (~6% versus ~3%).

  2. #2
    Join Date
    Nov 2003
    Location
    NextPVR HQ, Wellington, New Zealand
    Posts
    75,872
    I dont really understand the scenario you're trying to decribe.

    As a guess - it sounds like either your screensaver, or the screen behind it, are return 'true' from NeedsRendering() causing it to continually redraw the screen

  3. #3
    Join Date
    May 2006
    Location
    Canada
    Posts
    20,744
    What I did in MusicBox4 to reduce CPU (now I have to get the power meter from the library).

    Code:
                if (PluginHelperFactory.GetPluginHelper().ScreenSaverIsActive() || PluginHelperFactory.GetPluginHelper().GetActivePopup() != null)
                {
                    return false;
                }
    I had a Thread.Sleep() in there too, but sub doesn't recommend them. I have them in WebRadio and it hasn't caused me a problem.

    Martin

  4. #4
    Join Date
    Aug 2011
    Location
    Virginia, USA
    Posts
    453
    My question is if there is a way to do a redraw that would not cause such a jump in power usage when it is performed. My "screensaver" has to redraw every second to update the displayed time elapsed text and "progress bar" so there is no avoiding the redraws. I guess it is not possible but I thought I would ask anyways. I will have to see what happens with the "animated" screens in Windows Media Center - the higher power usage may just be unavoidable.
    Last edited by cncb; 2011-12-29 at 06:11 PM.

  5. #5
    Join Date
    May 2006
    Location
    Canada
    Posts
    20,744
    Again on MB4 I optimize my renderlist for playback on the NMT so unless the album changes I only re-render the timebar and hh:mm:ss element, which is also updated each second. I reserved a kill-a-watt at the library and will pick it up today or tomorrow and let you know if I see the same spikes, you got me curious.

    Martin

  6. #6
    Join Date
    Aug 2011
    Location
    Virginia, USA
    Posts
    453
    Quote Originally Posted by mvallevand View Post
    Again on MB4 I optimize my renderlist for playback on the NMT so unless the album changes I only re-render the timebar and hh:mm:ss element, which is also updated each second.
    How do you re-render just a few elements instead of all of them? Do you return some kind of selective list in GetRenderList()?

  7. #7
    Join Date
    Nov 2003
    Location
    NextPVR HQ, Wellington, New Zealand
    Posts
    75,872
    Are you sure it's drawing what you think it is drawing? I wouldnt expect updating one image and one bit of text every second to cause much CPU usage. I think its more likely you're missing something else that is happening.

    I'd put a log message in GetRenderList() for you plugin and your screen saver, to see if it's being called more often than you expect (because of issue with NeedsRendering()). I suspect you'll see it being rendered much more than the once per second you were expecting.

  8. #8
    Join Date
    Aug 2011
    Location
    Virginia, USA
    Posts
    453
    Quote Originally Posted by sub View Post
    I wouldnt expect updating one image and one bit of text every second to cause much CPU usage. I think its more likely you're missing something else that is happening.
    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.

  9. #9
    Join Date
    Nov 2003
    Location
    NextPVR HQ, Wellington, New Zealand
    Posts
    75,872
    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?

  10. #10
    Join Date
    Aug 2011
    Location
    Virginia, USA
    Posts
    453
    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?

Posting Permissions

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