Playing video in full screen causes excess WindowServer CPU usage
Categories
(Core :: Audio/Video: Playback, defect, P1)
Tracking
()
People
(Reporter: martin.racak, Assigned: bradwerth)
References
(Blocks 1 open bug, Regression)
Details
(Keywords: power, regression)
Attachments
(5 files, 2 obsolete files)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:94.0) Gecko/20100101 Firefox/94.0
Steps to reproduce:
I'm on a MacBook Pro (13-inch, 2020) with macOS Monterey 12.0.1. Happens also in Troubleshoot Mode. I can reproduce by following these steps:
- Start Firefox by clicking on the desktop icon
- Open https://www.youtube.com/watch?v=aqz-KE-bpKQ in a new tab
- Play the video in full screen
- Open Activity Monitor
- WindowServer shows up to 200% CPU usage
- Close tab with the video
- WindowServer stays at around 100% CPU
Actual results:
Video played normally, but fan quickly started spinning a lot. WindowsServer was using high percentage of CPU.
Expected results:
No excess CPU usage.
| Reporter | ||
Comment 1•4 years ago
|
||
Wasn't able to reproduce in Nightly.
Comment 2•4 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::Audio/Video: Playback' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.
| Reporter | ||
Comment 3•4 years ago
|
||
Actually I'm able to reproduce also in Nightly. It happens only when video plays in low quality and in full screen, e.g. 480p. At 1440p60 I see normal WindowServer CPU usage. Also it drops to normal levels after I close the tab, but only after around 45 seconds.
Comment 4•4 years ago
|
||
Is this a regression, or has it always been this way for you? If it's a regression, could you use https://mozilla.github.io/mozregression/ to pin down where it began?
Comment 5•4 years ago
|
||
Could you get a sample of the WindowServer process using Activity Monitor? Or actually two, one in the low quality (high CPU) case and one in the high quality (low CPU) case.
| Reporter | ||
Comment 6•4 years ago
|
||
(In reply to Jon Bauman [:jbauman:] from comment #4)
Is this a regression, or has it always been this way for you? If it's a regression, could you use https://mozilla.github.io/mozregression/ to pin down where it began?
I was able to pin it down to https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=c9a191f99fa323e42bc664320d160b4ff4f3f4f1&tochange=af7e7b1d891ee07ec15c3702cbce8f509679b82a
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
| Reporter | ||
Comment 7•4 years ago
|
||
| Reporter | ||
Comment 8•4 years ago
|
||
| Reporter | ||
Comment 9•4 years ago
|
||
(In reply to Markus Stange [:mstange] from comment #5)
Could you get a sample of the WindowServer process using Activity Monitor? Or actually two, one in the low quality (high CPU) case and one in the high quality (low CPU) case.
Attached the samples.
Comment 10•4 years ago
|
||
Thanks!
The big difference I see is in the com.apple.skylight.stats dispatch queue. The "high CPU" sample is spending all of its time in __WSDataTimelinePushWindowStateForCurrentTime_block_invoke.
Comment 11•4 years ago
•
|
||
I've filed FB9736101 about this. Martin, it would be helpful if you filed a feedback report with Apple about this as well, so that the tool can collect information about your machine.
Maybe we can find out how to avoid hitting this expensive path, with some debugging...
| Reporter | ||
Comment 12•4 years ago
|
||
Sure, I could try. But I don't know how does one do that or which tool you have in mind. Could you point me to some relevant docs?
Comment 13•4 years ago
|
||
Oh yes, sorry, instructions are here: https://developer.apple.com/bug-reporting/
| Reporter | ||
Comment 14•4 years ago
|
||
Thanks. I have the Feedback Assistant app open, but I'm not sure which problem area should I pick. Just 3rd Party Apps? Or some SDK? And write down basically the same repro steps we have here? I wanted to check your report for inspiration, but I wasn't able to find a way to read it anywhere.
Comment 15•4 years ago
|
||
I filed mine under AVFoundation but I wasn't sure about the right component either - there doesn't seem to be one for the window server. Maybe file yours under "Graphics" or under "System Slow / Unresponsive". And yes, the basic steps to reproduce (with affected Firefox versions) should be enough.
| Reporter | ||
Comment 16•4 years ago
|
||
OK, submitted FB9736269. Chose "Graphics" as the problem area.
| Reporter | ||
Comment 17•4 years ago
|
||
I watched more YouTube videos and it also happens at 1440p, for example https://www.youtube.com/watch?v=LcI6F_GPwfE It uses the same codec (VP9) as the one where it didn't happen. One obvious difference is FPS - 60 good, 30 bad.
Updated•4 years ago
|
Comment 18•4 years ago
|
||
Changing the priority to p1 as the bug is tracked by a release manager for the current release.
See What Do You Triage for more information
| Assignee | ||
Comment 19•4 years ago
|
||
I'm unable to replicate this with either video, at any resolution on my MacBook Pro running Monterey. Are you by chance using an external monitor?
| Reporter | ||
Comment 20•4 years ago
|
||
No, just the built-in. Hmm, trying to think of things that could be relevant:
- Scaled resolution – 1280 x 800
- True Tone on
- Night Shift on
- Dynamic desktop (lol)
Switching them off/to default didn't help. This is my Graphics/Displays section from system report:
Intel Iris Plus Graphics:
Chipset Model: Intel Iris Plus Graphics
Type: GPU
Bus: Built-In
VRAM (Dynamic, Max): 1536 MB
Vendor: Intel
Device ID: 0x8a53
Revision ID: 0x0007
Metal Family: Supported, Metal GPUFamily macOS 2
Displays:
Colour LCD:
Display Type: Built-In Retina LCD
Resolution: 2560x1600 Retina
Framebuffer Depth: 30-Bit Colour (ARGB2101010)
Main Display: Yes
Mirror: Off
Online: Yes
Automatically Adjust Brightness: Yes
Connection Type: Internal
Checked about:support after I hit the issue just now and found this:
Failure Log
(#0) CP+[GFX1-]: Managed to allocate after flush.
(#1) Error Failed to allocate a surface due to invalid size (CDT) Size(0,0)
(#2) Error Failed to allocate a surface due to invalid size (CDT) Size(0,0)
(#3) Error Failed to allocate a surface due to invalid size (CDT) Size(0,0)
(#4) Error Failed to allocate a surface due to invalid size (CDT) Size(0,0)
(#5) Error Failed to allocate a surface due to invalid size (CDT) Size(0,0)
(#6) Error Failed to allocate a surface due to invalid size (CDT) Size(0,0)
(#7) Error Failed to allocate a surface due to invalid size (CDT) Size(0,0)
(#8) Error Failed to allocate a surface due to invalid size (CDT) Size(0,0)
I didn't realize failure logs could be there before. Is there any other info that would help? Is it possible to generate more logs?
| Assignee | ||
Comment 21•4 years ago
|
||
Thank you for the info on your graphics setup. Mine is similar, but I have Intel UHD Graphics 630. I still can't replicate by changing my resolution and settings to match yours. I'll keep trying things.
| Assignee | ||
Comment 23•4 years ago
|
||
(In reply to Marco Castelluccio [:marco] from comment #22)
Is anyone looking into this?
I am, but until I can reproduce, I've been hesitant to assign myself to the bug. And I can't reproduce. Given that it doesn't occur for the reporter in Nightly, this might have been fixed by recent work that didn't get uplifted.
Martin, are you willing to run the mozregression tool to help us understand what's going on here? You'd be using the --find-fix option with a date range from October 20th to today.
| Reporter | ||
Comment 24•4 years ago
|
||
As I said in comment 3 I was able to reproduce it also in Nightly. Just checked again with the latest Nightly and it is still the case. Maybe you missed this before and didn't try to set the quality manually when trying to reproduce? On top of that in comment 17 I found out that the difference seems to be in FPS, not resolution, but not sure.
So to recap: Playing https://www.youtube.com/watch?v=aqz-KE-bpKQ in full screen in 480p (which should be 30 FPS or maybe less?) causes WindowServer to go up to 200% CPU. With 720p60 (which should be 60FPS) it stays at around 30%.
| Assignee | ||
Comment 25•4 years ago
|
||
(In reply to Martin Račák from comment #24)
As I said in comment 3 I was able to reproduce it also in Nightly. Just checked again with the latest Nightly and it is still the case. Maybe you missed this before and didn't try to set the quality manually when trying to reproduce? On top of that in comment 17 I found out that the difference seems to be in FPS, not resolution, but not sure.
You're right; I'm sorry I missed that. In my attempts to reproduce, I am setting the quality level to 420p and I'm getting WindowServer usages in the 50% range. I'll see if I can do something to artificially limit the FPS and see if it triggers the high usage. I suspect the sub-30 FPS is an effect, not a cause, but I'll investigate.
| Assignee | ||
Comment 26•4 years ago
|
||
Though I still can't reproduce, here's a theory of what's happening: in low-FPS conditions, perhaps the WindowServer is not able to maintain the detached mode, and so it cycles in and out of the detached mode rapidly (with every frame?). I'll build a patch that abandons our attempt to enter detached mode if the frame rate is below some threshold, and we'll see if that solves Martin's reproduction case.
Comment 27•4 years ago
|
||
Martin, are you able to reproduce the problem on sites other than YouTube?
| Reporter | ||
Comment 28•4 years ago
|
||
Yes, on Twitch it's bad at 480p and lower and good at 720p60 and above. Very similar on Vimeo, but their player seems to respect chosen video quality less and maybe uses higher quality when there is bandwidth or it's just bugged. But when it plays in low quality it definitely also goes up to 200% CPU.
Comment 29•4 years ago
|
||
Martin, can you try downloading Quartz Debug? You can get it from here: https://developer.apple.com/download/all/?q=quartz%20debug or more conveniently here: https://github.com/jrmuizel/quartz-debug/files/7507362/Quartz.Debug.app.zip
When you run it, there's a "Show Detached Regions" menu entry under the "Tools" menu. Enable it. It should tint everything red. However, when full screen video is using detached mode the tint will go away. Can you try running the 480 and the 720 in Firefox that the red tint goes away. Can you also check if you see the red tint go away in Chrome and Safari on Twitch and Vimeo? Do you also see high cpu usage in the WindowServer when running the lower quality videos in Chrome or Safari?
| Reporter | ||
Comment 30•4 years ago
|
||
Tested only YouTube so far, because it seems that either the tool isn't working or the video is never using detached mode (yes, it was full screen).
Video: https://youtu.be/aqz-KE-bpKQ
| Browser | Quality | Red tint |
|---|---|---|
| Nightly | 480p | yes |
| Nightly | 720p60 | yes |
| Chrome | 480p | yes |
| Chrome | 720p60 | yes |
| Safari | 480p | yes |
| Safari | 720p60 | yes |
Neither Chrome nor Safari cause high CPU usage and Safari seems to be the most efficient in that regard, but that is just me looking at Activity Monitor. CPU usage in Firefox was also OK before the change I identified as regression in comment 6.
Comment 31•4 years ago
|
||
Is the QuartzDebug overlay window visible? In that case, could you try again with it closed? Detached mode is only hit if no other windows, or really nothing other than the video and a black background, are visible. On some machines it looks like the mouse cursor has to be invisible too.
| Reporter | ||
Comment 32•4 years ago
|
||
Yes, this is how my screen looks when it is playing (the tint was there, but isn't captured on the screenshot). Funnily enough, some important process must have crashed shortly after I took the screenshot in Nightly because I got logged off and after logging in all my processes restarted.
| Reporter | ||
Comment 33•4 years ago
|
||
I now realized that was a bit ambiguous. So to be clear: no other windows or cursor was visible, just the video.
Comment 34•4 years ago
|
||
That video has an annotation so you won't hit detached mode unless annotations are turned off. Can you try turning the annotation off and seeing if that lets you get detached mode and if it makes a difference for cpu usage?
| Assignee | ||
Comment 35•4 years ago
|
||
Martin, my theory in comment 26 is much less likely if you are not hitting detached mode. And since most of the recent code changes to video on macOS are related to that detached mode, it's hard to guess what might be going on here. In case this is unrelated to detached mode, would you please run a mozregression on your machine to find which bit of code started triggering this problem for you?
| Reporter | ||
Comment 36•4 years ago
|
||
(In reply to Jeff Muizelaar [:jrmuizel] from comment #34)
That video has an annotation so you won't hit detached mode unless annotations are turned off. Can you try turning the annotation off and seeing if that lets you get detached mode and if it makes a difference for cpu usage?
Finally some progress! When I turn the annotations off the red tint stays, but WindowServer CPU oscillates at around 30%.
(In reply to Brad Werth [:bradwerth] from comment #35)
In case this is unrelated to detached mode, would you please run a mozregression on your machine to find which bit of code started triggering this problem for you?
I already ran mozregression in comment 6. I don't think it makes sense to run it again, does it?
Comment 37•4 years ago
•
|
||
Edit: this comment is wrong
Very interesting. All prerequisites for detachment are met, but you don't get detachment. Hypothesis: Maybe the WindowServer attempts to detach, fails, and then reports the error somewhere, and the error reporting is what's causing the CPU usage.
Comment 38•4 years ago
•
|
||
Oh, sorry, I got it backwards. 30% is the low value, 200% is the high value. So that means if we're actually isolating successfully, CPU usage is low, but we're still not detached for some reason.
| Reporter | ||
Comment 39•4 years ago
|
||
Sorry, it's getting late here, I didn't check carefully enough with annotations off. Now I repeated the experiment from before with annotations turned off in each browser.
Video: https://youtu.be/aqz-KE-bpKQ
| Browser | Quality | Detached mode |
|---|---|---|
| Nightly | 480p | no |
| Nightly | 720p60 | yes |
| Chrome | 480p | no |
| Chrome | 720p60 | no |
| Safari | 480p | yes |
| Safari | 720p60 | yes |
(In reply to Markus Stange [:mstange] from comment #38)
Oh, sorry, I got it backwards. 30% is the low value, 200% is the high value. So that means if we're actually isolating successfully, CPU usage is low, but we're still not detached for some reason.
Yup, that sounds plausible.
| Assignee | ||
Comment 40•4 years ago
|
||
This prevents detached mode if a less-than-20fps frame has been hit in the
last 5 seconds.
Brad are you planning a fix in 96 that could be uplifted to beta or should we mark 95 as wontfix at this point of the release cycle?
Updated•4 years ago
|
Updated•4 years ago
|
| Assignee | ||
Comment 43•4 years ago
|
||
This fixes a correctness issue. Since NativeLayerCA Representations can
generate new CALayers under certain conditions, the NativeLayerRootCA must
check to see if a rebuild is necessary when committing.
| Assignee | ||
Comment 44•4 years ago
|
||
This change makes the decision of whether or not to specialize the video layer
(to choose a AVSampleBufferDisplayLayer over a CALayer) dependent upon
whether or not the video layer is currently isolated. This means that the
NativeLayerCA may generate new CALayers at times when it hasn't been given a
new surface to display. To compensate for this, the current surface is now
captured and reused.
Depends on D131307
| Assignee | ||
Comment 45•4 years ago
|
||
Martin, I'd like to see if the proposed patch solves the problem for you. Would you please download and try out this build and report how it behaves with your testcases?
| Reporter | ||
Comment 46•4 years ago
|
||
At 480p with annotations on, WindowServer CPU oscillates around 22% (was up to 200% before), so that case seems to be fixed! With annotations off it still won't enter detached mode and WindowServer stays at around 30% (like before), maybe because it keeps trying to enter detached mode and fails?
Unfortunately at 780p60 there seems to be a regression. With annotations off and after playing in detached mode for some time WindowServer CPU sometimes goes up to 200%, but I'm not able to reproduce it reliably. With annotations on (no detached mode) it stays around 35% and Firefox NighltyCP RDD Process oscillates 30% – 70%, which I haven't seen in other cases (or before, I think).
Overall when looking at Activity Monitor different processes now seem to behave less deterministically with regard to their CPU usage, but that is just my impression.
| Assignee | ||
Comment 47•4 years ago
|
||
(In reply to Martin Račák from comment #46)
At 480p with annotations on, WindowServer CPU oscillates around 22% (was up to 200% before), so that case seems to be fixed! With annotations off it still won't enter detached mode and WindowServer stays at around 30% (like before), maybe because it keeps trying to enter detached mode and fails?
With annotations on, it will never even try to enter detached mode, so any improvements there we should consider as fixes. Annotations off, we could be trying to reach detached mode, but we don't know what the WindowServer is doing. If the Quartz Debug tool "Show Detached Regions" feature turns off the red tint then we are in detached mode and we have to assume that is reliable reporting.
So if some cases you are still getting high CPU, we need to know if they are occurring during:
- Steady red tint: we're attempting to reach detached mode but the WindowServer is rejecting it.
- Absent the red tint: we've reached detached mode but the WindowServer is doing something that exercises the CPU.
- Toggling between the red tint and normal: we are entering and leaving the detached mode, which might mean we are regenerating layers unnecessarily.
Unfortunately at 780p60 there seems to be a regression. With annotations off and after playing in detached mode for some time WindowServer CPU sometimes goes up to 200%, but I'm not able to reproduce it reliably. With annotations on (no detached mode) it stays around 35% and Firefox NighltyCP RDD Process oscillates 30% – 70%, which I haven't seen in other cases (or before, I think).
This sounds like case 2. Can you try to replicate this (with the patched build) and note if the detached mode toggles off (no red tint) when the CPU is high?
Sorry to put you through all this testing, but we're still trying to find hardware that replicates the issue you're seeing. In the meantime, this patch seems like it is an improvement so I'll start the review process.
| Reporter | ||
Comment 48•4 years ago
|
||
(In reply to Brad Werth [:bradwerth] from comment #47)
Annotations off, we could be trying to reach detached mode, but we don't know what the WindowServer is doing. If the Quartz Debug tool "Show Detached Regions" feature turns off the red tint then we are in detached mode and we have to assume that is reliable reporting.
Just to avoid potential confusion here – when I say it does or doesn't enter detached mode it's a result of my tests with the Quartz Debug tool, I'm not merely guessing.
This sounds like case 2. Can you try to replicate this (with the patched build) and note if the detached mode toggles off (no red tint) when the CPU is high?
I tried a few combinations of things and wasn't able to reproduce the state I randomly hit before where WindowServer CPU stayed near 200% when playing 720p60 with annotations off. However, what seems to replicate is when I open the video, turn annotations off and start playing at 480p (which doesn't enter detached mode). Then while it's playing I change the quality to 720p60 and it quickly enters detached mode. I let it play for a few seconds and then check the Activity Monitor. WindowServer quickly shoots up to 200% CPU and then somewhat slower comes down to about 35% again, where it seems to stay.
| Assignee | ||
Comment 49•4 years ago
|
||
(In reply to Martin Račák from comment #48)
(In reply to Brad Werth [:bradwerth] from comment #47)
Annotations off, we could be trying to reach detached mode, but we don't know what the WindowServer is doing. If the Quartz Debug tool "Show Detached Regions" feature turns off the red tint then we are in detached mode and we have to assume that is reliable reporting.
Just to avoid potential confusion here – when I say it does or doesn't enter detached mode it's a result of my tests with the Quartz Debug tool, I'm not merely guessing.
Yes, I'm sorry, I chose my words poorly here. I mean reliable reporting by the WindowServer that it is actually in detached mode and not merely attempting to reach it and doing extra work in the background that might push the CPU.
Seems like the proposed patch is an improvement, possibly even a fix. We'll continue with the review process and I'll try to get it landed.
| Assignee | ||
Comment 50•4 years ago
|
||
I'm going to land D131307 separately and leave this bug open while we work through the more complicated changes.
Comment 51•4 years ago
|
||
Comment 52•4 years ago
|
||
| bugherder | ||
Comment 53•4 years ago
|
||
Just wanted to mention that I'm also having this issue on Chrome. It will happen reliably if I watch Twitch in full screen for a few minutes. I also noticed there's a bug report for video.js here: https://github.com/videojs/video.js/issues/7520
Comment 54•4 years ago
|
||
Also the video on Twitch I'm watching is 864p60 (I noticed discussion up above about it perhaps only occurring sub 720p)
| Assignee | ||
Comment 55•4 years ago
|
||
Martin, new build to try, that uses a different approach to hopefully solve the problem. Would you please try this build with your problematic cases?
| Reporter | ||
Comment 56•4 years ago
|
||
Unfortunately, it does not solve it. At 480p, with annotations both on and off, WindowServer CPU goes up to 200%.
Comment 57•4 years ago
|
||
Just wanted to throw my hat into the ring as well and say that I've also been experiencing this issue. Running a YouTube video (https://www.youtube.com/watch?v=iPzPZTmUt1E) at 720p and going fullscreen for several seconds pushes the WindowServer process up to and slightly above 100%. I've noticed that in the newest release, it eventually resets whereas before I had to reboot my computer or kill the process in Activity Monitor to reset it.
Firefox version: Firefox 94.0.2 (64-bit)
Model Name: MacBook Pro
Model Identifier: MacBookPro18,3
Chip: Apple M1 Pro
Total Number of Cores: 8 (6 performance and 2 efficiency)
Memory: 16 GB
System Firmware Version: 7429.41.5
OS Loader Version: 7429.41.5
Comment 58•4 years ago
|
||
(In reply to jbwzrd213 from comment #57)
Just wanted to throw my hat into the ring as well and say that I've also been experiencing this issue. Running a YouTube video (https://www.youtube.com/watch?v=iPzPZTmUt1E) at 720p and going fullscreen for several seconds pushes the WindowServer process up to and slightly above 100%. I've noticed that in the newest release, it eventually resets whereas before I had to reboot my computer or kill the process in Activity Monitor to reset it.
Firefox version: Firefox 94.0.2 (64-bit)
Model Name: MacBook Pro
Model Identifier: MacBookPro18,3
Chip: Apple M1 Pro
Total Number of Cores: 8 (6 performance and 2 efficiency)
Memory: 16 GB
System Firmware Version: 7429.41.5
OS Loader Version: 7429.41.5
Also wanted to add that the Twitch player causes the bug as well. Unlike with YouTube, WindowServer doesn't seem to be going away on its own when caused by Twitch.
| Assignee | ||
Comment 59•4 years ago
|
||
(In reply to Pascal Chevrel:pascalc from comment #41)
Brad are you planning a fix in 96 that could be uplifted to beta or should we mark 95 as wontfix at this point of the release cycle?
We are not on track to have a fix for 95. I hope to have a solution in time for uplift to 96, but we're not there yet.
Comment 60•4 years ago
|
||
It's starting to look like this is a bug with certain video players going fullscreen. I'm noticing the same WindowServer service around 100% after using the PlayStation Remote Play app in fullscreen for a few minutes.
Comment 61•4 years ago
|
||
I also hit this on an M1 Pro machine on both 94.0.2 and Nightly 11-26.
However, the build in comment #55 seems to be working much better.
(Note though that this is an Intel-only build.)
Comment 62•4 years ago
|
||
I can confirm that the nightly build from #55 also seems to correct the issue on an intel based apple air.
While FF 94 trigger the problem constatntly whithin just a few minutes, the nightly build (FF96.0a1 21.nov) is behaving stable on the same set of full screen videos.
Comment 63•4 years ago
|
||
With build from #55 on a M1 Max with the video from #39 at 720p60 I see the following behaviour:
- With browser in window mode, windowserver stays at around 30% CPU.
- With browser in Fullscreen mode, or video in fullscreen mode, windowserver stays over 100% CPU, but reverts back to 30% CPU if reverted in window mode or closed.
To reiterate, the video causes windowserver to consume much larger CPU resources even if the video itself is not in fullscreen mode, but the browser is.
With Firefox 95.0b12 I have the same beaviour, except that the windowserver stays at 100% CPU even after the browser or video are not fullscreen anymore or even after Firefox is closed.
I think there is also a memory leak involved: when I found about the issue I had windowserver stuck at 100% CPU and consuming about 45GB of memory. Not sure how long it was stuck in that state though.
Comment 64•4 years ago
|
||
Interesting. With build from #55 on a 16" M1 Pro, OS 12.0.1, only built-in display, with the video from #39 at 720p60 I see the following behaviour:
- With browser in window mode and video playing, windowserver stays at around 22% CPU.
- With video playing in fullscreen mode, windowserver stays at around 15% CPU.
- With no video playing and only Firefox open, windowserver stays at about 3% CPU.
With both 94.0.2 and Nightly 11-26, I see windowserver at 100%, and it remains there even after quitting Firefox; a restart is required.
Note of course that other onscreen activity will also increase WindowServer usage. Christian, how are you logging the CPU usage in fullscreen mode? I used top -n4 > top.txt.
Comment 65•4 years ago
|
||
(In reply to Alexander from comment #64)
Note of course that other onscreen activity will also increase WindowServer usage. Christian, how are you logging the CPU usage in fullscreen mode? I used
top -n4 > top.txt.
I used a second display, but after your comment I quickly tested with only the built-in display and redirecting the output of top in background.
While the video was playing I had similar results as my original test: low CPU use in browser windowed mode, high CPU use in browser fullscreen mode. Without video activity, windowserver idles at under 3% CPU.
Differently from my original test, this time, I got windowserver stuck at 100% for many minutes after the test, which didn't happen with the nightly build last time I tested. I don't understand the reason for this difference. Windowserver did eventually revert to normal though.
| Assignee | ||
Comment 66•4 years ago
|
||
Nightly now contains the changes that were tested in the build in comment #55. That landed in Bug 1741982.
Comment 67•4 years ago
|
||
(In reply to Brad Werth [:bradwerth] from comment #66)
Nightly now contains the changes that were tested in the build in comment #55. That landed in Bug 1741982.
I tested with latest nightly (Build ID 20211129094259) and I still have issues as described in #63. Not sure how I can help with further testing.
Comment 68•4 years ago
|
||
That’s weird, it says that changeset landed in Nightly 11-25, but I had issues with Nightly 11-26. I’ll test the latest nightly again, but are you sure there were no other changes in that build?
| Assignee | ||
Comment 69•4 years ago
|
||
(In reply to Alexander from comment #68)
That’s weird, it says that changeset landed in Nightly 11-25, but I had issues with Nightly 11-26. I’ll test the latest nightly again, but are you sure there were no other changes in that build?
I'm not sure that the changes from Bug 1741982 solve this bug. I hope they will have a positive effect at least, and maybe narrow the cases where this bug occurs. I don't think any other video layer code landed around the same time.
Comment 70•4 years ago
|
||
Did some more tests and apparently on my end the screen refresh rate plays a role. I have the ProMotion option per default which seems to cause the high CPU issues when in Fullscreen, but when I set 60Hz instead the issue disappears. Did only some quick tests though.
Furthermore, in the last Nightly there is some issue with the video scaling when switching to Fullscreen. After switching to Fullscreen the video seems to be wrongly zoomed in. This issue is not present in the build from #55.
I made screenshots of the issue here: https://imgur.com/a/eMpO522
| Assignee | ||
Comment 71•4 years ago
|
||
(In reply to Christian from comment #70)
Furthermore, in the last Nightly there is some issue with the video scaling when switching to Fullscreen. After switching to Fullscreen the video seems to be wrongly zoomed in. This issue is not present in the build from #55.
I made screenshots of the issue here: https://imgur.com/a/eMpO522
I have opened Bug 1743474 on this issue.
Comment 72•4 years ago
|
||
I have a MacBook Pro 13-inch, 2018, with the following graphics card:
Intel Iris Plus Graphics 655:
Chipset Model: Intel Iris Plus Graphics 655
Type: GPU
Bus: Built-In
VRAM (Dynamic, Max): 1536 MB
Vendor: Intel
Device ID: 0x3ea5
Revision ID: 0x0001
Metal Family: Supported, Metal GPUFamily macOS 2
Displays:
Colour LCD:
Display Type: Built-In Retina LCD
Resolution: 2560x1600 Retina
Framebuffer Depth: 24-Bit Colour (ARGB8888)
Main Display: Yes
Mirror: Off
Online: Yes
Automatically Adjust Brightness: Yes
Connection Type: Internal
I ran the tests and couldn't see any surprising increase in CPU usage:
Windowed 1080p60: avg. 18% CPU (User)
Full-screen 1080p60: avg. 20% CPU (User)
Windowed 480p: avg. 10% CPU (User)
Full-screen 480p: avg. 11% CPU (User)
System usage in all cases: ~5%
Comment 73•4 years ago
|
||
I'm still seeing this issue in firefox nightly
i installed a clean install about 10 minutes before this post
i installed ublock origin
i logged into youtube and clicked on a 10 minute video
3-4 minutes into the video CPU usage spiked past 100% and stayed there.
Even after closing the video and waiting several minutes I still have north of 100% CPU usage on windowserver
The only workarounds I know about are forcequitting windowserver (forces you to log back in) or a hard reset.
This bug makes firefox unusable for me because if ever watch a video I need to regularly reboot my computer like it's the 90s again.
I did notice some improvement where after closing a video in nightly, after roughly 5-10 minutes CPU usage for windowserver goes back down to normal levels. On the regular builds it would never go back down unless I used one of the workarounds I mentioned.
Screenshots of system usage: https://imgur.com/a/xWtHqjn
Intel Iris Plus Graphics:
Chipset Model: Intel Iris Plus Graphics
Type: GPU
Bus: Built-In
VRAM (Dynamic, Max): 1536 MB
Vendor: Intel
Device ID: 0x8a53
Revision ID: 0x0007
Metal Family: Supported, Metal GPUFamily macOS 2
Displays:
Color LCD:
Display Type: Built-In Retina LCD
Resolution: 2560 x 1600 Retina
Framebuffer Depth: 30-Bit Color (ARGB2101010)
Main Display: Yes
Mirror: Off
Online: Yes
Automatically Adjust Brightness: Yes
Connection Type: Internal
Comment 74•4 years ago
|
||
I can confirm this bug on my MacBook Air (Retina, 13-inch, 2020, Intel, Monterey 12.0.1) on Firefox 94.0.2 and Chrome 96.0.4664.55. And I think this is an OS bug. For Chrome the problem is solved by disabling hardware acceleration
Comment 75•4 years ago
|
||
same problem on Macbook Air 13-inch, 2020 Intel Monterey 12.0.1 and Firefox 94.0.2
The Problem appeared with Monterey.
Comment 76•4 years ago
|
||
I can confirm that disabling hardware acceleration solved this completely for me.
Hope this helps other people in this thread.
I'm assuming that once the root cause is fixed we could turn hardware acceleration back on for better (?) overall performance.
Comment 77•4 years ago
|
||
On 16" M1 2021, ProMotion with or without acceleration still shows the issue. With the display set to 60Hz the issue disappears, with or without acceleration enabled.
Comment 78•4 years ago
|
||
(In reply to Hayk Saakian from comment #76)
I can confirm that disabling hardware acceleration solved this completely for me.
Hope this helps other people in this thread.
I'm assuming that once the root cause is fixed we could turn hardware acceleration back on for better (?) overall performance.
can't confirm that deactivating fixes the issue.
Comment 79•4 years ago
|
||
(In reply to dseinwill from comment #75)
same problem on Macbook Air 13-inch, 2020 Intel Monterey 12.0.1 and Firefox 94.0.2
The Problem appeared with Monterey.
the problem also happens with chrome 96.0.4664.55
Comment 80•4 years ago
|
||
On a 2020 Intel Mac Monterey 12.0.1 with Firefox 94.0.2, turning off hardware acceleration does not fix the problem.
Comment 81•4 years ago
|
||
Disabling ProMotion solves this issue for me (macbook pro 14" 2021, macos 12.0.1, Firefox 94.0.2). When playing a fullscreen youtube video WindowServer stays below 30% CPU.
Comment 82•4 years ago
|
||
I ran into the same problem with high CPU usage when playing videos. For me it started with the update (or shortly after) to Monterey about four weeks ago. To find the origin of the problem, macOS or Firefox, I have installed Catalina on an external drive where the current version of Firefox works perfectly fine (same settings). As of now, I have copied files and programs that I often use to the external drive, waiting for a fix on either macOS or Firefox, wherever the bug might be. Maybe that work around helps others.
I am using an i5 MacBook Air 2020
Comment 83•4 years ago
|
||
This issue appears to be corrected in Firefox 95. Example: https://www.youtube.com/watch?v=ab7NyKw0VYQ
2020 Macbook Air, Monterey 12.0.1
Comment 84•4 years ago
|
||
2020 Macbook Air and Monterey 12.0.1 - the problem still exists with firefox 95
Comment 85•4 years ago
|
||
Same here, problem still exists in 95...
But as I mentioned before, Firefox works perfectly fine on Catalina.
Comment 86•4 years ago
|
||
whatever safari is doing different - the problem only appears with firefox and chrome.
Comment 87•4 years ago
|
||
Beats me. The same two videos that caused this problem with Firefox 94 this morning do not cause it with Firefox 95. Nothing else changed. (FWIW release notes say it's fixed in 95.)
Comment 88•4 years ago
|
||
I think I found a much more acceptable work around than the one in comment #82. Instead of installing an old macOS, simply install the ESR version of Firefox. That seems to fix it for me. Hope that works for everyone.
Comment 89•4 years ago
|
||
Disabling ProMotion solves this issue for me (macbook pro 14" 2021, macos 12.0.1, Firefox 94.0.2). When playing a fullscreen youtube video WindowServer stays below 30% CPU.
Can confirm on M1 Max 16". Disabling promotion fixed high WindowServer CPU usage during playback and the lingering 100% CPU usage even after Firefox 95 is closed on MacOS 12.0.1.
| Assignee | ||
Comment 90•4 years ago
|
||
(In reply to nate from comment #89)
Disabling ProMotion solves this issue for me (macbook pro 14" 2021, macos 12.0.1, Firefox 94.0.2). When playing a fullscreen youtube video WindowServer stays below 30% CPU.
Can confirm on M1 Max 16". Disabling promotion fixed high
WindowServerCPU usage during playback and the lingering 100% CPU usage even after Firefox 95 is closed on MacOS 12.0.1.
Thanks for providing your findings for this issue. Our current hypothesis is that high refresh displays are causing this problem for us, and when we exhibit this issue, Chrome is also exhibiting the issue. Would you please re-enable ProMotion and check if the problem also happens for you in Chrome?
Comment 91•4 years ago
|
||
Not fixed with Monterey 12.1 unfortunately. Was hoping they'd sort it out.
Updated•4 years ago
|
Updated•4 years ago
|
Comment 92•4 years ago
|
||
It would /appear/ that this has been fixed in the latest Firefox beta (96.0). After using this version for a few days after switching back to ProMotion and watching various YouTube videos, haven't had a single instance of the WindowServer CPU issue.
Comment 93•4 years ago
|
||
(In reply to Joshua from comment #92)
It would /appear/ that this has been fixed in the latest Firefox beta (96.0). After using this version for a few days after switching back to ProMotion and watching various YouTube videos, haven't had a single instance of the WindowServer CPU issue.
The feature in question was disabled for release builds as of the latest Fx96 RC build (bug 1748221).
Comment 94•4 years ago
|
||
it seems the issue is really fixed with 96.0 beta. So far the problem did not reappear.
Comment 95•4 years ago
|
||
We ship release candidate builds to the beta channel. See comment 93.
| Assignee | ||
Comment 96•4 years ago
|
||
Updated•4 years ago
|
| Assignee | ||
Comment 97•4 years ago
|
||
The patch seems to work for me. Would you please use the test build and set the pref gfx.core-animation.specialize-video to true and test again?
Updated•4 years ago
|
| Reporter | ||
Comment 98•4 years ago
|
||
Unfortunately, I no longer have access to the hardware (MacBookPro16,2) where I experienced the issue, so I won't be able to test fixes anymore.
| Assignee | ||
Comment 99•4 years ago
|
||
simonk83, you've also confirmed this issue. Would you please try out the test build with the pref gfx.core-animation.specialize-video set to true and see if the problem is fixed for you?
Updated•4 years ago
|
Comment 100•4 years ago
|
||
(In reply to Brad Werth [:bradwerth] from comment #99)
simonk83, you've also confirmed this issue. Would you please try out the test build with the pref
gfx.core-animation.specialize-videoset to true and see if the problem is fixed for you?
Brad Werth, I downloaded 97.0b2 and made sure that gfx.core-animation.specialize-video is true but it appears the bug isn't fixed. WindowServer is now back to ~100%.
| Assignee | ||
Comment 101•4 years ago
|
||
(In reply to Joshua from comment #100)
Brad Werth, I downloaded 97.0b2 and made sure that gfx.core-animation.specialize-video is true but it appears the bug isn't fixed. WindowServer is now back to ~100%.
Thank you. Would you also please try with the test build? That is the build that may contain a fix.
Comment 102•4 years ago
|
||
(In reply to Brad Werth [:bradwerth] from comment #101)
(In reply to Joshua from comment #100)
Brad Werth, I downloaded 97.0b2 and made sure that gfx.core-animation.specialize-video is true but it appears the bug isn't fixed. WindowServer is now back to ~100%.
Thank you. Would you also please try with the test build? That is the build that may contain a fix.
Ah, perfect. Thanks for the clarification.
Downloaded that test build, switched back to ProMotion (I've been keeping it at 60 hertz since the beta doesn't have a fix yet), and tested a 4k 60fps video (https://www.youtube.com/watch?v=ib6_c6uliLg) for about three minutes and the WindowServer bug didn't pop up. I can do some more testing if you'd like, but it appears to be fixed in that test build.
| Assignee | ||
Comment 104•4 years ago
|
||
(In reply to Joshua from comment #102)
Downloaded that test build, switched back to ProMotion (I've been keeping it at 60 hertz since the beta doesn't have a fix yet), and tested a 4k 60fps video (https://www.youtube.com/watch?v=ib6_c6uliLg) for about three minutes and the WindowServer bug didn't pop up. I can do some more testing if you'd like, but it appears to be fixed in that test build.
Great news, and all we need. We can land this fix with confidence, now. Thank you. Firefox is a community project and we rely upon and appreciate users who find and help us fix bugs. Thank you.
Comment 105•4 years ago
|
||
Comment 106•4 years ago
|
||
| bugherder | ||
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Description
•