Closed Bug 1763781 Opened 3 years ago Closed 3 years ago

macOS HDR VP9 video playback should work without a hardware VP9 decoder

Categories

(Core :: Graphics, defect)

Desktop
macOS
defect

Tracking

()

VERIFIED FIXED
101 Branch
Tracking Status
firefox99 --- disabled
firefox100 + verified
firefox101 --- verified

People

(Reporter: ailea, Assigned: bradwerth)

References

(Blocks 1 open bug)

Details

Attachments

(4 files)

Affected Versions:

Nightly 101.0a1, Beta 100.0b3 (this feature was implemented in Fx100, in Release 99 it is disabled).

Tested on:

macOS 10.14.4 (iMac Retina 4k, 2019)
macOS 10.15.5 (MacBook Pro, 2017)

Preconditions:

Access: https://drive.google.com/drive/u/0/folders/1S-E4WeKO6y6UySHnSWvfAuCB7N6URdCj and download the files locally on your computer.

Steps to reproduce:

  1. Launch Firefox.
  2. Open a new tab and drag&drop any video saved in preconditions, from the computer to FF window.
  3. Play the video.

Expected Results:

The video should play in HDR.

Actual Results:

The video is not playing in HDR mode.

Notes:

  1. The same videos are playing in HDR accordingly on macOS 12, using the same iMac.
  2. The same videos are properly displayed in HDR on Chrome, using the same iMac for 10.14 and the same MacBook for 10.15.
  3. This could be S3-S4 severity for the browser, but S1-S2 for the feature, since it doesn't work at all on the mentioned OS-es.
Summary: HDR video playback support does not work on macOS 10.14 → HDR video playback support does not work on macOS 10.14 and 10.15
Has STR: --- → yes
Assignee: nobody → bwerth

I've setup a machine with macOS 10.14 and I can reproduce this result. I need to setup that machine with a full development environment so I can debug the problem more thoroughly.

Alin, I just found Apple's notes on HDR and it seems like they might have started support in macOS 10.15.4. I am still preparing a test machine, but I just wanted to check if your 10.15 testing was using version 10.15.4 or greater.

Flags: needinfo?(alin.ilea)

I am testing now on macOS 10.15.7 and can still reproduce the issue. Once this Bug is fixed, re-testing will show the boundaries of macOS HDR support.

Flags: needinfo?(alin.ilea)

Hmm... the AppleDecoderModule only claims to support VP9 when we can ensure it's hardware accelerated, which we can only do in macOS 11+. I'll see if we can relax this and use a software decode path if that's all we can get.

Relying on the FFmpegVideoDecoder may be possible, if we avoid the shared memory path and include the fixes from Bug 1763782.

See Also: → 1763782

This change ensures that macOS will correctly detect the surface as a video
and use an HDR-capable display layer. Unfortunately, it invokes a slower code
path for this case. Bug 1765388 may restore this fast path for HDR video.

See Also: → 1765388
Blocks: 1765138
No longer blocks: 1765138
Pushed by bwerth@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/cdb79df7a017 Part 1: Force FFmpegVideoDecoder to use MacIOSurfaceImage for HDR video. r=media-playback-reviewers,alwu

Backed out changeset cdb79df7a017 (Bug 1763781) for causing wpt failures on canvas-display-p3-drawImage-ImageBitmap-video.html.
Backout link
Push with failures - wpt1
Failure Log

Flags: needinfo?(bwerth)
Summary: HDR video playback support does not work on macOS 10.14 and 10.15 → HDR VP9 video playback support does not work on macOS 10.14 and 10.15
Attachment #9273150 - Attachment description: WIP: Bug 1763781 Part 2: Update test expectations. → Bug 1763781 Part 2: Update test expectations.

I'm having trouble with the landing. I'm going to rebase the patches and try again.

Pushed by bwerth@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/98fd39c96de8 Part 1: Force FFmpegVideoDecoder to use MacIOSurfaceImage for HDR video. r=media-playback-reviewers,alwu https://hg.mozilla.org/integration/autoland/rev/3b1422986294 Part 2: Update test expectations. r=jgilbert
Pushed by bwerth@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e0c5508d662d Part 1: Force FFmpegVideoDecoder to use MacIOSurfaceImage for HDR video. r=media-playback-reviewers,alwu https://hg.mozilla.org/integration/autoland/rev/ed2a721a38c5 Part 2: Update test expectations. r=jgilbert
Blocks: 1766292
Pushed by bwerth@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/41028dee28a0 Part 1: Force FFmpegVideoDecoder to use MacIOSurfaceImage for HDR video. r=media-playback-reviewers,alwu https://hg.mozilla.org/integration/autoland/rev/3a6dbb3555cb Part 2: Update test expectations. r=jgilbert
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 101 Branch
Flags: needinfo?(bwerth)

Comment on attachment 9272887 [details]
Bug 1763781 Part 1: Force FFmpegVideoDecoder to use MacIOSurfaceImage for HDR video.

Beta/Release Uplift Approval Request

  • User impact if declined: macOS users with older hardware (2015) and HDR-capable screens, running macOS 11+ will have bad visuals with HDR video from YouTube
  • Is this code covered by automated tests?: Yes
  • 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: Medium
  • Why is the change risky/not risky? (and alternatives if risky): We are very late in the Release Candidate. The patch introduces an additional copy of frame data for the affected case, which might affect playback performance of high-resolution, high FPS video.
  • String changes made/needed:
  • Is Android affected?: No
Attachment #9272887 - Flags: approval-mozilla-release?
Attachment #9273150 - Flags: approval-mozilla-release?

Patch https://phabricator.services.mozilla.com/D144228 doesnt graft cleanly on release.
Conflict while merging testing/web-platform/meta/html/canvas/element/manual/wide-gamut-canvas/canvas-display-p3-drawImage-video.html.ini

Flags: needinfo?(bwerth)

(In reply to Dianna Smith [:diannaS] from comment #18)

Patch https://phabricator.services.mozilla.com/D144228 doesnt graft cleanly on release.
Conflict while merging testing/web-platform/meta/html/canvas/element/manual/wide-gamut-canvas/canvas-display-p3-drawImage-video.html.ini

Those test expectations were also affected by another recent landing -- which we don't want to uplift. If we will consider just landing D144039 and omitting the test expectations, the merge will work.

Flags: needinfo?(bwerth)

Comment on attachment 9272887 [details]
Bug 1763781 Part 1: Force FFmpegVideoDecoder to use MacIOSurfaceImage for HDR video.

Approved for 100.0rc2

Attachment #9272887 - Flags: approval-mozilla-release? → approval-mozilla-release+
Attachment #9273150 - Flags: approval-mozilla-release? → approval-mozilla-release-

This is a modified version of D144228 that should merge to the Fx100 RC2.

This gives us better correctness for 10-bit vp9 reftests. In the WPTs, we
turn off some tests on macos because of the difficulty that our
screenshots have in analyzing srgb image data. It seems to consistently
report 191,255,191,73 when we are expecting 255,0,0,255.

Attachment #9274109 - Attachment description: WIP: Bug 1763781: Fx100 RC2 Update test expectations. → Bug 1763781: Fx100 RC2 Update test expectations.

Comment on attachment 9274109 [details]
Bug 1763781: Fx100 RC2 Update test expectations.

Beta/Release Uplift Approval Request

  • User impact if declined: It will be impossible to merge Part 1, D144039, to Fx100 RC2.
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: No
  • Needs manual test from QE?: Yes
  • 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): Fixes merge problems with test expectations that work in central.
  • String changes made/needed:
  • Is Android affected?: No
Attachment #9274109 - Flags: approval-mozilla-release?

Comment on attachment 9274109 [details]
Bug 1763781: Fx100 RC2 Update test expectations.

Approved for 100.0rc2

Attachment #9274109 - Flags: approval-mozilla-release? → approval-mozilla-release+

Hi,
In my attempt to verify this fix, I noticed that I can still reproduce the issue using macOS 10.14.4 (the same machine from the description). The videos are indeed rendered in HDR on macOS 10.15.6, but not on 10.14. Tested in the latest Nightly 101.0a1 (2022-04-28) and latest fx100.0 (build id: 20220425210429)

Flags: needinfo?(bwerth)

I will investigate. I was not able to get a 10.14 machine setup with a development environment -- our build system essentially requires a 10.15+ machine to work. So I can downgrade my machine to 10.14 for testing, but my ability to debug on that machine is limited. My plan is to land Bug 1766343, which will make our gfx.core-animation.specialize-video.log logging more informative in this situation, and use that as the basis of the debugging effort.

Since this Bug has landed and has been uplifted around quite a bit, solving more problems than just the 10.15 compatibility issue, I'll open a new Bug for this remaining issue.

Flags: needinfo?(bwerth)
Summary: HDR VP9 video playback support does not work on macOS 10.14 and 10.15 → macOS HDR VP9 video playback should work without a hardware VP9 decoder
Blocks: 1766879
See Also: → 1766879

It makes sense.
I can confirm that the issue is fixed in the latest Nightly 101.0a1 (2022-04-29) and Beta 100.0 (build id: 20220428192727) using macOS 10.15.6.
Will follow up with macOS 10.14 verification once bug 1766879 will be fixed.
Thanks!

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

Attachment

General

Created:
Updated:
Size: