Closed Bug 1705940 Opened 3 years ago Closed 2 years ago

VAAPI hardware decoding does not work for 10-bit VP9 files (aka. VP9 profile 2)

Categories

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

Firefox 87
defect

Tracking

()

VERIFIED FIXED
98 Branch
Tracking Status
firefox98 --- verified

People

(Reporter: benjamin.j.grant, Assigned: stransky)

References

(Blocks 1 open bug)

Details

Attachments

(4 files)

Attached video file that doesn't work

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

Steps to reproduce:

  • Open a WebM file containing VP9 video with 4:2:0 chroma subsampling and 10 bits per channel (yuv420p10le)

Actual results:

It says "Video can't be played because the file is corrupt."

The following errors are printed to the console:

Media resource file:///home/ben/bbb-10bit.webm could not be decoded, error: Error Code: NS_ERROR_OUT_OF_MEMORY (0x8007000e)
Details: mozilla::MediaResult mozilla::FFmpegVideoDecoder<58>::CreateImageDMABuf(int64_t, int64_t, int64_t, MediaDataDecoder::DecodedData &): Unable to get DMABufSurfaceYUV

If I switch VP9 to use software decoding by setting media.ffvpx.enabled to true, the file plays normally.

Expected results:

It should play using hardware decoding. I'm running on a Ryzen 5 3500U with the integrated Vega 8 GPU, which does support 10-bit VP9 decoding:

$ vainfo
vainfo: VA-API version: 1.11 (libva 2.11.1)
vainfo: Driver version: Mesa Gallium driver 21.0.2 for AMD Radeon(TM) Vega 8 Graphics (RAVEN, DRM 3.40.0, 5.11.14-arch1-1, LLVM 11.1.0)
vainfo: Supported profile and entrypoints
      [...]
      VAProfileVP9Profile0            :	VAEntrypointVLD
      VAProfileVP9Profile2            :	VAEntrypointVLD

I can also play the same file with mpv and it uses VAAPI decoding.

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.

Component: Untriaged → Audio/Video: Playback
Product: Firefox → Core
Severity: -- → S3
Priority: -- → P5

Please run Firefox with MOZ_LOG="PlatformDecoderModule:5" env variable and attach full output here. We support NV12 with VAAPI only right now and I expect it's mapped to something else.

Flags: needinfo?(benjamin.j.grant)

Here you go. I can also attach the file I tried playing if you'd like. It plays perfectly with hardware decoding in mpv.

Flags: needinfo?(benjamin.j.grant)

We failed to create EGLImage for it:

[Parent 11859: Renderer]: D/Dmabuf DMABufSurfaceYUV::CreateTexture() UID 1 plane 0
[Parent 11859: Renderer]: D/Dmabuf EGLImageKHR creation failed
[Parent 11859: Renderer]: D/Dmabuf DMABufSurfaceYUV::CreateTexture() UID 1 plane 1
[Parent 11859: Renderer]: D/Dmabuf EGLImageKHR creation failed

It's generally Bug 1724385 although we may support that.

Assignee: nobody → stransky
Status: UNCONFIRMED → NEW
Ever confirmed: true
Pushed by stransky@redhat.com:
https://hg.mozilla.org/integration/autoland/rev/46e964a07181
[Linux] Use VA-API for P010 formats, r=alwu,media-playback-reviewers
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 98 Branch
Flags: qe-verify+

I managed to reproduce this by setting media.ffvpx.enabled to false in the about:config tab on Firefox 87(20210318103112) on Linux x86_64(Ubuntu 20.04). This issue is fixed on the latest Firefox beta 98.0b4(20220213185901) and Nightly 99.0a1(20220214092817) builds on the same OS; hardware decoding works as expected.

Status: RESOLVED → VERIFIED
Flags: qe-verify+
See Also: → 1883932
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: