VAAPI / HW-acceleration not working Snap-packaged Firefox

Bug #1947115 reported by Troels Petersen
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
firefox (Ubuntu)
High
Olivier Tilloy

Bug Description

I just installed Ubuntu 21.10, which packages Firefox in snap in contrary to the old .deb package way.

Now neither of my laptops (with snap packaged firefox and Ubuntu 21.10) can play videos hardware accelerated using VAAPI anymore. This means my laptops get hotter and use battery faster. It was working perfectly in Ubuntu 21.04.
I can see that the about:config has stayed untouched since the upgrade, so I have my doubts that this is related to an updated about:config.

vainfo shows full support (nothing appears broken) and I am also able to play videos in VLC using hardware acceleration, VAAPI.

The reason why I can see it is not using VAAPI is intel_gpu_top. In previous versions of Ubuntu with Firefox, I could monitor the video decoder when watching videos in Firefox. Before the upgrade it was always utilized. Now it only shows that the GPU is being used, so the video decoder is not in use.

I can't see any switch in the Application/Firefox menu regarding allowing access to video decoding hardware, so I am wondering if it simply cannot access that part of the GPU inside a snap environment?

Revision history for this message
Sebastien Bacher (seb128) wrote (last edit ):

Thank you for your bug report. Which desktop environment and session do you use? it sounds like it could be the same issue than https://bugzilla.mozilla.org/show_bug.cgi?id=1732580 which has a fix recently landing upstream and should make it to beta next

Changed in firefox (Ubuntu):
importance: Undecided → High
Olivier Tilloy (osomon)
Changed in firefox (Ubuntu):
assignee: nobody → Olivier Tilloy (osomon)
status: New → Confirmed
Revision history for this message
Olivier Tilloy (osomon) wrote :

I can confirm that this doesn't work out of the box.

When running the firefox snap with MOZ_LOG="PlatformDecoderModule:5", I can see that libva tries to load drivers from $SNAP/gnome-platform/usr/lib/x86_64-linux-gnu/dri/, where it can't find any such driver. This is bug #1947180, for which I've proposed a fix in snapcraft.

Once that is fixed, the next step is to ship said VA-API drivers, either in the firefox snap itself, or in the platform snap (gnome-3-38-2004).

Revision history for this message
Olivier Tilloy (osomon) wrote :

https://gitlab.gnome.org/Community/Ubuntu/gnome-sdk/-/merge_requests/31 adds the VA-API drivers to the gnome platform snap (gnome-3-38-2004).

Changed in firefox (Ubuntu):
status: Confirmed → In Progress
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I guess we can soon close bug 1424201?

Revision history for this message
Troels Petersen (thesleort) wrote :

I am using Wayland and the variable MOZ_ENABLE_WAYLAND=1 (I read somewhere recently that this should be default now, but I still have it set.)
I am using the Ubuntu variant of gnome shipped with Ubuntu 21.10. The default one with Ubuntu.

Revision history for this message
Vincent Chernin (vchernin) wrote :

Well I would say https://bugs.launchpad.net/bugs/1424201 isn’t properly solved until VAAPI is on by default for browsers on Ubuntu. Neither Firefox or Chromium do so yet. There’s a few bugs on the browser side that need the be solved, as mentioned in the Arch Wiki. https://wiki.archlinux.org/title/Firefox#Hardware_video_acceleration https://wiki.archlinux.org/title/Chromium#Hardware_video_acceleration.

Revision history for this message
Olivier Tilloy (osomon) wrote :

gnome-3-38-2004 version 0+git.cd626d1 (revision 87 for amd64) is now in the stable channel, so the VA-API drivers are exposed for the firefox snap and other consumer snaps.

Changed in firefox (Ubuntu):
status: In Progress → Fix Released
tags: added: snap
Revision history for this message
Troels Petersen (thesleort) wrote :

Thank you all for working and fixing this issue! It also works here.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.