VAAPI: Massive glitches with iHD
Categories
(Core :: Audio/Video: Playback, defect, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox-esr91 | --- | unaffected |
firefox100 | --- | unaffected |
firefox101 | --- | unaffected |
firefox102 | --- | fixed |
People
(Reporter: jan, Assigned: stransky)
References
(Blocks 1 open bug, Regression)
Details
(Keywords: correctness, nightly-community, regression)
Attachments
(5 files, 1 obsolete file)
Debian Testing, Gnome Wayland, Macbook Pro
iHD: intel-media-va-driver-non-free:amd64 22.4.0+ds1-1
Mesa: 21.3.8-1
$ vainfo
libva info: VA-API version 1.14.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_14
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.14 (libva 2.12.0)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 22.4.0 ()
vainfo: Supported profile and entrypoints
VAProfileNone : VAEntrypointVideoProc
VAProfileNone : VAEntrypointStats
VAProfileMPEG2Simple : VAEntrypointVLD
VAProfileMPEG2Simple : VAEntrypointEncSlice
VAProfileMPEG2Main : VAEntrypointVLD
VAProfileMPEG2Main : VAEntrypointEncSlice
VAProfileH264Main : VAEntrypointVLD
VAProfileH264Main : VAEntrypointEncSlice
VAProfileH264Main : VAEntrypointFEI
VAProfileH264High : VAEntrypointVLD
VAProfileH264High : VAEntrypointEncSlice
VAProfileH264High : VAEntrypointFEI
VAProfileVC1Simple : VAEntrypointVLD
VAProfileVC1Main : VAEntrypointVLD
VAProfileVC1Advanced : VAEntrypointVLD
VAProfileJPEGBaseline : VAEntrypointVLD
VAProfileH264ConstrainedBaseline: VAEntrypointVLD
VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
VAProfileH264ConstrainedBaseline: VAEntrypointFEI
VAProfileVP8Version0_3 : VAEntrypointVLD
Running sudo intel_gpu_top
in parallel to confirm that VAAPI is used:
MOZ_ENABLE_WAYLAND=1 MOZ_DISABLE_RDD_SANDBOX=1 mozregression --good 2022-01-01 --bad c1ef18d0a27e --pref media.ffmpeg.vaapi.enabled:true -a https://bug1619882.bmoattachments.org/attachment.cgi?id=9149605
10:58.84 INFO: Last good revision: 1b7f9123f9c3385e7b7257db60a72eeeab565989
10:58.84 INFO: First bad revision: c1ef18d0a27ec4c2736cbb2c8ae8b061bd728f2e
10:58.84 INFO: Pushlog:
https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=1b7f9123f9c3385e7b7257db60a72eeeab565989&tochange=c1ef18d0a27ec4c2736cbb2c8ae8b061bd728f2e
c1ef18d0a27ec4c2736cbb2c8ae8b061bd728f2e stransky — Bug 1769499 [Linux/EGL] Create GBM based surface for headless GL context r=jgilbert
Screencast:
MOZ_ENABLE_WAYLAND=1 MOZ_DISABLE_RDD_SANDBOX=1 mozregression --launch c1ef18d0a27e --pref media.ffmpeg.vaapi.enabled:true -a https://bug1619882.bmoattachments.org/attachment.cgi?id=9149605 -a about:support
Reporter | ||
Comment 1•3 years ago
|
||
Updated•3 years ago
|
Reporter | ||
Comment 2•3 years ago
|
||
MOZ_LOG="Dmabuf:5,PlatformDecoderModule:5" MOZ_ENABLE_WAYLAND=1 MOZ_DISABLE_RDD_SANDBOX=1 mozregression --launch c1ef18d0a27e --pref media.ffmpeg.vaapi.enabled:true -a https://bug1619882.bmoattachments.org/attachment.cgi?id=9149605 -P stdout > bug1770407.txt
Reporter | ||
Comment 3•3 years ago
|
||
$ dpkg -l | grep libavcodec
ii libavcodec-extra58:amd64 7:4.4.2-1
Assignee | ||
Comment 4•3 years ago
|
||
Mesa Intel(R) Iris(R) Graphics 6100
That's pretty new one, right? I'll test on my XPS 15 with HD 630.
Reporter | ||
Comment 5•3 years ago
|
||
MacBook Pro (Retina, 13-inch, Early 2015)
according to https://checkcoverage.apple.com/us/en/
It supports VP8 + H264.
Assignee | ||
Comment 6•3 years ago
|
||
(In reply to Darkspirit from comment #5)
MacBook Pro (Retina, 13-inch, Early 2015)
according to https://checkcoverage.apple.com/us/en/
It supports VP8 + H264.
Oh sure, I misread VAProfileVC1Main as AV1 :-)
Assignee | ||
Comment 7•3 years ago
|
||
Yes, I can reproduce that on Intel too.
Comment 8•3 years ago
|
||
I have this with VP9 on an XPS 15 with Mesa Intel(R) UHD Graphics (CML GT2)
.
As a wild guess, it looks like the GPU is decoding truncated frames, so it might be there's some missing fencing/synchronization and the GPU tries to read the encoded frames before they're properly transferred, or missing cache invalidation.
Comment 9•3 years ago
|
||
Have same issue on Tigerlake IrisXE, X11. The glitches disappear if i recompile mozilla-central with D146555 (https://phabricator.services.mozilla.com/D146555) reverted.
Comment 11•3 years ago
|
||
There seem to be some video on YouTube with no artifacts. No idea what information from the debug information (right click in the YouTube player) shows the format.
Assignee | ||
Comment 12•3 years ago
|
||
That goes the same direction as Bug 1699433, i.e. multi-thread access to libdri.
Reporter | ||
Updated•3 years ago
|
Assignee | ||
Comment 14•3 years ago
|
||
With Bug 1769499 we create GBM GL headless backend on RDD process. There's no point to create EGLImage/texture
over it as we use a different GL backend for image frames rendering.
Comment 15•3 years ago
|
||
Visually same glitches happening on Intel HD Graphics 530 (rev 06) with "vainfo: Driver version: Intel i965 driver for Intel(R) Skylake - 2.4.1" driver (with intel hybrid codec driver for vp9 vaapi support) for h264 and for vp9.
Sometimes a crash like https://crash-stats.mozilla.org/report/index/f1a36db3-c380-427c-94f2-4e0ec0220525 happens and the glitches disappear, probably because it switches to software decoding in that moment.
Updated•2 years ago
|
Comment 16•2 years ago
|
||
Compiled without abandoned patch D147154 - glitches are back again. Applied patch back - no glitches.
Reporter | ||
Comment 17•2 years ago
|
||
https://gitlab.gnome.org/GNOME/gnome-remote-desktop/-/merge_requests/94 indicates that EGL_PLATFORM_SURFACELESS_MESA will definitely not work on Nvidia.
At least they support Gbm since 495, but we should test nvidia-vaapi-driver with that, too.
Assignee | ||
Comment 18•2 years ago
|
||
MESA_platform_surfaceless provides better alternative to GBM GL backend so let's use that instead of GBM.
Assignee | ||
Comment 19•2 years ago
|
||
Depends on D147420
Assignee | ||
Comment 20•2 years ago
|
||
Reporter | ||
Comment 21•2 years ago
|
||
(In reply to Darkspirit from comment #17)
https://gitlab.gnome.org/GNOME/gnome-remote-desktop/-/merge_requests/94 indicates that EGL_PLATFORM_SURFACELESS_MESA will definitely not work on Nvidia.
At least they support Gbm since 495, but we should test nvidia-vaapi-driver with that, too.
On the other hand, it might motivate Nvidia to support VAAPI properly via Mesa which would serve users best.
At the moment, CUDA forces a higher power state, hw decoding apparently needs more power than software decoding:
https://github.com/elFarto/nvidia-vaapi-driver/issues/74#issuecomment-1100918826
mesa/d3d12 in WSL2 supports EGL_MESA_platform_surfaceless and H264 VAAPI:
https://bug1770538.bmoattachments.org/attachment.cgi?id=9277868
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16286
Assignee | ||
Comment 22•2 years ago
|
||
(In reply to Darkspirit from comment #21)
(In reply to Darkspirit from comment #17)
https://gitlab.gnome.org/GNOME/gnome-remote-desktop/-/merge_requests/94 indicates that EGL_PLATFORM_SURFACELESS_MESA will definitely not work on Nvidia.
At least they support Gbm since 495, but we should test nvidia-vaapi-driver with that, too.
I think that's something different and unrelated. For instance I see EGL_MESA_platform_surfaceless extension available on my NVIDIA laptop with binary drivers.
The issue above is about sharing dmabuf between different devices (Intel & NVIDIA) but Firefox doesn't do that or we can exclude such scenario by EGL_MESA_image_dma_buf_export extension (i.e. don't create dmabuf memory directly by GBM but import it from GL).
For instance we may use the same device to decode va-api video and take a snapshot of it (if va-api is even supported on NVIDIA).
Comment 23•2 years ago
|
||
Comment 24•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/31e79de8266b
https://hg.mozilla.org/mozilla-central/rev/23a716a8b079
Reporter | ||
Comment 25•2 years ago
|
||
Glitches are gone and MOZ_DISABLE_RDD_SANDBOX=1 is no longer needed. Thanks!
Reporter | ||
Comment 26•2 years ago
|
||
https://www.reddit.com/r/firefox/comments/v0esaq/comment/iakwkez/
Seems to work, but now the DRI_PRIME flag seems to be broken. Two steps forward, one backwards.
might be
https://gitlab.freedesktop.org/mesa/mesa/-/issues/3987
DRI_PRIME env var on EGL Surfaceless platform is ineffective
Assignee | ||
Comment 27•2 years ago
|
||
(In reply to Darkspirit from comment #26)
https://www.reddit.com/r/firefox/comments/v0esaq/comment/iakwkez/
Seems to work, but now the DRI_PRIME flag seems to be broken. Two steps forward, one backwards.
might be
https://gitlab.freedesktop.org/mesa/mesa/-/issues/3987DRI_PRIME env var on EGL Surfaceless platform is ineffective
Please file a new bug for it. I don't understand how it affects Firefox - EGL Surfaceless platform is used to show va-api decoded pictures in snapshots so I don't understand how it matters here.
Comment 28•2 years ago
|
||
Updated•2 years ago
|
Updated•2 years ago
|
Description
•