Enable AV1 and dav1d by default on Android (redux)
Categories
(Core :: Audio/Video: Playback, enhancement, P3)
Tracking
()
People
(Reporter: jbauman, Assigned: jrmuizel)
References
(Blocks 1 open bug)
Details
(Keywords: dev-doc-complete)
Attachments
(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:
media.av1.enabled
media.av1.use-dav1d
Apologies if asking this here is not appropriate but when you go to m.youtube.com in Fenix/Firefox for Android, is YouTube even serving AV1? I know they do in desktop youtube.com and YouTube apps
![]() |
||
Comment 2•1 year ago
|
||
(In reply to Will from comment #1)
Apologies if asking this here is not appropriate but when you go to m.youtube.com in Fenix/Firefox for Android, is YouTube even serving AV1? I know they do in desktop youtube.com 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.
![]() |
||
Comment 3•1 year ago
|
||
TODO:
- find some good samples of 8 and 10-bit AV1 content
- schedule QA testing in Nightly
- shipit!
![]() |
||
Updated•1 year ago
|
![]() |
||
Updated•1 year ago
|
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.
Assignee | ||
Comment 5•3 months ago
|
||
This has been enabled in Nightly for a long time (since Aug 2020?). Is there a good reason it shouldn't just ship?
Comment 6•3 months ago
|
||
Recently Bug 1815824 addressed av1 handling for MediaCodec on Android.
![]() |
||
Updated•3 months ago
|
Assignee | ||
Comment 7•3 months ago
|
||
Updated•3 months ago
|
Comment 8•3 months ago
|
||
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
Assignee | ||
Comment 9•3 months ago
|
||
To clarify, as of bug 1815824 we're currently decoding AV1 on Android with libgav1 when there's not hardware support?
Comment 10•3 months ago
•
|
||
(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
TID USER PR NI VIRT RES SHR S[%CPU] %MEM TIME+ THREAD
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
Comment 11•3 months ago
|
||
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.
Comment 12•3 months ago
|
||
Pushed by jmuizelaar@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d91caa866f83 Let AV1 ride the trains on Android r=padenot
Comment 13•3 months ago
|
||
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?
Comment 14•3 months ago
|
||
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)]:
Assignee | ||
Comment 15•3 months ago
|
||
I'm fine with either but lean more towards waiting for bug 1822636
Comment 16•3 months ago
|
||
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.
Comment 17•3 months ago
|
||
bugherder |
Comment 19•2 months ago
|
||
FYI FF113 associated MDN docs updates in https://github.com/mdn/content/pull/26247 and https://github.com/mdn/content/pull/26265. Thanks MathewH.
Description
•