Closed Bug 1743772 Opened 4 years ago Closed 3 years ago

VAAPI H264 playback error https://dumpert.nl: NS_ERROR_DOM_MEDIA_DECODE_ERR (0x806e0004) ... avcodec_send_packet error: -1094995529

Categories

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

Firefox 96
x86_64
Linux
defect

Tracking

()

RESOLVED WORKSFORME
Tracking Status
firefox96 --- disabled

People

(Reporter: banetmp+zxgfk, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(5 files)

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

Steps to reproduce:

Firefox:
Nightly 20211130214422 100 experiment opt-in
media.ffmpeg.vaapi.enabled - true
media.ffmpeg.vaapi-drm-display.enabled - true

System:
Ubuntu 21.10 kernel 5.14.0-18.1 (comment: happens on newer kernels as well)
ffmpeg 7:4.4-6ubuntu5
AMD R9 280x, kernel driver amdgpu, mesa 22.0~git2111270600.b5848b (comment: still happening on earlier revisions)

Actual results:

Some videos on this site have broken video playback after a few seconds, returning a visual error message from the site's VIDEOJS media framework: "The media playback was aborted due to a corruption problem or because the media used features your browser did not support."

VAAPI works fine otherwise

Example URL of affected video: https://www.dumpert.nl/?selectedId=100016246_9c1498d8

Typical console error message:

Media resource blob:https://www.dumpert.nl/bd13c90b-de1f-4d3d-aaf8-4cdc2e785da6 could not be decoded, error: Error Code: NS_ERROR_DOM_MEDIA_DECODE_ERR (0x806e0004)
Details: virtual mozilla::MediaResult mozilla::FFmpegVideoDecoder<58>::DoDecode(mozilla::MediaRawData *, uint8_t *, int, bool *, MediaDataDecoder::DecodedData &): avcodec_send_packet error: -1094995529 www.dumpert.nl

OS: Unspecified → Linux
Hardware: Unspecified → x86_64
Summary: VA-API enabled playback error dumpert.nl: NS_ERROR_DOM_MEDIA_DECODE_ERR (0x806e0004) ... avcodec_send_packet error: -1094995529 → VA-API playback error https://dumpert.nl: NS_ERROR_DOM_MEDIA_DECODE_ERR (0x806e0004) ... avcodec_send_packet error: -1094995529
Component: Untriaged → Audio/Video: Playback
Product: Firefox → Core

Set the Severity to S4 for now. Feel free to change it.
Martin, would you mind having a look?

Severity: -- → S4
Flags: needinfo?(stransky)

(In reply to V Dunord from comment #0)
Thanks for the report! Please open about:support, click on "Copy text to clipboard" and paste it here.

Attached file about:support data

If any deeper debugging is needed a requested instructions for this would be appreciated. Installing debugging packages, running the debugger, collecting the traces etc.

It needs to be noted that the problem can be reproduced on a stock system as well, as you will notice indeed the system is indicating custom kernel and mesa stack in the about:support data.

https://media.dumpert.nl/dmp/media/video/7/b/7/7b780271-2007-e690-e615-b971662f60b0/index.m3u8 is h264.

Are you able to find a regression range, if there is any?
$ sudo apt install python3-pip
$ pip3 install --user mozregression
(It's located at ~/.local/bin/mozregression.)
For example:
$ mozregression --good 94 --bad 20211203094816 --pref gfx.x11-egl.force-enabled:true gfx.webrender.all:true media.ffmpeg.vaapi.enabled:true -a https://www.dumpert.nl/?selectedId=100016246_9c1498d8 -P stdout

After testing each build, type g for good or b for bad and press enter. Then it will open the next one until you get the most narrow pushlog url.

See Also: → 1743638
Summary: VA-API playback error https://dumpert.nl: NS_ERROR_DOM_MEDIA_DECODE_ERR (0x806e0004) ... avcodec_send_packet error: -1094995529 → VAAPI H264 playback error https://dumpert.nl: NS_ERROR_DOM_MEDIA_DECODE_ERR (0x806e0004) ... avcodec_send_packet error: -1094995529

If first build (--good) is already bad, please try a wider range (bug 1715365 landed in 91 for example):
$ mozregression --good 90 --bad 20211203094816 --pref gfx.x11-egl.force-enabled:true gfx.webrender.all:true media.ffmpeg.vaapi.enabled:true -a https://www.dumpert.nl/?selectedId=100016246_9c1498d8 -P stdout

So starting from the Firefox 80 merge date that is found on the wiki, the bug starts

INFO: First bad revision: efa2336315eda0aaf78c2e94d6c9c98106ea136b (**2020-07-03**)

Before assuming the X11 HW accel was already merged, it could not be enabled even with the following prefs

--pref gfx.x11-egl.force-enabled:true gfx.webrender.all:true media.ffmpeg.vaapi-drm-display.enabled:true media.ffmpeg.vaapi.enabled:true media.ffmpeg.dmabuf-textures.enabled:true widget.dmabuf-textures.enabled:true

From on backwards the VAAPI does not enable and firefox (f0ac79e1ed53bbdc5f0b470f6889ebfcc05fa550 (2020-07-02)) prints

D/PlatformDecoderModule DMA-Buf/VA-API can't be used, WebRender/DMA-Buf is disabled"

also for all bisection, env set to MOZ_DISABLE_CONTENT_SANDBOX=1 MOZ_X11_EGL=1 MOZ_LOG="PlatformDecoderModule:5"

Flags: needinfo?(stransky)

I'm unable to reproduce. Please try latest nightly:
https://fedoraproject.org/wiki/How_to_debug_Firefox_problems?rd=Bug_info_Firefox#Testing_Mozilla_binaries
If you still see that please run Firefox on terminal with MOZ_LOG="PlatformDecoderModule:5" env variable set and attach the log here.
Thanks.

Flags: needinfo?(banetmp+zxgfk)

vainfo returns H264 supported. Attempting playback results in segfault, yet video plays, likely without HW acceleration since log notes: disabled by platform (yet media.ffmpeg.vaapi.enabled = true)

Flags: needinfo?(banetmp+zxgfk)

Possible sandboxing problems

There is repeatedly "/usr/share/libdrm/amdgpu.ids: Permission denied".

Attachment #9264363 - Attachment mime type: application/octet-stream → text/plain
Attachment #9264364 - Attachment mime type: application/octet-stream → text/plain

NS_ERROR_DOM_MEDIA_DECODE_ERR is turned into decoder restart with SW decode now.
NS_ERROR_OUT_OF_MEMORY from the last log is Bug 1761217.
So closing now.

Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
Resolution: --- → WORKSFORME

I've been having these FFmpeg repeated failures in Firefox on Debian with and without VAAPI enabled. They can be easily reproduced with the latest nightly and VAAPI disabled.

I've opened Bug 1770656

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

Attachment

General

Creator:
Created:
Updated:
Size: