Closed Bug 1645579 Opened 5 years ago Closed 5 years ago

Bug 1622709 causes regression with certain videos flickering

Categories

(Core :: Graphics, defect)

77 Branch
Unspecified
macOS
defect

Tracking

()

VERIFIED FIXED
mozilla79
Tracking Status
firefox-esr68 --- unaffected
firefox77 --- wontfix
firefox78 --- verified
firefox79 --- verified

People

(Reporter: p_boelens, Assigned: sotaro)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:77.0) Gecko/20100101 Firefox/77.0

Steps to reproduce:

Watch a Youtube video. Not all videos show these symptoms, but here's one that does: https://www.youtube.com/watch?v=QImCld9YubE

Actual results:

The video stutters and flickers, seemingly showing frames out of order. Here's another, captured example: https://www.dropbox.com/s/vb00jnwv1rehh8f/ffstutter.mp4?dl=0

Expected results:

Video as smooth as butter.

OS: Unspecified → macOS
Regressed by: 1622709
Has Regression Range: --- → yes

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Component: Untriaged → Audio/Video: Playback
Product: Firefox → Core

To me this visually looks similar to the VAAPI stuttering:

(Jean-Yves Avenard [:jya] from bug 1619882 comment #74)

Do you have a video of what the jittering looks like? does it stutter or does it seems that some frames are painted out of order?

If the later, it could be the same issue we had on macOS when using global IOSurface.

The decoding is performed in the content process, into a global GPU surface that is then being transferred across the GPU process for rendering.

At one point in time, when the IOSurface was sent across IPC, the refcount was decreased, which caused the decoder to re-use the surface too early. So when rendered, it looked like they were out of order.

Flags: needinfo?(sotaro.ikeda.g)
Keywords: regression

I take a look.

Assignee: nobody → sotaro.ikeda.g
Flags: needinfo?(sotaro.ikeda.g)

(In reply to p_boelens from comment #0)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:77.0) Gecko/20100101 Firefox/77.0

Steps to reproduce:

Watch a Youtube video. Not all videos show these symptoms, but here's one that does: https://www.youtube.com/watch?v=QImCld9YubE
And

When I tried the Youtbe video, vp9 video was used at first. To prefer av1 video, I set the following as to prefer av1. And confirmed that av1 video was used. But I could not reproduce the problem on my Mac.

:darkspirit, can you reproduce the problem?

Flags: needinfo?(jan)

(In reply to p_boelens from comment #0)

Actual results:

The video stutters and flickers, seemingly showing frames out of order. Here's another, captured example: https://www.dropbox.com/s/vb00jnwv1rehh8f/ffstutter.mp4?dl=0

From the video, it seems that TextureClients/TextureHosts were recycled before end of their usage.

Component: Audio/Video: Playback → Graphics

p_boelens, thanks for the report! Can you upload about:support to this bug?

Flags: needinfo?(p_boelens)

One possibility is that DataTextureSource that was created by mProvider->CreateDataTextureSource was still in use by GPU.

(In reply to Sotaro Ikeda [:sotaro] from comment #5)

:darkspirit, can you reproduce the problem?

No, I watched the screencast and naively cited the comment I remembered because it looked so similar.

Flags: needinfo?(jan)

(In reply to Sotaro Ikeda [:sotaro] from comment #7)

p_boelens, thanks for the report! Can you upload about:support to this bug?

Of course, here you go: https://www.dropbox.com/s/tifmick99xuy90w/ffsupport.txt?dl=0

I'm in a rush right now, but will try setting the playback preference later. Thanks!

Flags: needinfo?(p_boelens)

(In reply to Sotaro Ikeda [:sotaro] from comment #4)

When I tried the Youtbe video, vp9 video was used at first. To prefer av1 video, I set the following as to prefer av1. And confirmed that av1 video was used. But I could not reproduce the problem on my Mac.

av1 video playback was necessary, since Bug 1622709 affects only to av1 video playback.

(In reply to p_boelens from comment #11)

(In reply to Sotaro Ikeda [:sotaro] from comment #7)

p_boelens, thanks for the report! Can you upload about:support to this bug?

Of course, here you go: https://www.dropbox.com/s/tifmick99xuy90w/ffsupport.txt?dl=0

Thank you. Form it, OpneGL compositor was used during the playback.

:p_boelens, can you also check if the problem happens with WebRender? WebRender could be enabled with pref "gfx.webrender.all" = true in about:config. And restarting Firefox. Then you could confirm that "Compositing: WebRender" in about:support.

Flags: needinfo?(p_boelens)

(In reply to Sotaro Ikeda [:sotaro] from comment #13)

(In reply to p_boelens from comment #11)

(In reply to Sotaro Ikeda [:sotaro] from comment #7)

p_boelens, thanks for the report! Can you upload about:support to this bug?

Of course, here you go: https://www.dropbox.com/s/tifmick99xuy90w/ffsupport.txt?dl=0

Thank you. Form it, OpneGL compositor was used during the playback.

:p_boelens, can you also check if the problem happens with WebRender? WebRender could be enabled with pref "gfx.webrender.all" = true in about:config. And restarting Firefox. Then you could confirm that "Compositing: WebRender" in about:support.

I can confirm this fixes the issue in both affected videos. I tested various resolutions and fps; all seem to work as expected. :)

Is there any downside to keeping this flag on?

Flags: needinfo?(p_boelens)

Great thank you! WebRender is not released yet on MacOS. There are still several bugs(Bug 1479789).

:mstange, do you know about current status of WebRender on MacOS?

Flags: needinfo?(mstange.moz)

We're actively working on getting it ready to be turned on by default. We'll probably do a temporary "on by default" run on Nightly this or next week.

Flags: needinfo?(mstange.moz)
Attachment #9156628 - Attachment description: Bug 1645579 - Disable RecycleAllocator for RDD process on Mac → Bug 1645579 - Disable RecycleAllocator for RDD process when WebRender is disabled on Mac
Pushed by sikeda.birchill@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/ec0a38a73784 Disable RecycleAllocator for RDD process when WebRender is disabled on Mac r=nical
Status: UNCONFIRMED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla79

Is this safe enough to uplift to 78 or should we let it ride to 79?

Flags: needinfo?(sotaro.ikeda.g)

Comment on attachment 9156628 [details]
Bug 1645579 - Disable RecycleAllocator for RDD process when WebRender is disabled on Mac

Beta/Release Uplift Approval Request

  • User impact if declined: av1 video playback cause flickering on some MacOS PCs.
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: no
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): The patch just disables TextureClient recycling. It reverts before Bug 1622709 fix.
  • String changes made/needed: none
Flags: needinfo?(sotaro.ikeda.g)
Attachment #9156628 - Flags: approval-mozilla-beta?

Comment on attachment 9156628 [details]
Bug 1645579 - Disable RecycleAllocator for RDD process when WebRender is disabled on Mac

approved for 78.0b9

Attachment #9156628 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Flags: qe-verify+
QA Whiteboard: [qa-triaged]

I tried to verify this fix, but unfortunately, I could not reproduce the initial issue. I tried on my Mac OS X 10.14 and Mac OS X 10.15 using the latest Firefox release (77.0.1) and Nightly version 79.0.a1 (from June 1st).

p_boelens, could you please confirm that this issue is fixed on your end, on the latest Firefox 78 beta and latest Nightly 79, and let us know?

Here are the links from where you can download and install the latest versions:
http://archive.mozilla.org/pub/firefox/releases/78.0b9/mac/en-US/
http://archive.mozilla.org/pub/firefox/nightly/latest-mozilla-central/firefox-79.0a1.en-US.mac.dmg

Thanks!

Flags: needinfo?(p_boelens)

(In reply to Simona Badau from comment #23)

I tried to verify this fix, but unfortunately, I could not reproduce the initial issue. I tried on my Mac OS X 10.14 and Mac OS X 10.15 using the latest Firefox release (77.0.1) and Nightly version 79.0.a1 (from June 1st).

p_boelens, could you please confirm that this issue is fixed on your end, on the latest Firefox 78 beta and latest Nightly 79, and let us know?

Here are the links from where you can download and install the latest versions:
http://archive.mozilla.org/pub/firefox/releases/78.0b9/mac/en-US/
http://archive.mozilla.org/pub/firefox/nightly/latest-mozilla-central/firefox-79.0a1.en-US.mac.dmg

Thanks!

I'm on MacOS 10.13.6 myself, and can confirm the fix works on both versions! :)

Flags: needinfo?(p_boelens)

Thanks, p-boelens!

Based on Comment 24, setting the tracking flags for firefox78 and firefox79 to verified!

Status: RESOLVED → VERIFIED
QA Whiteboard: [qa-triaged]
Flags: qe-verify+

Hi. We're doing expansive changes on our video decoding infrastructure and in particular the AV1 decoder.

Would it be possible for you to check if you are still experiencing the symptoms you reported here with this build:
https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/TWnMVX3qQPmZ6Ka0DxtqOg/runs/0/artifacts/public/build/target.dmg

You will need to disable webrender by setting the preference gfx.webrender.force-disabled to true and restarting.

In this build, I re-enabled a feature the fix for this bug disabled, and unfortunately that fix has unfortunate consequences performance wise.

Thank you.

:sotaro, could you reproduce the issue before? if so could you test it again with this build?

thank you

Flags: needinfo?(p_boelens)
Flags: needinfo?(sotaro.ikeda.g)

(In reply to Jean-Yves Avenard [:jya] from comment #26)

Hi. We're doing expansive changes on our video decoding infrastructure and in particular the AV1 decoder.

Would it be possible for you to check if you are still experiencing the symptoms you reported here with this build:
https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/TWnMVX3qQPmZ6Ka0DxtqOg/runs/0/artifacts/public/build/target.dmg

You will need to disable webrender by setting the preference gfx.webrender.force-disabled to true and restarting.

In this build, I re-enabled a feature the fix for this bug disabled, and unfortunately that fix has unfortunate consequences performance wise.

Thank you.

:sotaro, could you reproduce the issue before? if so could you test it again with this build?

In the past when I tried, I failed to reproduce the flickering as Comment 4. But This time I could reproduce the problem with the target.dmg.
For me, it was easier to re-produce the flickering with https://www.youtube.com/watch?v=9jZ01i92JI8 with forcing av1 on youtube 1080p60.

Flags: needinfo?(sotaro.ikeda.g)

(In reply to Jean-Yves Avenard [:jya] from comment #26)

Hi. We're doing expansive changes on our video decoding infrastructure and in particular the AV1 decoder.

Would it be possible for you to check if you are still experiencing the symptoms you reported here with this build:
https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/TWnMVX3qQPmZ6Ka0DxtqOg/runs/0/artifacts/public/build/target.dmg

You will need to disable webrender by setting the preference gfx.webrender.force-disabled to true and restarting.

In this build, I re-enabled a feature the fix for this bug disabled, and unfortunately that fix has unfortunate consequences performance wise.

Thank you.

:sotaro, could you reproduce the issue before? if so could you test it again with this build?

thank you

I can confirm Sotaro's findings; the flickering returned on my end as well.

Flags: needinfo?(p_boelens)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: