VA-API not working for VP9 HW decoding on Fedora
Categories
(Core :: Audio/Video: Playback, defect)
Tracking
()
People
(Reporter: vpvainio, Unassigned)
Details
Attachments
(4 files)
User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36
Steps to reproduce:
I can't get VP9 harware decoding to work in Youtube. I have a Thinkpad with Intel UHD Graphics 620 and I'm using Fedora 34. In https://mastransky.wordpress.com/2021/01/10/firefox-were-finally-getting-hw-acceleration-on-linux/ Martin Stransky asked me to file a bug report here.
Actual results:
I will attach a more detailed log to this bug report. When I run
MOZ_ENABLE_WAYLAND=1 MOZ_LOG="PlatformDecoderModule:5" firefox -P 2>&1 | grep -E -i 'vaapi|va-api'
and then force Youtube to use VP9 with the enchanced-h264ify addon, this is what I get:
[RDD 6906: Main Thread]: D/PlatformDecoderModule VA-API FFmpeg is disabled by platform
[RDD 6906: MediaSupervisor #1]: D/PlatformDecoderModule DMABuf/VA-API is disabled.
However, if I force Youtube to use H264, HW decoding works. This is a snippet of the log:
[Child 6678: MediaPDecoder #5]: D/PlatformDecoderModule Initialising VA-API FFmpeg decoder
libva info: VA-API version 1.11.0
[AVHWDeviceContext @ 0x7f1249a81180] VAAPI driver: Intel iHD driver for Intel(R) Gen Graphics - 21.1.3 ().
[Child 6678: MediaPDecoder #5]: D/PlatformDecoderModule VA-API FFmpeg init successful
[Child 6678: MediaPDecoder #5]: D/PlatformDecoderModule Choosing FFmpeg pixel format for VA-API video decoding.
[Child 6678: MediaPDecoder #5]: D/PlatformDecoderModule Requesting pixel format VAAPI_VLD
[h264 @ 0x7f1242385800] Format vaapi_vld chosen by get_format().
[h264 @ 0x7f1242385800] Format vaapi_vld requires hwaccel initialisation.
[h264 @ 0x7f1242385800] Reinit context to 864x480, pix_fmt: vaapi_vld
[Child 6678: MediaPDecoder #6]: D/PlatformDecoderModule DMABUF/VA-API Got one frame output with pts=0dts=0 duration=40000 opaque=-9223372036854775808
[Child 6678: MediaPDecoder #6]: D/PlatformDecoderModule DMABufSurfaceWrapper: VAAPI locking dmabuf surface UID = 1
[Child 6678: MediaPDecoder #5]: D/PlatformDecoderModule DMABufSurfaceWrapper: VAAPI releasing dmabuf surface UID = 1
I'm using firefox-89.0.2-2.fc34.x86_64 and intel-media-driver-21.1.3-1.fc34.x86_64. I have tested libva-intel-driver as well, with the same results.
Expected results:
It would be nice if VP9 HW decoding worked.
Reporter | ||
Comment 1•3 years ago
|
||
Youtube showed me an ad I could not skip. The log has also a bit of playing the actual video in it, which is why it's so long.
Reporter | ||
Comment 2•3 years ago
|
||
Reporter | ||
Comment 3•3 years ago
|
||
I had to set media.ffmpeg.vaapi.enabled to true to get h264 HW decoding to work. Other than that, the tests are done in a new profile with Fedora's defaults.
Reporter | ||
Comment 4•3 years ago
|
||
I took a better look at the VP9 log myself. To me my situation seems similar to https://bugzilla.mozilla.org/show_bug.cgi?id=1698778
Comment 5•3 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::Audio/Video: Playback' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.
Comment 6•3 years ago
|
||
You need to disable build-in ffvpx decoder, set 'media.ffvpx.enabled' to false at about:config.
This is covered by Bug 1683808
Reporter | ||
Comment 7•3 years ago
|
||
Still does not work, I've attached the log.
Comment 8•3 years ago
|
||
Is this guide helpful: https://wiki.archlinux.org/title/Firefox#Hardware_video_acceleration
Reporter | ||
Comment 9•3 years ago
|
||
(In reply to Vincent Chernin from comment #8)
Is this guide helpful: https://wiki.archlinux.org/title/Firefox#Hardware_video_acceleration
Thank you. I got it working. I needed:
media.ffmpeg.vaapi.enabled to true
media.ffvpx.enabled to false
media.rdd-vpx.enabled to false
I did not have to change security.sandbox.content.level, which is good, because I would rather live without HW VP9 decoding than disable a sandboxing feature. In my (very) old Firefox profile that option is 4 now.
If there's no actual bug here, but informed default configuration choices, you can close this report.
Comment 10•3 years ago
|
||
Thanks for the help! Closing it.
Description
•