Open Bug 1805975 Opened 2 years ago Updated 1 year ago

[AMD RX 6700] Occasional graphical flickering in Firefox 107.0.1-1 with vp9 encoded video

Categories

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

Firefox 107
defect

Tracking

()

UNCONFIRMED

People

(Reporter: steve, Unassigned, NeedInfo)

References

(Blocks 2 open bugs, )

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:107.0) Gecko/20100101 Firefox/107.0

Steps to reproduce:

The out of the box configuration for the rpm install has hardware acceleration enabled. When viewing vp9 encoded videos on youtube the entire lower 1/3 of my screen will occasionally flicker black or cyan. It tends to happen about every 15-30 seconds. This is not confined to the firefox window either. I have a second Fedora 37 system that is similarly configured (my wife's workstation) and I did confirm she has the same symptoms.

  • If I disable hardware acceleration in Firefox's settings the issue goes away. 
  • If I use enhanced-h264ify, and block vp9, the issue also goes away.  
  • I tried forcing Firefox from the Wayland backend to the xwayland back end, but the issue still occurred. 
  • I originally thought it might be related to the recent Fedora changes in hardware acceleration with mesa so I swapped the va drivers with the freeworld ones (and swapped them back as you will see below), but the issue still occurs.
  • Chrome doesn't seem to have this issue, but it does not appear that they are using hardware acceleration for this codec OOtB on linux either based on the CPU usage. 

Here is some information about my system.

  • Radeon 6700xt
  • Fedora 37
  • Kernel 6.0.11-300.fc37.x86_64
  • Mesa 22.2.3-1
  • An example video -> https://www.youtube.com/watch?v=pir_muTzYM8&t=316s
  • Using Gnome 43 on wayland, Firefox is using the Wayland backend as well.
  • $ vainfo
    Trying display: wayland
    libva info: VA-API version 1.16.0
    libva info: Trying to open /usr/lib64/dri/radeonsi_drv_video.so
    libva info: Found init function __vaDriverInit_1_15
    libva info: va_openDriver() returns 0
    vainfo: VA-API version: 1.16 (libva 2.16.0)
    vainfo: Driver version: Mesa Gallium driver 22.2.3 for AMD Radeon RX 6700 XT (navi22, LLVM 15.0.0, DRM 3.48, 6.0.11-300.fc37.x86_64)
    vainfo: Supported profile and entrypoints
    VAProfileMPEG2Simple : VAEntrypointVLD
    VAProfileMPEG2Main : VAEntrypointVLD
    VAProfileJPEGBaseline : VAEntrypointVLD
    VAProfileVP9Profile0 : VAEntrypointVLD
    VAProfileVP9Profile2 : VAEntrypointVLD
    VAProfileAV1Profile0 : VAEntrypointVLD
    VAProfileNone : VAEntrypointVideoProc

The Bugbug bot thinks this bug should belong to the 'Core::Widget: Gtk' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Widget: Gtk
Product: Firefox → Core
Component: Widget: Gtk → Audio/Video: Playback
Summary: Occasional graphical flickering in Firefox 107.0.1-1 with vp9 encoded video → [AMD RX 6700] Occasional graphical flickering in Firefox 107.0.1-1 with vp9 encoded video

Can you please take screenshot of the flickering it or create a screencast?
https://fedoraproject.org/wiki/How_to_debug_Firefox_problems#Collect_information_for_a_bug_report
Thanks.

Flags: needinfo?(steve)

Hey Martin,
I tried to to use Gnome's screencast to capture it, however I could see the issue on the screen but not in the recording. I used my phone to record the screen and shared the file here:

https://drive.google.com/file/d/1pZaE4yoXNWB4Ed6ochaKwmGDXE2nR0QV/view?usp=sharing

Try to download the file instead of using google's web player. The issue happens at 23 seconds and lasts for a couple of frames. It is very quick, and looks like a lighting adjustment.

Flags: needinfo?(steve)

Martin,
I used the slow motion video recording feature on my phone to get a better example. around 18-19 seconds in.

https://drive.google.com/file/d/1bGHtvUY5FIL8xPYMIDK8aGb3xFo_eMZN/view?usp=sharing

Video for reference is https://www.youtube.com/watch?v=fNxWNko6yf8&t=21s. Stats for nerds output:

Video ID / sCPN
fNxWNko6yf8 / DQ7C 5YBN PSQ8
Viewport / Frames
1506x847*1.25 / 8 dropped of 2464
Current / Optimal Res
3840x2160@60 / 3840x2160@60
Volume / Normalized
100% / 100% (content loudness -8.2dB)
Codecs
vp09.00.51.08.01.01.01.01.00 (315) / opus (251)
Color
bt709 / bt709

Severity: -- → S3

Thanks! Do I understand correctly that the flickering (color stripe) is across entire screen and not the video clip only, right?

Flags: needinfo?(steve)

Hey Martin, yes. That is correct. With hardware acceleration enabled in the FF settings the corruption occurs across the entire lower third of the screen including beyond the boundaries of the Firefox window. I am not sure if it's useful to know, but I have only ever seen it occur on the bottom third of the screen. Never in the top or middle. It reminds me of when cameras try to record old tube style displays, and the camera shutter is not synced to the refresh rate of the monitors.

Flags: needinfo?(steve)

Then it's a general gfx driver bug and not Firefox one. Please report at Mesa tracker - https://gitlab.freedesktop.org/mesa/mesa/-/issues
Thanks.

Hey Martin,
Yeah, that's what I expected but I was not sure where to file it. When I asked internally I was asked to open it here. I'll get it filed with Mesa. Please close this out.

Steve, can you link the reported Mesa issue here?
Thanks.

Flags: needinfo?(steve)
Flags: needinfo?(steve)

Hey Martin,
It might be a while before I can test this. I had to send this PC to System76 for unrelated warranty work. I'll test it as soon as I can.

Please try latest Mesa (23.1.1) which contains fix for AMD surfaces (https://gitlab.freedesktop.org/mesa/mesa/-/issues/8996).

You need to log in before you can comment on or make changes to this bug.