You are not logged in.

#1 2022-06-16 18:47:19

diniamo
Member
Registered: 2022-06-15
Posts: 107

[SOLVED] Firefox hardware video accerelation doesn't work

Hey, I'm trying to do hardware acceleration with my nvidia card, and I think my X11 is using it, but I can't get it working on firefox. The only place I notice it is Twitch, youtube seems to play fine. I looked all around the wiki and other forums and couldn't find anything.

Here are a few things I think I should provide:

  • I'm using the Deepin desktop environment with X11.

  • printenv | grep DRIVER produces:

    VDPAU_DRIVER=nvidia
    LIBVA_DRIVER_NAME=nvidia
  • vainfo produces:

    vaInitialize failed with error code -1 (unknown libva error),exit
  • strace vainfo

NOTE: I think my mpv is also using software decode from looking at the logs but it doesn't lag

Last edited by diniamo (2022-06-22 18:58:17)

Offline

#2 2022-06-17 15:36:33

philo
Member
Registered: 2015-01-26
Posts: 251

Re: [SOLVED] Firefox hardware video accerelation doesn't work

Offline

#3 2022-06-17 17:14:23

progandy
Member
Registered: 2012-05-17
Posts: 5,184

Re: [SOLVED] Firefox hardware video accerelation doesn't work

Did you install nvidia-vaapi-driver from the AUR?


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Online

#4 2022-06-17 21:48:55

diniamo
Member
Registered: 2022-06-15
Posts: 107

Re: [SOLVED] Firefox hardware video accerelation doesn't work

progandy wrote:

Did you install nvidia-vaapi-driver from the AUR?

I followed the steps, the only thing it has done is make my windows white instead of the usual dark color.

I also cannot start nvidia-settings now:

(nvidia-settings:3018): GLib-GObject-CRITICAL **: 23:45:25.715: g_value_set_boxed: assertion 'G_VALUE_HOLDS_BOXED (value)' failed

(nvidia-settings:3018): Gtk-WARNING **: 23:45:25.723: Theme parsing error: gtk.css:3611:22: 'none' is not a valid color name
[1]    3018 segmentation fault (core dumped)  nvidia-settings

Twitch stream still lagging.

Offline

#5 2022-06-17 21:57:54

diniamo
Member
Registered: 2022-06-15
Posts: 107

Re: [SOLVED] Firefox hardware video accerelation doesn't work

I've tried the steps on the wiki page, and the other forum post doesn't seem to have anything that could help.

Offline

#6 2022-06-17 22:07:24

mmbossoni
Member
Registered: 2011-01-10
Posts: 21

Re: [SOLVED] Firefox hardware video accerelation doesn't work

Check required steps on https://github.com/elFarto/nvidia-vaapi-driver
Make sure to remove any vdpau bridge you have as well (lib32-libva-vdpau-driver and libva-vdpau-driver) before installing nvidia-vaapi-driver from aur

Long story short: it requires too many steps to be "usable"

Offline

#7 2022-06-17 22:19:59

seth
Member
Registered: 2012-09-03
Posts: 49,979

Re: [SOLVED] Firefox hardware video accerelation doesn't work

diniamo wrote:
progandy wrote:

Did you install nvidia-vaapi-driver from the AUR?

I followed the steps, the only thing it has done is make my windows white instead of the usual dark color.

What "steps"? Also nvidia-vaapi-driver isn't gonna make nvidia-settings segfault.
Did you run a partial update to install the package?
Please post the nvidia-settings coredump, https://wiki.archlinux.org/title/Core_d … _core_dump

ALso update on

vainfo

Did/do you have libva-vdpau-driver (or libva-vdpau-driver-chromium from the AUR)?

The only place I notice it is Twitch, youtube seems to play fine …  I think my mpv is also using software decode

Output of

mpv someporn.mp4
mpv -vo vdpau -hwdec vdpau someporn.mp4
mpv -vo gpu someporn.mp4

?

There's a chance that twitch hands you a codec that your HW cannot decode.

Offline

#8 2022-06-18 08:01:39

diniamo
Member
Registered: 2022-06-15
Posts: 107

Re: [SOLVED] Firefox hardware video accerelation doesn't work

mmbossoni wrote:

Check required steps on https://github.com/elFarto/nvidia-vaapi-driver
Make sure to remove any vdpau bridge you have as well (lib32-libva-vdpau-driver and libva-vdpau-driver) before installing nvidia-vaapi-driver from aur

