Score:1

VA-API support in Firefox Snap

in flag

In 21.04, I was able to successfully enable VA-API support for Firefox for hardware video acceleration using my amdgpu on Wayland. Mainly, following steps from https://ubuntuhandbook.org/index.php/2021/08/enable-hardware-video-acceleration-va-api-for-firefox-in-ubuntu-20-04-18-04-higher/

Since upgraded to 21.10, I've noticed increased CPU usage when playing youtube videos. When I checked by running firefox from command line, I can see that I can't seems to open vaapi driver correctly:

$ /snap/bin/firefox 
Importing existing firefox profiles from /home/ymchen/.mozilla/firefox
Found default profile: dhjf4r7r.default-1587103347891
Import done in 3.141 s
amdgpu: os_same_file_description couldn't determine if two DRM fds reference the same file description.
If they do, bad things may happen!
libva info: VA-API version 1.7.0
libva info: Trying to open /snap/firefox/631/gnome-platform/usr/lib/x86_64-linux-gnu/dri/radeonsi_drv_video.so
libva info: va_openDriver() returns -1
libva info: VA-API version 1.7.0
libva info: Trying to open /snap/firefox/631/gnome-platform/usr/lib/x86_64-linux-gnu/dri/radeonsi_drv_video.so
libva info: va_openDriver() returns -1

Installing firefox from apt, I can see that vaapi still works:

$ /usr/bin/firefox
libva info: VA-API version 1.12.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/radeonsi_drv_video.so
libva info: Found init function __vaDriverInit_1_12
libva info: va_openDriver() returns 0
libva info: VA-API version 1.12.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/radeonsi_drv_video.so
libva info: Found init function __vaDriverInit_1_12
libva info: va_openDriver() returns 0
libva info: VA-API version 1.12.0

Curiously, VA-API version available in snap version is older 1.7.0 compared to the apt installed version 1.12.0. Perhaps the "packaged" version of the dependencies in snap version is outdated?

I've also noticed that the file /snap/firefox/631/gnome-platform/usr/lib/x86_64-linux-gnu/dri/radeonsi_drv_video.so does not exist. Perhaps Firefox maintainers forgot to package it into the snap?

Yes, I can just use the apt version but I'd like try to support the snap version as has more directly support from upstream Firefox developers but without VA-API, it is often annoying to hear the CPU fan spin up when watching videos.

Any idea how to get Firefox snap to work with VA-API? Thanks

Nmath avatar
ng flag
I would suggest filing a bug report or feature request with Mozilla who publishes the snap. In the meantime as a workaround, if the deb package from `apt` works, I suggest using that version.
N0rbert avatar
zw flag
Does this answer your question? [21.10 Firefox Missing Profiles](https://askubuntu.com/questions/1369493/21-10-firefox-missing-profiles) ← remove snapped version, install deb instead.
sonofusion82 avatar
in flag
@N0rbert nope, I know deb version works. but my question is specifically about getting snapped version to work.
sonofusion82 avatar
in flag
@Nmath, thanks. i'll try to submit request to mozilla too.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.