Closed Bug 1665168 Opened 4 years ago Closed 3 years ago

Picture in picture video has very low framerate if source Firefox window is not on screen

Categories

(Core :: Graphics: WebRender, defect, P3)

x86_64
Linux
defect

Tracking

()

RESOLVED DUPLICATE of bug 1635186

People

(Reporter: mythmon, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

My desktop environment is Wayland, though I am using Firefox in X11 mode. I am using the Sway tiling window manager.

STR:

  1. Start playing a video (I used Youtube in this test, but every video does this)
  2. Open PiP
  3. Hide the main Firefox window, keeping the PiP window visible by doing one of the following
  • Minimize the window
  • Sending it to another virtual desktop
  • Hiding it completely behind another window in tiling mode
  • This doesn't happen when the window is entirely covered by another window in floating mode

Expected:

The video should play smoothly

Actual:

The video reduces framerate drastically, approximately 1fps.

Probably a wayland/linux related issue but moving to Pip component for triage.

Component: General → Video/Audio Controls
Product: Firefox → Toolkit
Component: Video/Audio Controls → Audio/Video: Playback
Product: Toolkit → Core

This sounds like bug 1598654 -- sites think they're not visible and lower the video quality.

Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → DUPLICATE

Could you gather a profile in nightly of this taking place using the media preset, share it, and paste the link here? The differential diagnosis here is it's something Fx is doing since it thinks the page is hidden and we're deprioritizing some part of the media pipeline.

Flags: needinfo?(mcooper)

Here is a profile of playing a Youtube video, switching to PiP mode, and then changing to another workspace. I then moved back to the original workspace and closed PiP.

https://share.firefox.dev/32Tumfc

Flags: needinfo?(mcooper)

Thanks. NI me to examine profile and reopen this if it shows Fx related issues.

Flags: needinfo?(bvandyk)
  • Based on TelemetryStopwatch — FX_PICTURE_IN_PICTURE_WINDOW_OPEN_DURATION marker on the parent, PiP is active from ~14s to ~35s in the profile.
  • The MediaDecoderStateMachine PlayAudio and PlayVideo markers show that we're decoding smoothly during the profile
  • There's some janks in the middle of the profile with a lot of gfx happening at those times.

I'm going to reopen and move to gfx webrender (going off stacks in the profile) to see if they have any further insight.

Status: RESOLVED → REOPENED
Component: Audio/Video: Playback → Graphics: WebRender
Flags: needinfo?(bvandyk)
Resolution: DUPLICATE → ---

Huge amounts of time spent in glxMakeCurrent(). Nical, does that sound familiar at all?

Also seems like too much time in nouveau_drm_screen_create() for the GPU cache scatter update? Dzmitry, have you seen that before? Could it be unsuitable for nouveau?

Michael, could you please attach your about:support. Then (separately) try a few things for me:

  • Try running with EGL instead of GLX (but still using XWayland instead of native wayland) - Run firefox with the env var MOZ_USE_EGL=1
  • Run with native wayland - MOZ_ENABLE_WAYLAND=1
  • Disable webrender - set pref gfx.webrender.force-disabled=true and restart
Blocks: wr-linux
Severity: -- → S3
Flags: needinfo?(nical.bugzilla)
Flags: needinfo?(mcooper)
Flags: needinfo?(dmalyshau)
Priority: -- → P3

I'm also seeing an enormous amount of time in make current with nvidia proprietary driver as soon as two firefox windows are rending continuously. It's unclear what to do about the driver being so unhappy when two GL contexts are rendering in the same process, but it would be great to fix the main window invalidating during picture-in-picture playback if the current tab is the one that originally contained the video.

Flags: needinfo?(nical.bugzilla)
Attached file about:support

I've attached my about:support. It is from a fresh profile, just like all my other testing.

  • MOZ_USE_EGL=1 results in the same behavior.
  • With MOZ_ENABLE_WAYLAND=1 the video plays smoothly when the parent window is off-screen.
  • Setting gfx.webrender.force-disabled=true also causes the video to play smoothly.

I did all of these tests with videos from the Youtube homepage.

Flags: needinfo?(mcooper)

Also seems like too much time in nouveau_drm_screen_create() for the GPU cache scatter update? Dzmitry, have you seen that before? Could it be unsuitable for nouveau?

That's certainly new to me. We haven't seen any platforms where GPU scatter would be slower. We still have it configurable, so maybe you can hard-code it to be disabled, and see if that helps? An action item also could be looking at nouveau code and trying to figure out why it could be slow.

Flags: needinfo?(dmalyshau)
Blocks: wr-linux-perf
No longer blocks: wr-linux
Status: REOPENED → RESOLVED
Closed: 4 years ago3 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: