Closed Bug 1737998 Opened 3 years ago Closed 3 years ago

The browser hangs and locks the system when choosing a very high quality video and going full screen

Categories

(Core :: Audio/Video, defect, P1)

Desktop
macOS
defect

Tracking

()

VERIFIED FIXED
95 Branch
Tracking Status
relnote-firefox --- 94+
firefox-esr78 --- unaffected
firefox-esr91 --- unaffected
firefox93 --- unaffected
firefox94 blocking verified
firefox95 + verified

People

(Reporter: danibodea, Assigned: bradwerth)

References

Details

Attachments

(2 files, 1 obsolete file)

Note

  • When the user loads a youtube high-definition video (4k), selects the best video quality, and goes into full screen, he will notice that the video is not displayed and the browser freezes. Moreover, the system is frozen as the user cannot exit this state unless restarting the whole system.

Affected versions

  • Nightly v95.0a1 from 2021-10-25 (affected)
  • Nightly v95.0a1 from 2021-10-18 (unaffected)

Affected platforms

  • Mac OS 10.12 (affected) ONLY
  • Mac OS 10.13 (unafected)

Steps to reproduce

  1. Launch browser.
  2. Load any of the links:
    https://www.youtube.com/watch?v=Ppz41EmaJyU
    https://www.youtube.com/watch?v=s6zR2T9vn2c
    https://www.youtube.com/watch?v=nRt4Duf7GoI
  3. Select the highest video quality (4k/5k)
  4. Put the video in full screen.

Expected result

  • The video is properly played on full screen.

Actual result

  • A black screen is displayed; the user cannot exit this state, only system restart. (CMD+OPT+ESC hotkey also not usable).

Regression range

  • Appears to be a regression, but I can't properly confirm it considering the actual results (system hang state) and the fact that mozregression does not run on this system.

Additional notes
This issue also reproduces after turning off the feature (security.sandbox.content.mac.disconnect-windowserver = false + restart), but it does not occur on a build right before the feature is pushed to nightly (2021-10-18).

  • I have assumed that this bug is related to the new sandbox implementation! Please change it if you believe otherwise and let me know if there's more testing I can help with.

Using another set of steps:

  1. Launch browser.
  2. Load the twitch main page:
    https://www.twitch.com
  3. Put the autoplayed video in full screen.
    Expected result:
    The video is properly played on full screen.
    Actual result:
    A black screen is displayed; the user cannot exit this state, only system restart. (CMD+OPT+ESC hotkey also not usable).

This issue was reproduced on a build that does not have the new sandbox feature (18-10-2021).
This being said, we can safely assume that this issue is not related to the sandbox implementation.

No longer blocks: 1467758
Component: Security: Process Sandboxing → Audio/Video

Brad, this sounds like it might be related to the video layering changes. :danibodea confirmed this is only reproducible on 10.12.

I've asked :danibodea to check if the problem is reproducible with layers.iosurfaceimage.use-nv12=false.

Flags: needinfo?(daniel.bodea)
Flags: needinfo?(bwerth)

After having requested to test with the layers.iosurfaceimage.use-nv12=false, it appeare that the issue no longer reproduces.

Steps to reproduce

  1. Launch browser.
  2. go to about config
  3. Flip layers.iosurfaceimage.use-nv12 pref to FALSE.
  4. Load any of the links:
    https://www.youtube.com/watch?v=Ppz41EmaJyU
    https://www.youtube.com/watch?v=s6zR2T9vn2c
    https://www.youtube.com/watch?v=nRt4Duf7GoI
  5. Select the highest video quality (4k/5k)
  6. Put the video in full screen.
    Expected result
  • The video is properly played on full screen.
    Actual result
  • The video is properly played on full screen.
Flags: needinfo?(daniel.bodea)
Blocks: 1733499
Blocks: 1653417
No longer blocks: 1733499

Are we 100% certain that 94 isn't affected here?

Flags: needinfo?(daniel.bodea)

(In reply to Ryan VanderMeulen [:RyanVM] from comment #4)

Are we 100% certain that 94 isn't affected here?

Confirmed over Slack that the 94 RC build is not affected.

Flags: needinfo?(daniel.bodea)

I'll attempt to reproduce.

Assignee: nobody → bwerth
Status: NEW → ASSIGNED

(In reply to Brad Werth [:bradwerth] from comment #6)

I'll attempt to reproduce.

Without an easy way to access a 10.12 device, I can't reproduce. This patch should solve the issue as reported.

Flags: needinfo?(bwerth)
Attachment #9248118 - Attachment is obsolete: true
Pushed by bwerth@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/7e0fe1468a55
Prevent macOS 10.12 from using specialized video layers. r=mstange

Was Twitch checked in the 94 RC build? YouTube usually doesn't get detached mode in 94 because bug 1736672 is not in 94. However, Twitch uses H264 and so will likely be getting detached mode in 94 and be unaffected by the layers.iosurfaceimage.use-nv12 pref. If Twitch hangs in Nightly, I don't know why it wouldn't hang in 94.

Flags: needinfo?(daniel.bodea)

Markus confirmed that Twitch black screens and hangs the machine in 94

Comment on attachment 9248318 [details]
Bug 1737998: Prevent macOS 10.12 from using specialized video layers.

Beta/Release Uplift Approval Request

  • User impact if declined: Machine hangs in fullscreen on Twitch on 10.12
  • Is this code covered by automated tests?: No
  • Has the fix been verified in Nightly?: No
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Very low risk as it just adds a 10.12 version check.
  • String changes made/needed:
Attachment #9248318 - Flags: approval-mozilla-release?

The surrounding code looks a little different on 94 because 94 doesn't have bug 1736446 or bug 1731956, but the same way of fixing it would work on 94 too.

Somehow this seems to be related to the fade-to-black effect from non-native fullscreen. If I enable native fullscreen by setting full-screen-api.macos-native-full-screen to true, the hang and the black screen issue do not happen, and the video plays normally and achieves detachment successfully.

I have downloaded the autoland build with this patch from treeherder and confirmed that it fixes the problem on 10.12.

Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 95 Branch

I have verified the fix in the latest Nightly v95.0a1 on Mac OS 10.12.
The browser will no longer cause a black screen/system hang.
The originally reported issue never occurred on Beta v94.

The graphical performance issue is a separate issue. It appears that Release 93 plays high-definition videos considerably better than Beta 94 and Nightly 95. Should I log another bug or maybe there is one logged already?

Status: RESOLVED → VERIFIED
Flags: needinfo?(daniel.bodea) → needinfo?(bwerth)

(In reply to Bodea Daniel [:danibodea] from comment #18)

I have verified the fix in the latest Nightly v95.0a1 on Mac OS 10.12.
The browser will no longer cause a black screen/system hang.
The originally reported issue never occurred on Beta v94.

The steps for reproducing using Twitch in comment 1 don't reproduce the problem for you in the 94 rc? They do reproduce the problem for mstange.

The graphical performance issue is a separate issue. It appears that Release 93 plays high-definition videos considerably better than Beta 94 and Nightly 95. Should I log another bug or maybe there is one logged already?

Please log another bug for that.

Flags: needinfo?(daniel.bodea)

I have retested the supposed performance issue on MacMini (Mid 2011) and MacBook Air (Mid 2013). FYI, hardware-wise.
I have compared the MacOS 10.12 (MacMini) vs MacOS 10.13 (MacMini) vs 11.6 (MacBook Air).

All channels (Nightly v95.0a1, Beta v94.0, Release v93.0, ESR v91.2.0esr) across each platform perform the same under the same stress:

  • Twitch:
    -720p60 ok
    -1080p60 not ok (MacBook Air with MacOS 11 performed better here since it has a beter graphics card)

  • Youtube:
    -1440p (2k) ok
    -2160p (4k) barely (MacBook Air with MacOS 11 performed better here since it has a beter graphics card)
    -2880p (5k) not ok

This being considered, there is no recent regression observable on these systems.
It was my mistake to mention it in comment18, might have tested with lower vdeo quality (720p60)

Jeff, if you managed to reproduce the original issue in a Beta94 on your MacOS 10.12 system, then you should set the flag as affected, however, the original issue (black screen and full system freeze) did not reproduce in Beta 94 on my system. Can you clear this up?

Flags: needinfo?(daniel.bodea) → needinfo?(jmuizelaar)

Daniel, since you were only able to reproduce the Twitch issue in 95 can you get a rough regression window for when it was introduced there? Does it match these same dates?

  • Nightly v95.0a1 from 2021-10-25 (affected)
  • Nightly v95.0a1 from 2021-10-18 (unaffected)

Can you also check which codec Twitch is giving you? From the video controls: Settings -> Advanced -> Video stats and then look at the "Codecs" line.

Flags: needinfo?(jmuizelaar) → needinfo?(daniel.bodea)

After testing with 1080p60 random videos from, twitch, I've got these results:

  • 95.0a1 (2021-10-01) (64-bit) - full system hang
  • 95.0a1 (2021-10-05) (64-bit) - full system hang
  • 95.0a1 (2021-10-10) (64-bit) - full system hang
  • 95.0a1 (2021-10-18) (64-bit) - full system hang
  • 95.0a1 (2021-10-19) (64-bit) - full system hang
    In conclusion, it occurs even before the adition (/implermentation?) of the layers.iosurfaceimage.use-nv12 pref.
    Also, the initial regression range provided is incorrect because the issue appears to be intermitent.
    Considering this regression invetigation takes so long, I'll post this now and come back later with more info on the intruduction of this issue.

To answert the other question, it appears that the 1080p60 video quality uses a different codec than the rest of the quality options:
1080p60 - avc1.64002A,mp4a.40.2
720p60 - avc1.4D401F,mp4a.40.2
720p - avc1.4D401F,mp4a.40.2
480p - avc1.4D401F,mp4a.40.2
360p - avc1.4D401F,mp4a.40.2
160p - avc1.4D401F,mp4a.40.2

Flags: needinfo?(daniel.bodea)
Flags: needinfo?(bwerth)

I have manually investigated for the introduction of the issue and these are my results:
First bad build: Nightly 20210922094736
Last good build: Nightly 20210921190609

All test results:
94.0a1 2021-09-20 - DOES NOT REPRO
20210921190609 - DOES NOT REPRO
20210922094736 - REPRO!
20210922215301 - REPRO!
94.0a1 2021-09-25 - REPRO!
94.0a1 2021-09-30 - REPRO!

Furthermore, I managed to reproduce it in Beta v94.0b9 and v94.0 RC, but with live Twitch 1080p60 video. It appears to ONLY reproduce with this.
I reconfirmed that it does not occur in Release v93.0 and Nightly v95.0a1, after the "fix".
Reopening for reproduction in Beta94.

Status: VERIFIED → REOPENED
Resolution: FIXED → ---

Ok, great. I'm sure it was painful to get that range.

It's close enough to the landing of bug 1653417 that it feels like we can probably just assign blame there.

(In reply to Bodea Daniel [:danibodea] from comment #23)

Reopening for reproduction in Beta94.

The status for 94 is set to affected to reflect that. Bug resolution tracks what landed on mozilla-central. Re-closing since it was confirmed that the patch landed here took care of the problem for 95+.

Status: REOPENED → RESOLVED
Closed: 3 years ago3 years ago
Resolution: --- → FIXED
Severity: S2 → S1
Priority: -- → P1

Comment on attachment 9248318 [details]
Bug 1737998: Prevent macOS 10.12 from using specialized video layers.

Approved for 94.0.1.

Attachment #9248318 - Flags: approval-mozilla-release? → approval-mozilla-release+
Attachment #9248318 - Flags: approval-mozilla-release+
Attachment #9248364 - Attachment is patch: true
Attachment #9248364 - Flags: approval-mozilla-release+

Added to the Fx 94.0.1 relnotes:

Fixed browser hangs when viewing fullscreen videos on macOS 10.12

Hello! Reproduced the initial issue on macOS 10.12 with Firefox 95.0a1 (20211025214106) on Twitch 1080p@60 and 4k Youtube fullscreen videos. Also, I reproduced the issue on 94.0 with Twitch 1080p@60 fullscreen videos.
I can no longer reproduce the issue with 94.0.1 (20211103134640) on macOS 10.12.6 by accessing random Twitch 1080p@60 videos and entering/exiting fullscreen multiple times. Also, I tested the issue on Youtube comment 0 links with 4k/5k fullscreen videos and the issue is not reproducible.

Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: