You are not logged in.

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

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

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: 164

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: 268

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: 164

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: 31

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: 268

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: 164

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: 268

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 Yesterday 01:21:47

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

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 Yesterday 09:44:11

jeois
Member
Registered: Yesterday
Posts: 2

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 (Yesterday 09:52:55)

Offline

#386 Yesterday 12:43:32

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

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 (Yesterday 12:51:01)

Offline

#387 Yesterday 15:35:01

jeois
Member
Registered: Yesterday
Posts: 2

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

Board footer

Powered by FluxBB