6

I noticed the other day that when watching a movie on Netflix in Chrome on my Retina MacBook Pro, the fans would spin up more quickly when I was just watching the video in a single tab in a regular window. (ie. Not full screen.)

When switching to full screen mode, within a minute or so, the fans would die down.

So I used a battery monitor app to measure the mAh while watching in both modes, and measured about 85 mAh in windowed mode, and about 50 mAh in full-screen mode.

I did not yet test in other browsers.

The Activity Monitor reports that just having Netflix open in a tab causes the discrete card to kick on, so I don't think it's a matter of integrated vs. discrete graphics.

I can't seem to determine why a larger viewing area and (theoretically) higher quality video stream would be using less system resources.

3 Answers 3

6
+200

It almost certainly has to do with the desktop window compositor.

When you have a video playing within a web browser window, and worse than that, in a plugin, the web browser has to render its page thusly:

  1. Draw our window decorations (address bar, bookmarks, buttons, etc.)
  2. Draw the first parts of the webpage.
  3. Draw a "black square" where the video is supposed to be, but draw the relevant parts of the webpage on both sides of it (left and right).
  4. Ask the plugin nicely to draw in the place it said it wants to have its window in.
  5. Draw the rest of the webpage beneath the window, down to the bottom of the page.
  6. On top of this sequence, the compositing window manager, which is responsible for the animated effects (like when you minimize and maximize windows, etc), has to keep track of the contents of every window on the screen. As part of this, it has to keep track of everything drawing inside that window, including the plugin, which in Chrome is an out-of-process plugin (meaning, it's part of another process, not the chrome main process). If the compositing window manager didn't keep track of this, and treat everything in the window as a "3D texture", it wouldn't be able to animate the minimization of a window into your taskbar when you click the minus button.

When you tell Flash (or Silverlight) to play the video full screen, what happens is that Flash stops telling Chrome to render anything. In fact, the entire compositing window manager can be temporarily disabled, and every other program that might be responsible for rendering graphics to the monitor is temporarily told to stop rendering (or, perhaps, they are allowed to submit drawing commands, but they have no actual effect on the screen.)

Graphics pipeline while not full-screen:

Browser and Flash/Silverlight -> compositing window manager -> graphics hardware

Graphics pipeline while full-screen:

Flash/Silverlight -> graphics hardware

This simplified pipeline reduces overhead because there is less buffer "copying" going on, and the entire video processing looks something like this:

  1. Download the video content from the network.
  2. Decrypt the video using the DRM system.
  3. Use a special part of the GPU, called the fixed-function video decoding pipeline, to perform hardware decoding of the video data to an uncompressed format.
  4. The hardware video decoding pipeline can now copy the decoded video straight into the graphics framebuffer and play it -- without sending it back to the CPU/RAM!

The fans spin up and more power is eaten when the video is windowed precisely because the compositing window manager is always saying, "OK, what does the video look like right now?" and it has to be read back into the CPU (and probably buffered in RAM) before the compositing window manager then decides to write it right back out to the graphics card, along with all the other composited data (the browser, the taskbar, etc.)

The compositing window manager has to keep asking for the video content to be transferred back to the CPU because, under normal circumstances, the only process on the system that is allowed to write directly to the video framebuffer is the compositing window manager. The browser, the video player, and every other component on the system has to go through the compositing window manager, like a gatekeeper or spokesperson, which sits between the hardware and the user space.

This is partly to enable "effects", and partly for security and stability reasons, because programs are unable to directly corrupt the desktop (either maliciously or by bad coding); the compositing window manager won't let it. But then, when the compositing window manager is disabled (at the request of privileged programs such as Flash and Silverlight), suddenly that extra layer of "overhead" is gone.

The compositing window manager used on Mac OS X is called Quartz Compositor and it has been a part of OS X for a long time. Quartz Extreme is the modern incarnation of the Quartz compositor, which does everything I described above on the GPU itself (although these operations aren't "free" just because they're offloaded to the GPU; the GPU still consumes power performing these compositing steps.)

For a developer perspective of exactly how a program (such as Flash, or Silverlight) can take full screen control and temporarily disable the Quartz Compositor, see this Apple developer doc.

Long story short: Quartz Compositor + very frequent screen updates (30 to 60 times per second with video) == high CPU usage. Remove the Quartz Compositor component from the pipeline and CPU usage drops dramatically, especially because Flash and Silverlight have hardware-accelerated video rendering and video decoding.

1
  • This answer sounds like it was written in the 90's, for 90's hardware and software (which I worked on a lot). The simple answer is that you're not massively scaling a full-motion video in real-time, and your graphics card just runs it in its native resolution. The compositing and effects has nothing to do with it, like it did 20 years ago. CPUs and GPUs can easily handle idle compositing.
    – Delorean
    May 23, 2017 at 4:07
-1

There are a few possible reasons to this.

The reason will also vary depending on your screen resolution and received netflix resolution.

If you are watching in full screen, and watching netflix in a matching resolution, e.g. HD on a HD monitor, the stream is posted straight to screen with no real effort.

However, if you are watching HD stream in a smaller window, the stream will need to be processed further on your machine, to fit it inside the given viewing window, using some sort of filtering. This obviously will slow the machine and / or take more resources to achieve.

The only flip side to that, is if you have the matching smaller resolution stream for the smaller window. In which case, it should be similar to full screen.

On top of that, when in full screen, your machine is just rendering the viewing window. However, when in windowed mode, you are also rendering the desktop, other windows etc etc. Requiring more processing/resources.

There could be more reasons as well that I have not covered.

-1

Chrome sometimes suspends tabs that haven't been used in a while (or have yet to be loaded if you've opened them in the background) - perhaps making something full screen has the same effect?

If my hunch is correct, the logical explanation for this is that when you're viewing something in Full Screen mode you're unlikely to switch tabs (you may not even be able to). The time it takes you to escape from Full Screen mode and switch tabs is plenty of time for Chrome to restore the tabs you are most likely to switch to. This would explain the sudden drop in power usage when switching to full screen. It may also be relevant to note that a full screen video stream is often counted as a separate window, which would mean that Chrome itself no longer had focus while Netflix is in Full Screen mode.

You might want to compare these results to other full screen-compatible sites (e.g. YouTube), and, if possible, other sites that offer both Silverlight and a full screen mode.

1
  • Just wanted to add that the other answers that were submitted whilst I wrote my answer sound equally plausible. I wouldn't be surprised if it's a combination of several factors. Mar 14, 2014 at 14:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .