You are not logged in.

#376 2020-06-25 21:48:49

sadboi777
Member
Registered: 2020-05-22
Posts: 21

Re: chromium: hardware video acceleration with VA-API

Btw Chromium-vaapi from archlinuxcn repo still doesn't work with the new mesa update if anyone is interested. Maybe I gotta wait for a new version of chromium-vaapi from them.

Offline

#377 2020-06-26 00:11:12

liewkj
Member
Registered: 2019-07-08
Posts: 210

Re: chromium: hardware video acceleration with VA-API

I have started using openSUSE build service. For those interested in VA-API and Wayland, the packages are available at:
https://download.opensuse.org/repositor … ch/x86_64/

chromium-vaapi-83.0.4103.116-1-x86_64.pkg.tar.xz
mesa-20.1.2-1-x86_64.pkg.tar.xz

To verify the new EGL extension in mesa:

$ es2_info | grep sync
    EGL_ANDROID_blob_cache, EGL_ANDROID_native_fence_sync,
    EGL_CHROMIUM_sync_control, EGL_ANGLE_sync_control_rate,
    EGL_KHR_fence_sync, EGL_KHR_get_all_proc_addresses, EGL_KHR_gl_colorspace,
    EGL_KHR_no_config_context, EGL_KHR_reusable_sync,
    EGL_KHR_wait_sync, EGL_MESA_configless_context, EGL_MESA_drm_image,
    GL_NV_fbo_color_attachments, GL_OES_EGL_image_external, GL_OES_EGL_sync,

While AMD GPUs do not require EGL interop for VA-API because MESA VA drivers support necessary plumbing for display, `--use-gl=egl` eliminates the need for LIBVA_DRIVER_NAME env override. This is another hint that EGL is native language for Wayland.

Offline

#378 2020-06-28 08:56:21

digitalone
Member
Registered: 2011-08-19
Posts: 350

Re: chromium: hardware video acceleration with VA-API

@liewkj I tried both packages, but keep getting sync issues and high cpu usage with egl flag enabled.

Offline

#379 2020-06-28 09:29:03

liewkj
Member
Registered: 2019-07-08
Posts: 210

Re: chromium: hardware video acceleration with VA-API

Run chromium from terminal and post the logs and link to sample videos and the output of xrandr. If you don't help me to gather details to reproduce, then I cannot help you.
I assumed you had verified the existence of new EGL extension per instructions.
They worked on Ryzen 2500U.

Last edited by liewkj (2020-06-28 09:40:30)

Offline

#380 2020-06-28 16:51:59

akarshanbiswas
Member
Registered: 2019-06-22
Posts: 33

Re: chromium: hardware video acceleration with VA-API

@digitalone After testing enough, I can confidently say that Firefox vaapi is superior than current chromium-vaapi. They have fixed the shuttering and frame skips and uses ffmpeg (which is also used by mpv) to decode via vaapi.
Firefox uses 1% cpu while playing a 1080p 60fps h264 video on my system.

I wish chromium could have used a similar implementation like that. ffmpeg is great at dealing with driver bugs.

Offline

#381 2020-06-29 06:39:00

digitalone
Member
Registered: 2011-08-19
Posts: 350

Re: chromium: hardware video acceleration with VA-API

liewkj wrote:

Run chromium from terminal and post the logs and link to sample videos and the output of xrandr. If you don't help me to gather details to reproduce, then I cannot help you.
I assumed you had verified the existence of new EGL extension per instructions.
They worked on Ryzen 2500U.

Can't help, already reverted back to upstream version. I verified the existence of EGL extension and I assume xrandr is not working on Gnome Wayland.

Using AMDGPU on

$ lspci | grep -e VGA -e 3D
00:01.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Mullins [Radeon R3 Graphics] (rev 40)

Anyway, as I said before, chromium-vaapi is working good using linux-lts kernel while I get short freezes using linux kernel only on 1080p60 format.

Last edited by digitalone (2020-06-29 06:41:20)

Offline

#382 2020-06-29 07:01:57

liewkj
Member
Registered: 2019-07-08
Posts: 210

Re: chromium: hardware video acceleration with VA-API

digitalone wrote:

I assume xrandr is not working on Gnome Wayland.

Nope, xrandr still works on GNOME/Wayland through XWayland. If xrandr is not working for you, then the new EGL extension will fail, too, which results in bogus sync error. Then this becomes AMD driver issue.

Offline

#383 2020-06-30 08:17:08

digitalone
Member
Registered: 2011-08-19
Posts: 350

Re: chromium: hardware video acceleration with VA-API

Firefox 78 came out. Did some test, it's working flawlessly.

Au revoir chromium-vaapi, but big thanks anyway to all people who made vaapi patch a reality in the last years in spite of Google stubbornness, especially maximbaz and liewkj.

Last edited by digitalone (2020-06-30 08:18:27)

Offline

#384 2020-07-08 01:21:47

sadboi777
Member
Registered: 2020-05-22
Posts: 21

Re: chromium: hardware video acceleration with VA-API

Wow Chromium from regular Arch repos works for video acceleration now while chromium-vaapi from archlinuxcn was having problems with the new mesa and gnome-shell. Feels good using chromium from an official repo. Thank you Arch devs and maintainers.

Offline

#385 2020-07-08 09:44:11

jeois
Member
Registered: 2020-07-08
Posts: 7

Re: chromium: hardware video acceleration with VA-API

sadboi777 wrote:

Wow Chromium from regular Arch repos works for video acceleration now while chromium-vaapi from archlinuxcn was having problems with the new mesa and gnome-shell. Feels good using chromium from an official repo. Thank you Arch devs and maintainers.

Unfortunately, the official Arch chromium doesn't work with my configuration.   Be sure to check if hardware video acceleration is actually enabled by going to chrome://media-internals like the wiki says. 
If  the player says  kVideoDecoderName    "VpxVideoDecoder" instead of "MojoVideoDecoder"  then it is still using the software decoder regardless of what chrome://gpu says.

Before the most recent updates, 'chromium-vaapi' worked fine with 'libva-vdpau-driver-vp9', both from the AUR.  Now, the archlinuxcn version is having dependency issues with re2 and won't launch, and I haven't bothered to build it myself yet.  Since I'm using nvidia proprietary drivers and KDE, I probably wouldn't have problems with the new mesa and gnome-shell.  Instead, I'm getting this error at the bottom of chrome://gpu

"...ERROR:vaapi_video_decode_accelerator.cc(674)] : Failed to initialize VppVaapiWrapper"

BTW, all the various appropriate statuses in chrome://gpu says "Hardware accelerated" but it doesn't want to play with this particular driver.  Apparently, whatever the regular Arch chromium build does to enable VA-API is different from 'chromium-vaapi' AUR package.   

I can think of two solutions, but they're not very appealing:
1) Compile/build chromium-vaapi from source  (It takes several hours, and there's no guarantee it still works)
2) Use a browser extension to force H.264 codec instead of VP9  (the reason I chose this driver is because neither libva-vdpau-driver nor libva-vdpau-driver-chromium ever actually enabled "MojoVideoDecoder" for anything, including h264, during video playback)

Is anyone else using nvidia and va-api (on X11, of course)?  How did you get it to work?  I've tried the other methods listed in AUR posts and Arch wiki, but they're either out-of-date or didn't work for me.  Now, the only method that recently worked, doesn't.

I would much rather just use Firefox, but it doesn't have VP9 enabled either and only works for Wayland as of yet (opposite problem of Chromium).  I read they're going to include X11 support in version 80, but the stable version of FF is only 78.0.1 as of posting.  It's very unfortunate for these regressions to appear.  Why is it so difficult to get these browsers to use hardware video acceleration when most (streaming) media players have had it for many years? (That was a rhetorical question smile I have a general idea)

Last edited by jeois (2020-07-08 09:52:55)

Offline

#386 2020-07-08 12:43:32

sadboi777
Member
Registered: 2020-05-22
Posts: 21

Re: chromium: hardware video acceleration with VA-API

jeois wrote:
sadboi777 wrote:

Wow Chromium from regular Arch repos works for video acceleration now while chromium-vaapi from archlinuxcn was having problems with the new mesa and gnome-shell. Feels good using chromium from an official repo. Thank you Arch devs and maintainers.

Unfortunately, the official Arch chromium doesn't work with my configuration.   Be sure to check if hardware video acceleration is actually enabled by going to chrome://media-internals like the wiki says. 
If  the player says  kVideoDecoderName    "VpxVideoDecoder" instead of "MojoVideoDecoder"  then it is still using the software decoder regardless of what chrome://gpu says.

Before the most recent updates, 'chromium-vaapi' worked fine with 'libva-vdpau-driver-vp9', both from the AUR.  Now, the archlinuxcn version is having dependency issues with re2 and won't launch, and I haven't bothered to build it myself yet.  Since I'm using nvidia proprietary drivers and KDE, I probably wouldn't have problems with the new mesa and gnome-shell.  Instead, I'm getting this error at the bottom of chrome://gpu

"...ERROR:vaapi_video_decode_accelerator.cc(674)] : Failed to initialize VppVaapiWrapper"

BTW, all the various appropriate statuses in chrome://gpu says "Hardware accelerated" but it doesn't want to play with this particular driver.  Apparently, whatever the regular Arch chromium build does to enable VA-API is different from 'chromium-vaapi' AUR package.   

I can think of two solutions, but they're not very appealing:
1) Compile/build chromium-vaapi from source  (It takes several hours, and there's no guarantee it still works)
2) Use a browser extension to force H.264 codec instead of VP9  (the reason I chose this driver is because neither libva-vdpau-driver nor libva-vdpau-driver-chromium ever actually enabled "MojoVideoDecoder" for anything, including h264, during video playback)

Is anyone else using nvidia and va-api (on X11, of course)?  How did you get it to work?  I've tried the other methods listed in AUR posts and Arch wiki, but they're either out-of-date or didn't work for me.  Now, the only method that recently worked, doesn't.

I would much rather just use Firefox, but it doesn't have VP9 enabled either and only works for Wayland as of yet (opposite problem of Chromium).  I read they're going to include X11 support in version 80, but the stable version of FF is only 78.0.1 as of posting.  It's very unfortunate for these regressions to appear.  Why is it so difficult to get these browsers to use hardware video acceleration when most (streaming) media players have had it for many years? (That was a rhetorical question smile I have a general idea)

It is working for me on Intel igpus. I have checked it already, it is using Mojovideodecoder on Youtube and also checked through intel_gpu_top.

H.264 looks worse than vp9 with larger file size, I'd not recommend using it. Maybe wait for archlinuxcn version to be updated? Firefox video acceleration is coming soon too and it will use ffmpeg which is a much better approach imo. Using Nvida in Linux, especially a cutting-edge distro like Arch is tough man.

Also, I thought it was the gnome window manager that was having problems with the archlinuxcn version, but it was re2 so  thanks for letting me know. But yeah the AUR version has been updated to work with the new version of re2 it seems, your best bet is to compile that or wait for the archlinuxcn guys to put out a new version.

Last edited by sadboi777 (2020-07-08 12:51:01)

Offline

#387 2020-07-08 15:35:01

jeois
Member
Registered: 2020-07-08
Posts: 7

Re: chromium: hardware video acceleration with VA-API

sadboi777 wrote:

H.264 looks worse than vp9 with larger file size, I'd not recommend using it. Maybe wait for archlinuxcn version to be updated? Firefox video acceleration is coming soon too and it will use ffmpeg which is a much better approach imo. Using Nvida in Linux, especially a cutting-edge distro like Arch is tough man.

Also, I thought it was the gnome window manager that was having problems with the archlinuxcn version, but it was re2 so  thanks for letting me know. But yeah the AUR version has been updated to work with the new version of re2 it seems, your best bet is to compile that or wait for the archlinuxcn guys to put out a new version.

Thanks for the suggestions.

Yeah, I'm using Firefox while I wait for the archlinuxcn to update their build.  If I compile it, I'll probably just have to do it again very soon.  The 'chromium-vaapi' AUR page says there's another pre-compiled binary hosted on openSUSE servers, but I'm not sure about its version dependencies either (e.g. re2).

You're right about using VDPAU translation like 'libva-vdpau-driver-vp9' for Nvidia is a bit of a hassle, but it used to work fine.  The only thing which didn't work were the 360 degree videos, and those are rare.  To be completely honest, I can usually spare the CPU cycles and see no significant performance difference with Firefox or Chromium, but it feels bad to have the GPU underutilized.

Unfortunately for Firefox, its hardware video acceleration only supports Wayland as of now, and doesn't enable VP9 for Xorg even in version 80, which is a ways off from being released (current stable is 78.0.1)  FFmpeg supports a wide variety of codecs and drivers, and hopefully they'll fully implement it eventually.

Offline

#388 2020-07-09 10:22:11

svito
Member
From: Ukraine
Registered: 2018-12-25
Posts: 19

Re: chromium: hardware video acceleration with VA-API

jeois You lie as it says on the Chromium Wiki article that for NVIDIA proprietary driver you should get AUR package, for which liewkj also kindly provided unofficial repository, see top attached AUR comment.

I updated wiki on the 4th of July, and you claiming its outdated yesterday is also a lie. There is no explicit mention of archlinuxcn on Chromium page, as I removed it especially because their package got out-of-date, now it seems they've updated it: https://pkgs.org/search/?q=chromium-vaapi

On second page of comments which you also did not care to read, I said that official package lacks VDPAU patch which only present in AUR package.

Last edited by svito (2020-07-09 10:30:39)

Offline

#389 2020-07-28 07:10:18

luigifcruz
Member
Registered: 2020-07-28
Posts: 2

Re: chromium: hardware video acceleration with VA-API

jeois wrote:

1) Compile/build chromium-vaapi from source  (It takes several hours, and there's no guarantee it still works)

I can confirm is this the case. I did compile the `chromium-vaapi` from source and the Hardware Decoding began to work as intended with `libva-vdpau-driver-vp9-git` patches. There is definetly something wrong with `chromium` patch. Does anyone know the best way I can file a bug report?

Chromium Version 84.0.4147.89 (Official Build) Manjaro Linux (64-bit)

Offline

#390 2020-07-28 13:11:23

sadboi777
Member
Registered: 2020-05-22
Posts: 21

Re: chromium: hardware video acceleration with VA-API

luigifcruz wrote:
jeois wrote:

1) Compile/build chromium-vaapi from source  (It takes several hours, and there's no guarantee it still works)

I can confirm is this the case. I did compile the `chromium-vaapi` from source and the Hardware Decoding began to work as intended with `libva-vdpau-driver-vp9-git` patches. There is definetly something wrong with `chromium` patch. Does anyone know the best way I can file a bug report?

Chromium Version 84.0.4147.89 (Official Build) Manjaro Linux (64-bit)

Go on Manjaro forums. This forum is for Arch users.

It's not a bug. The chromium in the mainline repos only supports hardware decoding videos on Intel iGPUs. And for AUR you are clearly told what to do for AMD and Nvidia GPUs.

Last edited by sadboi777 (2020-07-28 13:25:20)

Offline

#391 2020-07-28 17:06:55

luigifcruz
Member
Registered: 2020-07-28
Posts: 2

Re: chromium: hardware video acceleration with VA-API

sadboi777 wrote:

Go on Manjaro forums. This forum is for Arch users.

Sorry, but I don't see how my distro matter in this case. I was just trying to help folks (Arch Users) here with the exact same problem I was having. Therefore, this seems a relevant topic for this thread.

Anyway, thanks for the clarification. I thought the patch introduced here worked with other GPUs. But I now undestand that the nvidia-vdpau.patch is also needed for this to work with Nvidia hardware.

Last edited by luigifcruz (2020-07-28 20:24:27)

Offline

#392 2020-08-14 12:30:14

jmandawg
Member
Registered: 2011-10-19
Posts: 60

Re: chromium: hardware video acceleration with VA-API

I was excited to see vaapi is finally available in the official repos.  Works great on my intel laptop, but not on my nvidia GPU.

Any chance of getting the nvidia patch into the official repo build? 

Thanks for all the great work guys.

Offline

#393 2020-08-25 19:27:10

foutrelis
Developer
From: Athens, Greece
Registered: 2008-07-28
Posts: 705
Website

Re: chromium: hardware video acceleration with VA-API

Heads up: Chromium 85 started using angle by default which doesn't work with vaapi yet; you'll need to add --use-gl=desktop to your flags.

Chromium 86 should support angle+vaapi based on these changes. At that point, it should also be possible to drop --ignore-gpu-blacklist (along with --use-gl=...) and either use --enable-accelerated-video-decode or enable the flag in chrome://flags.

Edit: Dropped the --use-gl=egl suggestion as it doesn't work.

Last edited by foutrelis (2020-08-29 08:25:55)

Offline

#394 2020-08-26 05:11:48

Toolybird
Member
Registered: 2017-09-30
Posts: 76

Re: chromium: hardware video acceleration with VA-API

foutrelis wrote:

Heads up: Chromium 85 started using angle by default

Ahh, that probably explains why I'm now seeing all kinds of crazy graphical glitches and screen corruption in latest chromium (and google-chrome).

Radeon RX 570 Series. Only "fix" so far:

"Use hardware acceleration when available" -> off

Offline

#395 2020-08-26 10:55:35

sadboi777
Member
Registered: 2020-05-22
Posts: 21

Re: chromium: hardware video acceleration with VA-API

foutrelis wrote:

Heads up: Chromium 85 started using angle by default which doesn't work with vaapi yet; you'll need to add --use-gl=desktop or --use-gl=egl to your flags.

Chromium 86 should support angle+vaapi based on these changes. At that point, it should also be possible to drop --ignore-gpu-blacklist (along with --use-gl=...) and either use --enable-accelerated-video-decode or enable the flag in chrome://flags.

Just as VAAPI support lands in Firefox. Someone should update the wiki on this.

Last edited by sadboi777 (2020-08-26 20:37:58)

Offline

#396 2020-08-26 19:17:46

justkdng
Member
From: 日本
Registered: 2019-10-08
Posts: 46

Re: chromium: hardware video acceleration with VA-API

Always wondered why @liewkj removed angle and swiftshader from chromium-vaapi. Are those a must for chromium 85?


GPG key: 3DEA 6251 3C80 3538 3A24  5A12 E578 6B42 E8E5 D565

Offline

#397 2020-08-26 21:13:47

tmathmeyer
Member
From: Kirkland, WA
Registered: 2013-09-17
Posts: 20

Re: chromium: hardware video acceleration with VA-API

sadboi777 wrote:
foutrelis wrote:

Heads up: Chromium 85 started using angle by default which doesn't work with vaapi yet; you'll need to add --use-gl=desktop or --use-gl=egl to your flags.

Chromium 86 should support angle+vaapi based on these changes. At that point, it should also be possible to drop --ignore-gpu-blacklist (along with --use-gl=...) and either use --enable-accelerated-video-decode or enable the flag in chrome://flags.

Just as VAAPI support lands in Firefox. Someone should update the wiki on this.

I'm updating the wiki right now in fact (I also landed those CL's upstream for vaapi)
Currently seeing about getting use_vaapi=true by default in all linux builds, but it's breaking a ton of tests and test infrastructure.

I've also only tested it on two intel-cpu machines, and had an engineer from intel test it out too, so no guarantees it'll even work on an amd chip, and it certainly won't work as-is on an nvidia system.
I'm sure there's a big variety of machines between everyone posting here, so if you do see crashes, or weird behavior, you should definitely open a bug and set me as the owner (tmathmeyer@chromium.org). I'd like to get it working on some of the longer tail of machines by at least 88.

Offline

#398 2020-08-27 20:26:59

sadboi777
Member
Registered: 2020-05-22
Posts: 21

Re: chromium: hardware video acceleration with VA-API

tmathmeyer wrote:
sadboi777 wrote:
foutrelis wrote:

Heads up: Chromium 85 started using angle by default which doesn't work with vaapi yet; you'll need to add --use-gl=desktop or --use-gl=egl to your flags.

Chromium 86 should support angle+vaapi based on these changes. At that point, it should also be possible to drop --ignore-gpu-blacklist (along with --use-gl=...) and either use --enable-accelerated-video-decode or enable the flag in chrome://flags.

Just as VAAPI support lands in Firefox. Someone should update the wiki on this.

I'm updating the wiki right now in fact (I also landed those CL's upstream for vaapi)
Currently seeing about getting use_vaapi=true by default in all linux builds, but it's breaking a ton of tests and test infrastructure.

I've also only tested it on two intel-cpu machines, and had an engineer from intel test it out too, so no guarantees it'll even work on an amd chip, and it certainly won't work as-is on an nvidia system.
I'm sure there's a big variety of machines between everyone posting here, so if you do see crashes, or weird behavior, you should definitely open a bug and set me as the owner (tmathmeyer@chromium.org). I'd like to get it working on some of the longer tail of machines by at least 88.

Wow we have actual chromium devs in this forum. Man I love this distro. The decision to switch to AVGLE on chromium 85 on Linux is kinda weird as WebGL and other graphics acceleration also doesn't work now on Linux by default. --use-gl=desktop is a must rn.

Offline

#399 2020-08-28 23:00:37

liewkj
Member
Registered: 2019-07-08
Posts: 210

Re: chromium: hardware video acceleration with VA-API

foutrelis wrote:

Heads up: Chromium 85 started using angle by default which doesn't work with vaapi yet; you'll need to add --use-gl=desktop or --use-gl=egl to your flags.

Using --use-gl=egl does not work for official extra/chromium because of the upstream bug. AUR chromium-vaapi patched it out for Wayland/EGL. Regardless of X.Org or Wayland session, --use-gl=egl simply doesn't work until the bug was fixed.

Offline

#400 2020-08-29 13:47:53

sadboi777
Member
Registered: 2020-05-22
Posts: 21

Re: chromium: hardware video acceleration with VA-API

liewkj wrote:
foutrelis wrote:

Heads up: Chromium 85 started using angle by default which doesn't work with vaapi yet; you'll need to add --use-gl=desktop or --use-gl=egl to your flags.

Using --use-gl=egl does not work for official extra/chromium because of the upstream bug. AUR chromium-vaapi patched it out for Wayland/EGL. Regardless of X.Org or Wayland session, --use-gl=egl simply doesn't work until the bug was fixed.

VAAPI with --use-gl=desktop works on my machine. Will check the the other flag and report.

Offline

Board footer

Powered by FluxBB