Open Bug 1716164 Opened 5 years ago Updated 2 months ago

disable av1 by default in all hardware that does not support av1 hardware decoding

Categories

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

Firefox 89
defect

Tracking

()

UNCONFIRMED

People

(Reporter: sk.griffinix, Unassigned)

References

Details

av1 is enabled by default in firefox since version 67 on all major platforms, i.e. windows, mac and linux. Recently major online streaming services have also switched to av1. This is causing very high cpu utilisation in hardware that does not support hardware decoding for av1. That includes all hardware prior to intel 11th gen tiger lake, amd rdna2 (pre rtx 6000 series) and nvidia 3000 series. This makes up for a significant share of hardware.

Currently, playing videos on major streaming services (like youtube, netflix https://m.youtube.com/watch?v=LXb3EKWsInQ) even on 1080p 60fps is quite heavy on cpu usage on any platform, and is especially problematic on mobile devices since it leads to decreased battery life.

Therefore media.av1.enabled should be disabled by default on all hardware that does not support av1 hardware 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: General → Audio/Video: Playback
Product: Firefox → Core

Do you have examples of videos where the sites are serving AV1 and it's causing performance problems? Ideally sites will select videos that give the best user experience, and will use different browser APIs to do so. For example, on Android they'll check if AV1 decoding is power efficient and only use it in that case. Examples of issues are helpful so we can find bugs in the APIs sites are using and work with them to make sure they're serving media as expected. We'd prefer that to disabling functionality and removing flexibility for sites.

Currently, playing videos on major streaming services (like youtube, netflix https://m.youtube.com/watch?v=LXb3EKWsInQ) even on 1080p 60fps is quite heavy on cpu usage on any platform, and is especially problematic on mobile devices since it leads to decreased battery life.

If this is happening on Netflix, I don't think it can be AV1-related, since we don't yet support encrypted AV1. There's a possibility what you're observing may not be AV1-specific. Do you observe different results if you change the media.av1.enabled setting under about:config?

Flags: needinfo?(sk.griffinix)

(In reply to Jon Bauman [:jbauman:] from comment #2)

Do you have examples of videos where the sites are serving AV1 and it's causing performance problems? Ideally sites will select videos that give the best user experience, and will use different browser APIs to do so. For example, on Android they'll check if AV1 decoding is power efficient and only use it in that case. Examples of issues are helpful so we can find bugs in the APIs sites are using and work with them to make sure they're serving media as expected. We'd prefer that to disabling functionality and removing flexibility for sites.

I had been observing this behaviour on youtube (on every 1080p or above video, such as in example), and after disabling av1, youtube started offering vp9, and cpu consumption was no longer high.

If this is happening on Netflix, I don't think it can be AV1-related, since we don't yet support encrypted AV1. There's a possibility what you're observing may not be AV1-specific. Do you observe different results if you change the media.av1.enabled setting under about:config?

I don't use netflix myself. I did find a user on reddit who had similar problem with netflix, and disabling av1 apparently solved the issue (https://www.reddit.com/r/firefox/comments/nwakag/firefox_nightly_cpu_consumption/)

Flags: needinfo?(sk.griffinix)
Severity: -- → S3
Priority: -- → P3
See Also: → 1822636

I'm probably experiencing the same problem: https://bugzilla.mozilla.org/show_bug.cgi?id=1830059

If no other type is available, AV1 software playback is better than not-playable state.

Just a very friendly reminder that yes "power efficient" is supposed to be avoiding situations like this.
BUT hardware decoding detection is presumably broken at least in Windows.

(In reply to mirh from comment #6)

BUT hardware decoding detection is presumably broken at least in Windows.

No, the power efficient should be working correctly for AV1 on Windows. Bug 1859368 is filed for the incorrect result in about:support, which is done by another method.

There is a big problem, and I'm suffering from it. I completely disable AV1 for YouTube by extension, but I can't completely disable it in browser itself.

When Firefox recommended a while ago in about:support to install the AV1 Video Extension I feared this will cause buggy sites to deliver now AV1 encoded content by accident that could not be hardware-decoded (due to too old hardware) while they might have been delivered something like VP9 encoded content otherwise that could have been hardware-decoded.

This never came true until today. On YouTube I found an older video ( https://www.youtube.com/watch?v=ITmOwXAlysE ) that got now delivered via AV1 and since my CPU is old too it causes a very lot of freezes on 1080p. This makes me think if I should really just disable AV1 via about:config to just get the VP9 or H.264 version of it to get the hardware-decoding back (and thus having smooth playback again at 1080p).

So yes, implementing this request could be useful in terms of buggy sites at the cost that AV1-only content can't be played anymore.

But it is worth mentioning since a few weeks/months YouTube has an issue determining the correct codec independent of the used browser (i.e. some old VP9 videos are now being delivered via H.264 - and then only some of them changed back a bit later. And now YouTube chooses AV1 on videos that had other formats before causing the performance issue mentioned in this post) and it is not unlikely to get fixed "soon".

https://www.youtube.com/account_playback
Youtube might have a separate option enabled (though yeah, I also report the same)

It might be worth mentioning that my observation was without any account and with permanent PBM enabled so pretty much anybody with default settings might encounter this issue. But it doesn't seem to be too serious right now since 3 requirements must met:

  • No AV1 hardware-decoding capabilities
  • An old/slow CPU
  • A video that is affected (currently this seems to be still rare)

And if YouTube provides even a setting if you login to workaround this that mitigates this a bit as well.

Edit: There might be even a 4th requirement: An installed AV1 decoder (like from the Microsoft Store) so yes this might be only a small issue right now.

(In reply to sworddragon2 from comment #12)

Edit: There might be even a 4th requirement: An installed AV1 decoder (like from the Microsoft Store) so yes this might be only a small issue right now.

It seems Firefox is now (or for a bit) able to play AV1 videos even without the AV1 Video Extension from the Microsoft Store being installed so this requirement got eliminated. I also noticed that there is a media.av1.use-dav1d setting so I assume Firefox has now dav1d being built-in which makes this possible. Maybe this also explains why about:support has now duplicate (and quite confusing) software/hardware video decoding columns.

But the reason I'm posting again is that it seems YouTube delivers now newer videos in AV1 and older videos in an older codec like H.264 or VP9. So this might be intentional this time but respectively I noticed performance issues again up to that point where YouTube was just unusable due to my old CPU. However, I recall a video that was mostly fine even in 1080p but it might be very dependent on the type of the video and the scenes. Also maybe dav1d makes a difference here as it is performance-focused. Maybe I did not even notice issues in some prior videos except that the UI felt subjectively significantly slower when the mini player was involved (which seemed to resolve now after enforcing other codecs).

"Unfortunately" after uninstalling the AV1 Video Extension I still had to disable media.av1.enabled for Firefox now which is not good for tracking compared to just would have been required to uninstall the AV1 Video Extemsion since that setting is not front-facing and not having any kind of AV1 support puts me probably in a very small user pool. On the other hand codecs are a difficult topic tracking-wise and even RFP probably can't do much here without risking a lot of issues but it still feels bad to being required to disable that setting now if I want to continue using services like YouTube.

To sum it up: In the almost 2 years I had now the AV1 Video Extension installed it was not a single time useful anywhere but made troubles several times. Even if my CPU would be more powerful it would just result in more power consumption and potential more sluggish UI behavior. So no matter what, I just should never have software-only support enabled for any codec in the future. All major services have fallbacks for even very old codecs anyways and the very few small sites you might run in troubles probably can't outweight the troubles you would have from software-only support.

For Firefox to improve here it probably should not expose software-only support for still too new codecs as long as viable alternatives are available and widely adopted by online services (e.g. hide the users AV1 software-only support if the system has H.264 or VP9 hardware video decoding support). Or this could be done via a shim by black-/whitelistings on sites similar to how it is done on other features but this might be just overkill and too much effort to maintain.

Could you try to set the pref media.ffvpx-hw.enabled to true and restart Firefox to see if it helps on AV1 performance? Thanks!

Flags: needinfo?(sworddragon2)

Even when I test it on a video where the performance issues were just minor there is no difference at all no matter if this setting is enabled or disabled.

Well, my CPU is also very old (AMD Phenom II X6 1045T) but my GPU is is acceptable (GeForce GTX 1650 - but it has no AV1 hardware video decoding capabilities). Most users without AV1 hardware decoding support probably have a better CPU so they might not directly notice issues on the videos but I can still see them facing other issues like a slow UI and lower battery life on mobile devices. And it is probably just too tempting for YouTube to deliver AV1 on clients even if they have no hardware video decoding support so the time might come at some point if it isn't even now (I wonder if/when they will encode and deliver older videos as well).

Flags: needinfo?(sworddragon2)

I observed this a bit more yesterday on YouTube. In the past older videos (kind of close to being 10 years old or even older) were usually delivered at default via H.264 and rarely via VP9. Newer videos (maximum to a few years old) pretty much always defaulted to VP9. But now every video that was delivered in the past via VP9 is now being delivered via AV1 even if no hardware decoding capabilities are present. This persisted even multiple browser restarts (permanent PBM, dFPI and RFP enabled, etc.) so it seems to be not a rare A/B test. And since not only a very few videos are affected like in the past this might be indeed intended by YouTube. This also confirms my subjective memories that the UI felt more slow even when I didn't notice slowdowns in some videos.

But for the test yesterday: Most videos with simple content (2D drawn like Animes) did run smooth on 1080p with the CPU utilization jumping around ~30-60% with a tendency to higher than lower values. For some other 2D drawn videos or more complex ones like 3D environments the video rendering stutters a lot up to seeing only a few frames per minute while audio always plays fine. In such scenarios the CPU utilization is usually at 70+% at minimum but I never see it constant at 100% (Task Manager metrik issues? Bottlenecks with core utilization?).

So on one half of the videos it is mostly fine but the other half is pretty much burned here unless I permanently join the media.av1.enabled=false user pool which I would prefer to avoid as I fear it might emit too much entropy.

And I pretty much expect now even more people complaining on social media like reddit that YouTube feels slow on Firefox while probably not seeing this new issue.

From my personal experience, while using stock firefox on my amd 5800H laptop with igpu, to play youtube videos, the codec chosen is always av1, and my igpu doesn't have hardware acceleration for it. CPU usage while playing videos ranges 50-60%, which is not my primary concern. However, by using extension to force vp9 codec, i get 2-2.5 hrs more battery life playing videos, which is my concern. While most in general public aren't aware enough to pin down the issue on codecs, they are smart enough to obeserve the difference in battery life while using firefox and other browsers (edge and safari default to vp9 on older hardware in youtube and netflix). This is going to adversely affect firefox's reputation and usage

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