Closed Bug 1672276 Opened 4 years ago Closed 1 year ago

Enable AV1 and dav1d by default on Android (redux)


(Core :: Audio/Video: Playback, enhancement, P3)




113 Branch
Tracking Status
relnote-firefox --- 113+
firefox111 --- wontfix
firefox112 --- wontfix
firefox113 --- fixed


(Reporter: jbauman, Assigned: jrmuizel)


(Blocks 1 open bug)


(Keywords: dev-doc-complete)


(1 file)

This bug was initially created as a clone of bug 1644566 which was completed, but then bug 1661346 disabled it again, so it seemed confusing to not have an open bug tracking this work.

We would like to enable AV1 decoding and the dav1d decoder on Android by default.

We checked with the Security team (Daniel Veditz and Tyson Smith) and they have approved this decision.

The prefs that need to enabled are:

Depends on: 1661346

Apologies if asking this here is not appropriate but when you go to in Fenix/Firefox for Android, is YouTube even serving AV1? I know they do in desktop and YouTube apps

(In reply to Will from comment #1)

Apologies if asking this here is not appropriate but when you go to in Fenix/Firefox for Android, is YouTube even serving AV1? I know they do in desktop and YouTube apps

They wouldn't serve it to Firefox on Android because we don't advertise that we support it through DOM apis youtube queries.


  1. find some good samples of 8 and 10-bit AV1 content
  2. schedule QA testing in Nightly
  3. shipit!
Blocks: media-triage
No longer blocks: media-triage
Assignee: nobody → jmathies
Severity: -- → S4
Priority: -- → P3

After some research, I found two interesting resources:

  • Graphcore's Argon Streams AV1 project is some sort of test framework that decoder vendors leverage to verify the correctness of their implementation using "a mathematical model to generate a set of bit-streams that spans the entire space of valid AV1 bit-streams." (source). The git project doesn't appear to include any clips (probably due to there size) but when I try downloading them from AOMedia directly I get a network error.

  • The only invalid sample files I could find were in a comment on the dav1d ticket "Error resilience in dav1d."

I hope this is useful.

This has been enabled in Nightly for a long time (since Aug 2020?). Is there a good reason it shouldn't just ship?

Flags: needinfo?(jmathies)

Recently Bug 1815824 addressed av1 handling for MediaCodec on Android.

Assignee: jmathies → nobody
Flags: needinfo?(jmathies)
Assignee: nobody → jmuizelaar

Google started to support AV1 since Android 10, and is currently using libgav1 software codecs if the device doesn't have HW decoder. Sotaro's bug 1815824 patch enables the platform AV1 decoder on Android, and since platform decoders precede Gecko built-ins, the libgav1 decoder will be used even with the prefs enabled. We should reject the SW platform AV1 decoder to make it fall back to the Gecko built-in dav1d decoder when there is no HW support.

My phone doesn't have HW AV1 decoder, nor the Pixel 5 on try server, so I cannot verify HW decoding personally. The latest reports on newer Pixel phones in some AV1 playback bugs (bug 1518549 and bug 1813904) sound promising, though.

I saw some error messages in the log when checking dav1d decoding on my phone and thought it didn't work and didn't think it is ready yet. That turned out to be a false alarm. I guess the only possible reasons against enabling it now are

  • unlike desktop platforms, RDD is not enabled on Android, and Gecko will run dav1d in the content process
  • dav1d consumes more power and drains the battery quicker

To clarify, as of bug 1815824 we're currently decoding AV1 on Android with libgav1 when there's not hardware support?

Flags: needinfo?(jolin)

(In reply to Jeff Muizelaar [:jrmuizel] from comment #9)

To clarify, as of bug 1815824 we're currently decoding AV1 on Android with libgav1 when there's not hardware support?

Yes, the current nightly build on my Pixel 3 shows libgav1 consuming CPU in top -H output:

Threads: 4296 total,   8 running, 4288 sleeping,   0 stopped,   0 zombie
  Mem:  3665332K total,  3546232K used,   119100K free,      400K buffers
 Swap:  2097148K total,  1548708K used,   548440K free,   551632K cached
800%cpu 296%user   0%nice  92%sys 393%idle   1%iow  15%irq   3%sirq   0%host
10121 mediacodec   10 -10  11G  53M 3.7M R 43.6   1.4   0:48.62 oid.av1.decoder
10132 mediacodec   10 -10  11G  53M 3.7M S 31.0   1.4   0:31.36 libgav1/10132
10128 mediacodec   10 -10  11G  53M 3.7M S 30.6   1.4   0:31.40 libgav1/10128
10129 mediacodec   10 -10  11G  53M 3.7M R 30.0   1.4   0:31.28 libgav1/10129
10130 mediacodec   10 -10  11G  53M 3.7M S 30.0   1.4   0:31.17 libgav1/10130
10126 mediacodec   10 -10  11G  53M 3.7M S 29.3   1.4   0:30.93 libgav1/10126
10127 mediacodec   10 -10  11G  53M 3.7M R 29.0   1.4   0:31.91 libgav1/10127
10131 mediacodec   10 -10  11G  53M 3.7M S 27.6   1.4   0:30.62 libgav1/10131
 8620 u0_a292      20   0  17G 307M 130M S 19.0   8.5   0:28.99 Web Content
Flags: needinfo?(jolin)
Depends on: 1822636

Bug 1822636 was filed to suppress the Android software platform decoder(libgav1) so that Gecko would use dav1d on devices without a hardware AV1 decoder.

Pushed by
Let AV1 ride the trains on Android r=padenot

Jeff, since AV1 has been enabled in Fenix Nightly + Early Beta for over a year, can we uplift your patch to Beta 112? We don't need any Nightly bake time before your patch rides to Beta 113.

Or do you recommend that we fix bug 1822636 (prefer dav1d over libgav1) before we let AV1 ride the trains?

Flags: needinfo?(jmuizelaar)

Release Note Request (optional, but appreciated)
[Why is this notable]: New video playback format
[Affects Firefox for Android]: Only, though there may be posts from the desktop launch of AV1 that could help explain it
[Suggested wording]: Hardware accelerated AV1 video decoding is enabled on Android with supported hardware or fallback to software decoding
[Links (documentation, blog post, etc)]:

relnote-firefox: --- → ?

I'm fine with either but lean more towards waiting for bug 1822636

Flags: needinfo?(jmuizelaar)

I see bug 1822636 just landed. Since it enables a new decoder code path on Android (to use a hardware decoder), I think we should probably let AV1 ride the trains with 113 instead of fast tracking it to Beta 112.

Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 113 Branch

Added to the Fx113 Nightly relnotes.

FYI FF113 associated MDN docs updates in and Thanks MathewH.

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