Closed Bug 1846165 Opened 2 years ago Closed 1 years ago

Slow swapchain mechanism added in bug 1818685 appears to need additional unexpected steps to trigger (e.g. opening a new tab OR seeking+buffering the current stream)

Categories

(Core :: Graphics, defect)

defect

Tracking

()

RESOLVED FIXED
119 Branch
Tracking Status
firefox119 --- fixed

People

(Reporter: mayankleoboy1, Assigned: sotaro)

References

(Blocks 1 open bug, )

Details

Attachments

(3 files)

Part1:
0. Copy all of these STR in some text file or something

  1. Close ALL firefox tabs and windows
  2. Open Firefox (ensure that there is only a singel blank/new tab opened)
  3. Go to the youtube URL https://www.youtube.com/watch?v=ovSy6KQC9Xk
  4. Seek the video to somewhere around the middle and ensure you have 720p50 resolution selected
  5. Click play
  6. While the video is playing, try to scroll the page

AR: Stuttery video. In about:support no gfx log is generated. (i.e. the mechanism added in bug 1818685 doesnt appear to kick in).

Part2:
7. Now open a new tab and go to google.com
8. Switch back to the youtube page and try to scroll now
AR: The video is smooth. And in about:support, there is a gfx log that says that swapchain is slow.

Alternate Part2:

  1. Seek the video to a place such that the video stream needs to load from network/buffer
  2. Now play the video and scroll the page
    AR: The video is smooth. And in about:support, there is a gfx log that says that swapchain is slow.
Flags: needinfo?(sotaro.ikeda.g)
See Also: → 1842253, 1818685
Summary: Slow swapchain mechanism added in bug 1818685 doesnt seem to get triggered unless you open a second tab → Slow swapchain mechanism added in bug 1818685 appears to need additional unexpected steps to trigger (e.g. opening a new tab OR seeking+buffering)
Summary: Slow swapchain mechanism added in bug 1818685 appears to need additional unexpected steps to trigger (e.g. opening a new tab OR seeking+buffering) → Slow swapchain mechanism added in bug 1818685 appears to need additional unexpected steps to trigger (e.g. opening a new tab OR seeking+buffering the current stream)

(In reply to Mayank Bansal from comment #1)

Profile: https://share.firefox.dev/3DASLI8

The wait happened at DCLayerTree::CompositorEndFrame() instead of mVideoSwapChain->Present(0, 0). It seems better to handle it.

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

another profile : https://share.firefox.dev/3EkNdSB

  1. Here i opened the youtube video in a tab and scrolled for a bit -> the scrolling was janky and "slow swapchain" message in gfx-log was NOT generated.
  2. Then I opened google.com in a new tab.
  3. Switched back to the youtube video and scrolled again -> Scrolling was smooth and "slow swapchain" message in gfx-log was generated.

Check of mVideoSwapChain->Present() was already added by Bug 1818685. This change adds check of mCompositionDevice->Commit().

Flags: needinfo?(mayankleoboy1)

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

Hi Mayank Bansal, can you check if the following build addresses the problem for you?
https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/YRU3Ih0IRmiMXIT4MkHylQ/runs/0/artifacts/public%2Fbuild%2Ftarget.zip

https://treeherder.mozilla.org/jobs?repo=try&selectedTaskRun=YRU3Ih0IRmiMXIT4MkHylQ.0&revision=68d8b14d55b1f8cf290cd9a60aec927a5d4c5ffe

This did not help.
While i was on the youtube tab, the video continued to stutter while scrolling. The stuttering stopped only after I switched to a new tab (e.g. about:support) , then switched back to youtube.

Profile: Profile: https://share.firefox.dev/3P3B2zG

Flags: needinfo?(mayankleoboy1) → needinfo?(sotaro.ikeda.g)

I tried a couple of more times with the try build.

In one instance, the video became smooth almost instantly.
In another instance, the video became smooth after I scrolled couple of times : https://share.firefox.dev/3QLiSDX

So I am confused with the behaviour.

Ah, the current patch has a problem. Video frames are not always updated with each frame. It is not handled by the patch. I am going to update it.

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

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

Hi Mayank Bansal, can you check again if the following build addresses the problem for you?
https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/VvoIELZpTiKJXKd3ysq56A/runs/0/artifacts/public%2Fbuild%2Ftarget.zip

This build looks to have fixed this bug! Cant repro the stutter on scrolling anymore. I did not see any message in gfx-log but maybe thats expected?
I also tried with maximizing the video and then trying to scroll. The scrolling stuttered but then the slow swapchain mechanism kicked-in and the scrolling became smooth again.

https://share.firefox.dev/44jFJJR , https://share.firefox.dev/3sqn7KS

Flags: needinfo?(mayankleoboy1) → needinfo?(sotaro.ikeda.g)

Hmm, when I played YouTube videos, overlay was used only during fullscreen video playback. It seems like a recent regression. I created Bug 1849680.

Flags: needinfo?(sotaro.ikeda.g)
Depends on: 1849680

When I tested today, video rendering used overlay.
https://www.youtube.com/watch?v=zCLOJ9j1k2Y

Flags: needinfo?(mayankleoboy1)

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

Hi Mayank Bansal, can you check again if the following build addresses the problem for you? It seemed that yesterday m-c had a problem.

https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/Yxmu2njHQd-ZTYzKENYGrQ/runs/0/artifacts/public%2Fbuild%2Ftarget.zip
https://treeherder.mozilla.org/jobs?repo=try&revision=9ab8fba8d58d67c0fccb08f0f8f7b039369fe1ac

Similar behaviour as the previous testing :

With video in normal playing mode, the scrolling is smooth and no gfx-log is generated. When I use theater mode, the scrolling stutters for a bit and then becomes smooth and then the gfx-log is generated.

https://share.firefox.dev/47Gv0Mx , https://share.firefox.dev/3Z1uzst , https://share.firefox.dev/3P6FqxA

Flags: needinfo?(mayankleoboy1) → needinfo?(sotaro.ikeda.g)

The patch seems not have a problem, though gecko still seems to have the problem for using overlay.

Flags: needinfo?(sotaro.ikeda.g)

I am curious how this bug relates to https://bugzilla.mozilla.org/show_bug.cgi?id=1820370 where I have profiled on all GPU vendors and seen skipped composites and hitting limits on pending video frames on a recurring basis, and also jank (up to 200ms) when the driver frees up large amounts of resources periodically (why it is not doing that every frame is unclear to me). I am wondering if we're not dequeuing something properly?

Flags: needinfo?(sotaro.ikeda.g)
Blocks: 1769643

(In reply to Ashley Hale [:ahale] from comment #18)

I am wondering if we're not dequeuing something properly?

Sorry, I am not sure if there is a missing dequeue around DCLayerTree.

Flags: needinfo?(sotaro.ikeda.g)
Pushed by sikeda.birchill@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/9398dc74275e Disable video overlay if mVideoSwapChain->Present() or mCompositionDevice->Commit() with video overlay is too slow r=gfx-reviewers,bradwerth
Status: NEW → RESOLVED
Closed: 1 years ago
Resolution: --- → FIXED
Target Milestone: --- → 119 Branch
Blocks: 1851625
Blocks: 1851630
Depends on: 1818685
No longer depends on: 1849680
See Also: 18186851849680
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: