view
Tweet
hifi: #19514 When main window is minimized or hidden below others, stop rendering

Detect when the Hifi client is minimized or the main window is totally obscured, and stop rendering so that CPU/GPU load is greatly reduced and app can be left always on.

Comments & Activity

  • 5 yrs, 1 mnth ago

    Philip added item #19514: When main window is minimized or hidden below others, stop rendering/streaming. Status set to Bidding .
  • We should probably add a conditional so that 'if window belongs to the Interface app, keep streaming" (in other words, if the Import window and the Log window are on top of or obscuring the main Interface window, we should continue to stream)
  • 5 yrs, 1 mnth ago

    Grayson posted a comment on issue #19514: When main window is minimized or hidden below others, stop rendering/streaming
  • Do we really want to disable streaming in this case?

    Consider a couple things...

    1) If the user isn't moving, then the voxel streaming data rate drops to 1 PPS... so it's not really a big hit to keep it going.

    2) Avatar mixer data of course could be more significant... if there are lots of avatars... but processing of this data is not likely a big CPU hit

    3) most importantly... if you "go back" to the window, then having the recent streaming data available will make the experience way better... we will just draw on the next frame... as opposed to wait till the scene data streams back in.

  • 5 yrs, 1 mnth ago

    ZappoMan posted a comment on issue #19514: When main window is minimized or hidden below others, stop rendering/streaming

  • I will edit job to be 'don't render if main window minimized or fully obscured'
  • 5 yrs, 1 mnth ago

    Philip posted a comment on issue #19514: When main window is minimized or hidden below others, stop rendering/streaming

  • 5 yrs, 1 mnth ago

    Philip updated item #19514 : When main window is minimized or hidden below others, stop rendering/streaming Changes: Notes changed.

  • 5 yrs, 1 mnth ago

    Philip updated item #19514 : When main window is minimized or hidden below others, stop rendering Changes: Summary changed.

  • 5 yrs, 1 mnth ago

    A bid was placed on item #19514: When main window is minimized or hidden below others, stop rendering.

  • 5 yrs, 1 mnth ago

    A bid was placed on item #19514: When main window is minimized or hidden below others, stop rendering.

  • The real trick here is going to be making sure any platform dependent code for Windows, Mac, and Linux will perform consistently across configurations. Thankfully, under Mac and Windows, this shouldn't be a significant problem since the APIs for getting all windows are well established and well maintained. Under Linux, there may be some trouble depending on if the windowing server being used is compatible with X or not, so some additional testing is advised across Linux configs.
  • 5 yrs, 1 mnth ago

    Geenz posted a comment on issue #19514: When main window is minimized or hidden below others, stop rendering

  • Geenz, is it possible that Qt actually gives us the info we need in the QPaintEvent?

    http://qt-project.org/doc/qt-4.8/qpaintevent.html#rect
  • 5 yrs, 1 mnth ago

    ZappoMan posted a comment on issue #19514: When main window is minimized or hidden below others, stop rendering

  • 5 yrs, 1 mnth ago

    Philip accepted 240.00 from Geenz on item #19514: When main window is minimized or hidden below others, stop rendering. Status set to Working.

  • @ZappoMan: No. From the looks of it, to achieve the spec 100% we'll need to drop down into the OS APIs and test to see if the combined area of those rects obscures a large enough portion of our main window's rect. I did notice some discussion here and there on Qt's discussion boards about a way to retrieve such information from Qt, and so far it's largely just listed as a "neat idea, but not a focus". If I ever end up going this deep into it, I'll more than likely end up creating a handy class that could be a basis for something that can be sent upstream.
  • 5 yrs, 1 mnth ago

    Geenz posted a comment on issue #19514: When main window is minimized or hidden below others, stop rendering

  • 5 yrs, 1 mnth ago

    ZappoMan posted a comment on issue #19514: When main window is minimized or hidden below others, stop rendering

  • 5 yrs, 1 mnth ago

    Geenz updated item #19514: When main window is minimized or hidden below others, stop rendering. sandbox url : https://github.com/Geenz/hifi/tree/19514 Status set to Functional.

  • Just did some testing ...

    When standing next to all the talking avatars on the simple domain, with the app minimized, I'm getting 48% CPU usage, when I bring the app back to the foreground, it jumps up to about 80-90%.

    Continuing to stand in the middle of the 40 avatars, with the app in the background but not minimized, CPU usage hovers around 40%.

    If I move away from the avatars and find some 'dead space' (no audio, no voxels around), and minimize the app, CPU hovers around 23%. With the app in the background (streaming at 10FPS), CPU hovers at 26%.

    When the app is minimized, I still hear audio.
  • 5 yrs, 1 mnth ago

    Grayson posted a comment on issue #19514: When main window is minimized or hidden below others, stop rendering

  • 5 yrs, 1 mnth ago

    Geenz updated item #19514: When main window is minimized or hidden below others, stop rendering. Status set to Review.

  • Geenz: using the code that is checked in for our team meeting today, we see a strange behavior that when the main window is partially obscured (which drops the frame rate as you've designed), often the bodies/heads of other people will jerk back and forth and very high speed between two close positions - like receiving packets out of order or something. You can (probably) simulate it by smoothly moving the arm of another avatar that you can see while you have the window partially covered.
  • I'm aware of the issue, and my assumption is there's a glClear missing somewhere. I tried to find a fix for it before submission, but couldn't find an adequate solution. You wouldn't notice it as much if it's rendering at a full 60FPS, but my guess is that this isn't isolated to just this patch; I noticed something similar with some kind of colored flash that occurs in the distance.
  • 5 yrs, 1 mnth ago

    Philip posted a comment on issue #19514: When main window is minimized or hidden below others, stop rendering

  • 5 yrs, 1 mnth ago

    Geenz posted a comment on issue #19514: When main window is minimized or hidden below others, stop rendering

  • It would be great to find it... yeah if we aren't clearing the window that's a bug we need to fix.
  • I actually just managed to track it down.

    So basically, QGLWidget, and by extension GLCanvas, will automatically swap the back buffer with the front buffer for us. What we actually want to do is manage it ourselves.

    I've just set this up on my local repo, along with setting the frame throttle to only throttle us down to about 15FPS instead of 10. It should make the app seem a bit more responsive in the background. I'll do a PR for the fix in the next few minutes.
  • And PR submitted. Please test and make sure that the "ringing" is gone.
  • 5 yrs, 1 mnth ago

    Philip posted a comment on issue #19514: When main window is minimized or hidden below others, stop rendering

  • 5 yrs, 1 mnth ago

    Geenz posted a comment on issue #19514: When main window is minimized or hidden below others, stop rendering

  • 5 yrs, 1 mnth ago

    Geenz posted a comment on issue #19514: When main window is minimized or hidden below others, stop rendering

  • 4 yrs, 10 mnths ago

    #19514 updated by Philip Status set to Done.

Labels Saved!

Bids

Login to bid
Who Amount Done in ...
*name hidden*$ ***8 hours