Long story short: it requires too many steps to be "usable"

Yeah I've noticed it, why can't it be just one package install sad(

Also that's what I said, I followed the steps on that page.

I have libvdpau installed, but I can't uninistall it because it's required by some other packages

Last edited by diniamo (2022-06-18 08:24:13)

Offline

#9 2022-06-18 08:47:29

diniamo
Member
Registered: 2022-06-15
Posts: 107

Re: [SOLVED] Firefox hardware video accerelation doesn't work

seth wrote:
diniamo wrote:
progandy wrote:

Did you install nvidia-vaapi-driver from the AUR?

I followed the steps, the only thing it has done is make my windows white instead of the usual dark color.

What "steps"? Also nvidia-vaapi-driver isn't gonna make nvidia-settings segfault.
Did you run a partial update to install the package?
Please post the nvidia-settings coredump, https://wiki.archlinux.org/title/Core_d … _core_dump

ALso update on

vainfo

Did/do you have libva-vdpau-driver (or libva-vdpau-driver-chromium from the AUR)?

The only place I notice it is Twitch, youtube seems to play fine …  I think my mpv is also using software decode

Output of

mpv someporn.mp4
mpv -vo vdpau -hwdec vdpau someporn.mp4
mpv -vo gpu someporn.mp4

?

There's a chance that twitch hands you a codec that your HW cannot decode.

OK so, it seems like one of my issues was that I forgot to run grub-mkconfig after setting the DRM thing there. I did that, rebooted, but everything is the same except the window borders are back to dark somehow.

For the steps I took: I cloned the git version from AUR, then installed the 3 needed packages (look bellow), ran makepkg, then sudo pacman -U *.tar.*
Then I set the options the github mentioned in my firefox about:config, and I also added the environment variable I needed to, which I also confirmed using printenv.
Yes, I ran sudo pacman -Syu before installing gst-plugins-bad, because it wouldn't let me otherwise.

On the core dump part, I'm not sure if you are asking for the result of coredumpctl info nvidia-settings, or the file itself (/usr/bin/nvidia-settings). So here is both:
https://gist.github.com/diniamo/68953f2 … c8acd80259
https://drive.google.com/file/d/1gnKsXn … sp=sharing

Well vainfo runs now, so I did something right at least:

vainfo: VA-API version: 1.14 (libva 2.14.0)
vainfo: Driver version: VA-API NVDEC driver
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            :	VAEntrypointVLD
      VAProfileMPEG2Main              :	VAEntrypointVLD
      VAProfileVC1Simple              :	VAEntrypointVLD
      VAProfileVC1Main                :	VAEntrypointVLD
      VAProfileVC1Advanced            :	VAEntrypointVLD
      <unknown profile>               :	VAEntrypointVLD
      VAProfileH264Main               :	VAEntrypointVLD
      VAProfileH264High               :	VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:	VAEntrypointVLD
      VAProfileHEVCMain               :	VAEntrypointVLD
      VAProfileVP8Version0_3          :	VAEntrypointVLD
      VAProfileVP9Profile0            :	VAEntrypointVLD

sudo pacman -Q | grep vdpau:

libvdpau 1.5-1
vdpauinfo 1.4-2

I tried uninstalling them but these packages depend on it apparently: ffmpeg, mpv, nvidia-settings

And finally, here is the output of the mvp commands.

Offline

#10 2022-06-18 12:36:39

diniamo
Member
Registered: 2022-06-15
Posts: 107

Re: [SOLVED] Firefox hardware video accerelation doesn't work

Update: something is still wrong with my DE, some animations are gone and my terminator background isn't transparent anymore

Offline

#11 2022-06-18 15:21:59

seth
Member
Registered: 2012-09-03
Posts: 49,979

Re: [SOLVED] Firefox hardware video accerelation doesn't work

Was there any issue w/ the mpv playback?
(You're defaulting to GPU and vdpau gets the usual warning, but no further complaints either)

nvidia-settings crashes in EGL

 eglinfo | head -32

I have libvdpau installed

nvidia-vaapi-driver crosses w/ libva-vdpau-driver (the latter should™ have gotten you vaapi w/o further efforts, but idk whther it's sufficient for FF)

Please also post your xorg log, https://wiki.archlinux.org/title/Xorg#General

Offline

#12 2022-06-18 15:32:52

diniamo
Member
Registered: 2022-06-15
Posts: 107

Re: [SOLVED] Firefox hardware video accerelation doesn't work

What egl??? I use X. Shell can't even find the command eglinfo

So what do I do about libvdpau?

Xorg log: https://gist.github.com/diniamo/85d7c73 … a71b2fec0c

Offline

#13 2022-06-18 15:40:08

seth
Member
Registered: 2012-09-03
Posts: 49,979

Re: [SOLVED] Firefox hardware video accerelation doesn't work

Shell can't even find the command eglinfo

mesa-utils

So what do I do about libvdpau?

Nothing. you brought this up in error.

Xorg log looks ok, but you should remove the nvidia-settings generated /etc/X11/xorg.conf - it's full of cruft and might gloss over actual problems.

Offline

#14 2022-06-18 19:37:01

diniamo
Member
Registered: 2022-06-15
Posts: 107

Re: [SOLVED] Firefox hardware video accerelation doesn't work

eglinfo | head -32:

EGL client extensions string:
    EGL_EXT_platform_base EGL_EXT_device_base EGL_EXT_device_enumeration
    EGL_EXT_device_query EGL_KHR_client_get_all_proc_addresses
    EGL_EXT_client_extensions EGL_KHR_debug EGL_KHR_platform_x11
    EGL_EXT_platform_x11 EGL_EXT_platform_device EGL_KHR_platform_wayland
    EGL_EXT_platform_wayland EGL_KHR_platform_gbm EGL_MESA_platform_gbm
    EGL_MESA_platform_xcb EGL_MESA_platform_surfaceless

GBM platform:
EGL API version: 1.5
EGL vendor string: NVIDIA
EGL version string: 1.5
EGL client APIs: OpenGL_ES OpenGL
EGL extensions string:
    EGL_EXT_buffer_age EGL_EXT_client_sync
    EGL_EXT_create_context_robustness EGL_EXT_image_dma_buf_import
    EGL_EXT_image_dma_buf_import_modifiers EGL_MESA_image_dma_buf_export
    EGL_EXT_output_base EGL_EXT_output_drm EGL_EXT_protected_content
    EGL_EXT_stream_consumer_egloutput EGL_EXT_stream_acquire_mode
    EGL_EXT_sync_reuse EGL_IMG_context_priority EGL_KHR_config_attribs
    EGL_KHR_create_context_no_error EGL_KHR_context_flush_control
    EGL_KHR_create_context EGL_KHR_fence_sync
    EGL_KHR_get_all_proc_addresses EGL_KHR_partial_update
    EGL_KHR_swap_buffers_with_damage EGL_KHR_no_config_context
    EGL_KHR_gl_colorspace EGL_KHR_gl_renderbuffer_image
    EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_3D_image
    EGL_KHR_gl_texture_cubemap_image EGL_KHR_image EGL_KHR_image_base
    EGL_KHR_reusable_sync EGL_KHR_stream EGL_KHR_stream_attrib
    EGL_KHR_stream_consumer_gltexture EGL_KHR_stream_cross_process_fd
    EGL_KHR_stream_fifo EGL_KHR_stream_producer_eglsurface
    EGL_KHR_surfaceless_context EGL_KHR_wait_sync EGL_NV_nvrm_fence_sync
    EGL_NV_quadruple_buffer EGL_NV_stream_consumer_eglimage

Oh and I didn't answer one of your questions, the video plays just fine with all 3 commands.

Offline

#15 2022-06-18 20:10:41

seth
Member
Registered: 2012-09-03
Posts: 49,979

Re: [SOLVED] Firefox hardware video accerelation doesn't work

So mpv is actually HW accelerated.

Does nvidia-settings still segfault?
Are you sure deepin is on X11, not wayland ("loginctl session-status")?

Finally: twitch.
Is there a way to inspect the video it hands out or dump the stream?
You should also check the firefox task manager which thread takes the brunt of the CPU - maybe the website just runs a shitty JS or mines some bit… oh, I forgot: they're "now" worthless big_smile

Offline

#16 2022-06-18 20:23:34

progandy
Member
Registered: 2012-05-17
Posts: 5,184

Re: [SOLVED] Firefox hardware video accerelation doesn't work

It looks like mpv was running with vdpau video decoding. I suggest you also try to tell it to only use vaapi just like firefox to test that it works as well:

mpv --vo=gpu --hwdec=vaapi video.mp4

Last edited by progandy (2022-06-18 20:25:07)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Online

#17 2022-06-18 20:27:30

diniamo
Member
Registered: 2022-06-15
Posts: 107

Re: [SOLVED] Firefox hardware video accerelation doesn't work

Yes nvidia-settings still thorws the same error.

Service: lightdm; type x11; class user

I can't find the CPU usage in firefox task manager.
Here are the information I could find about twitch player:

Video Resolution 1920x1080

Display Resolution 1580x894

FPS 53

Skipped Frames 0

Buffer Size 1.57 sec.

Latency To Broadcaster 1.63 sec.

Latency Mode Low Latency

Playback Bitrate 4928 Kbps

Backend Version 1.11.0-twitch.2-rc.1

Serving ID <random numbers and letters>

Codecs avc1.64002A,mp4a.40.2

Play Session ID <random numbers and letters>

Protocol HLS

Also, I'm guessing the reason nvidia-settings fails is the same reason my DE is a bit fucked

Last edited by diniamo (2022-06-18 20:28:55)

Offline

#18 2022-06-18 20:35:51

seth
Member
Registered: 2012-09-03
Posts: 49,979

Re: [SOLVED] Firefox hardware video accerelation doesn't work

seth wrote:

Did you run a partial update to install the package?

sudo pacman -Syu

twitch streams h264

About the FF TM, the "Energy Impact" (d'ohh - please no hard data, but some aggregated BS value…) might be a usable indicator.

Offline

#19 2022-06-18 20:46:20

diniamo
Member
Registered: 2022-06-15
Posts: 107

Re: [SOLVED] Firefox hardware video accerelation doesn't work

Why are you qouting those 2 messages?

Meaning?

Idk what you want me to say, twitch energy impact is definetly the highest

Offline

#20 2022-06-18 21:06:35

seth
Member
Registered: 2012-09-03
Posts: 49,979

Re: [SOLVED] Firefox hardware video accerelation doesn't work

Meaning: you didn't answer that question.
And the second one isn't a quote but a command - and you're supposed to know what that does.

I guess the FF TM also aggregates one tab and doesn't allow you to see which threads are actually the most hungry?

Offline

#21 2022-06-19 08:44:32

diniamo
Member
Registered: 2022-06-15
Posts: 107

Re: [SOLVED] Firefox hardware video accerelation doesn't work

I guess I didn't quote, but I meant what does

twitch streams h264

mean?

Well I know what it does, it looks for any available package updates (y), and downloads and installs them (u).

Yes, it does aggregate I think.

Offline

#22 2022-06-19 11:29:32

seth
Member
Registered: 2012-09-03
Posts: 49,979

Re: [SOLVED] Firefox hardware video accerelation doesn't work

Means your GPU can decode that in HW and the idea was to run a system update in case you had done a partial update before (to explain the nvidia-settings segfaults)

Offline

#23 2022-06-19 12:27:14

diniamo
Member
Registered: 2022-06-15
Posts: 107

Re: [SOLVED] Firefox hardware video accerelation doesn't work

So what would be the next step?

Offline

#24 2022-06-19 12:57:17

seth
Member
Registered: 2012-09-03
Posts: 49,979

Re: [SOLVED] Firefox hardware video accerelation doesn't work

Did you run a full update and does nvidia-settings still crash?
Then check nvidia-smi while playing a Twitch video, though youtube being fine and vaapi now working (did you try to use it explicitly on mpv as progandy suggested?) it's increasingly likely a "twitch sucks" thing.
You should also check what FF thinks about your config in "about:support"

Offline

#25 2022-06-19 13:20:42

diniamo
Member
Registered: 2022-06-15
Posts: 107

Re: [SOLVED] Firefox hardware video accerelation doesn't work

I'm not sure if you are reffering to sudo pacman -Syu by "full upgrade", but I ran it and everything is the same (nvidia-settings crashes, DE isn't back to normal).

nvidia-smi: https://gist.github.com/diniamo/395c8f7 … 84526077de

The vaapi mvp command (it doesn't play the vid, its just green): https://gist.github.com/diniamo/9530199 … 09976061da
So that means vaapi doesn't work after all?

For the FF about:support part it says Webrender (software)
Here is what I think is relevant: https://gist.github.com/diniamo/814afee … 3530b31de6

Last edited by diniamo (2022-06-20 20:56:48)

Offline

Board footer

Powered by FluxBB