You are not logged in.

#101 2019-07-03 13:53:20

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

Re: chromium: hardware video acceleration with VA-API

@maximbaz, Please try with the patch I shared. There is a possibility it can fix the issues that you're facing since it fixes the vaapi drm and vaapi BufferAllocationMode.

Offline

#102 2019-07-03 14:12:27

maximbaz
Trusted User (TU)
Registered: 2017-12-28
Posts: 22

Re: chromium: hardware video acceleration with VA-API

Okay, I've started compilation, will report in a couple of hours if everything goes fine. Fingers crossed!

Offline

#103 2019-07-03 14:35:47

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

Re: chromium: hardware video acceleration with VA-API

@maximbaz. Please report if it fails anywhere. Thank you.

Offline

#104 2019-07-03 15:14:18

afader
Member
Registered: 2013-09-12
Posts: 68

Re: chromium: hardware video acceleration with VA-API

If folks are able to compile with the patch maybe they can release a chromium-vaapi-bin with fixed patch. I don't know why I am unable to get it to compile on my system.

Offline

#105 2019-07-03 16:20:31

maximbaz
Trusted User (TU)
Registered: 2017-12-28
Posts: 22

Re: chromium: hardware video acceleration with VA-API

@akarshanbiswas it actually helped!!! And not only that, both H264 and VP9 began to work! I've pushed to chromium-vaapi and my repo in case someone wants to try.

Offline

#106 2019-07-03 19:07:04

C!HO
Member
Registered: 2007-10-02
Posts: 16

Re: chromium: hardware video acceleration with VA-API

The new build in maximbaz' repo sadly breaks VAAPI here on my Sandy Bridge IGP.

[31942:31942:0703/220420.497936:ERROR:vaapi_utils.cc(47)] vaMapBuffer failed: invalid VABufferID
[1:14:0703/220420.498263:ERROR:render_media_log.cc(27)] MediaEvent: MEDIA_ERROR_LOG_ENTRY {"error":"VDA Error 4"}

Edit: Oops, sorry my fault. My flag was set to egl, everything's working fine smile

Last edited by C!HO (2019-07-03 19:12:07)

Offline

#107 2019-07-03 19:19:30

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

Re: chromium: hardware video acceleration with VA-API

@C!HO You just gave me a heart attack! I was about to rant on intel github because of poor condition of drivers!

Offline

#108 2019-07-03 19:21:05

maximbaz
Trusted User (TU)
Registered: 2017-12-28
Posts: 22

Re: chromium: hardware video acceleration with VA-API

Haha smile I have a confirmation from one other Intel user who also confirms playback is working again smile

Offline

#109 2019-07-04 01:12:47

afader
Member
Registered: 2013-09-12
Posts: 68

Re: chromium: hardware video acceleration with VA-API

Fixed on nvidia with latest build! Thank you akarshanbiswas and maximbaz!

Offline

#110 2019-07-04 01:21:32

CarbonChauvinist
Member
Registered: 2012-06-16
Posts: 136

Re: chromium: hardware video acceleration with VA-API

C!HO wrote:

The new build in maximbaz' repo sadly breaks VAAPI here on my Sandy Bridge IGP.

[31942:31942:0703/220420.497936:ERROR:vaapi_utils.cc(47)] vaMapBuffer failed: invalid VABufferID
[1:14:0703/220420.498263:ERROR:render_media_log.cc(27)] MediaEvent: MEDIA_ERROR_LOG_ENTRY {"error":"VDA Error 4"}

Edit: Oops, sorry my fault. My flag was set to egl, everything's working fine smile

Can you expand on this? What flag was set to egl? Updating

[2019-07-03 19:42] [ALPM] upgraded chromium-vaapi-bin (75.0.3770.90-3 -> 75.0.3770.100-1)

and I've now lost VAAPI using the intel_media driver. Checking chrome://media-internals shows a VDA Error 4

vainfo
vainfo: VA-API version: 1.4 (libva 2.4.1)
vainfo: Driver version: Intel iHD driver - 1.0.0
vainfo: Supported profile and entrypoints
      VAProfileNone                   : VAEntrypointVideoProc
      VAProfileNone                   : VAEntrypointStats
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Simple            : VAEntrypointEncSlice
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointFEI
      VAProfileH264Main               : VAEntrypointEncSliceLP
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSlice
      VAProfileH264High               : VAEntrypointFEI
      VAProfileH264High               : VAEntrypointEncSliceLP
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileJPEGBaseline           : VAEntrypointVLD
      VAProfileJPEGBaseline           : VAEntrypointEncPicture
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline: VAEntrypointFEI
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSliceLP
      VAProfileVP8Version0_3          : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointEncSlice
      VAProfileHEVCMain               : VAEntrypointFEI

Last edited by CarbonChauvinist (2019-07-04 01:22:45)


"the wind-blown way, wanna win? don't play"

Offline

#111 2019-07-04 05:12:16

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

Re: chromium: hardware video acceleration with VA-API

CarbonChauvinist wrote:
C!HO wrote:

The new build in maximbaz' repo sadly breaks VAAPI here on my Sandy Bridge IGP.

[31942:31942:0703/220420.497936:ERROR:vaapi_utils.cc(47)] vaMapBuffer failed: invalid VABufferID
[1:14:0703/220420.498263:ERROR:render_media_log.cc(27)] MediaEvent: MEDIA_ERROR_LOG_ENTRY {"error":"VDA Error 4"}

Edit: Oops, sorry my fault. My flag was set to egl, everything's working fine smile

Can you expand on this? What flag was set to egl? Updating

[2019-07-03 19:42] [ALPM] upgraded chromium-vaapi-bin (75.0.3770.90-3 -> 75.0.3770.100-1)

and I've now lost VAAPI using the intel_media driver. Checking chrome://media-internals shows a VDA Error 4

vainfo
vainfo: VA-API version: 1.4 (libva 2.4.1)
vainfo: Driver version: Intel iHD driver - 1.0.0
vainfo: Supported profile and entrypoints
      VAProfileNone                   : VAEntrypointVideoProc
      VAProfileNone                   : VAEntrypointStats
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Simple            : VAEntrypointEncSlice
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointFEI
      VAProfileH264Main               : VAEntrypointEncSliceLP
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSlice
      VAProfileH264High               : VAEntrypointFEI
      VAProfileH264High               : VAEntrypointEncSliceLP
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileJPEGBaseline           : VAEntrypointVLD
      VAProfileJPEGBaseline           : VAEntrypointEncPicture
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline: VAEntrypointFEI
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSliceLP
      VAProfileVP8Version0_3          : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointEncSlice
      VAProfileHEVCMain               : VAEntrypointFEI

Show me your chrome://gpu

Offline

#112 2019-07-04 06:11:42

CarbonChauvinist
Member
Registered: 2012-06-16
Posts: 136

Re: chromium: hardware video acceleration with VA-API

Here's my chrome://gpu

Last edited by CarbonChauvinist (2019-07-04 06:12:10)


"the wind-blown way, wanna win? don't play"

Offline

#113 2019-07-04 07:16:55

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

Re: chromium: hardware video acceleration with VA-API

CarbonChauvinist wrote:

Here's my chrome://gpu

`--use-gl=egl`

You have egl enabled.

Offline

#114 2019-07-05 22:56:24

CarbonChauvinist
Member
Registered: 2012-06-16
Posts: 136

Re: chromium: hardware video acceleration with VA-API

@akarshanbiswas thanks.

Still won't work -- I've tried both "--use-gl=desktop" and not using the --use-gl flag at all in .config/chromium-flags.conf with chromium-vaapi-bin 75.0.3770.100-1 and neither worked. Here's my current:

cat .config/chromium-flags.conf
--enable-gpu-rasterization
--ignore-gpu-blacklist
--disable-gpu-driver-workarounds

In testing this further, if I downgrade to

warning: downgrading package chromium-vaapi-bin (75.0.3770.100-1 => 75.0.3770.90-3)

still no vaapi.

But, if I then add "--use-gl=egl" back into my config I get accelerated decode to work.

tl;dr:
chromium-vaapi-bin 75.0.3770.100-1 vaapi (latest) doesn't work with any of following flags (--use-gl=egl, --use-gl=desktop, not set at all)
chromium-vaapi-bin 75.0.3770.90-3 vaapi (previous) doesn't work unless I add "--use-gl=egl" flag.


"the wind-blown way, wanna win? don't play"

Offline

#115 2019-07-06 19:44:18

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

Re: chromium: hardware video acceleration with VA-API

CarbonChauvinist wrote:

@akarshanbiswas thanks.

Still won't work -- I've tried both "--use-gl=desktop" and not using the --use-gl flag at all in .config/chromium-flags.conf with chromium-vaapi-bin 75.0.3770.100-1 and neither worked. Here's my current:

cat .config/chromium-flags.conf
--enable-gpu-rasterization
--ignore-gpu-blacklist
--disable-gpu-driver-workarounds

In testing this further, if I downgrade to

warning: downgrading package chromium-vaapi-bin (75.0.3770.100-1 => 75.0.3770.90-3)

still no vaapi.

But, if I then add "--use-gl=egl" back into my config I get accelerated decode to work.

tl;dr:
chromium-vaapi-bin 75.0.3770.100-1 vaapi (latest) doesn't work with any of following flags (--use-gl=egl, --use-gl=desktop, not set at all)
chromium-vaapi-bin 75.0.3770.90-3 vaapi (previous) doesn't work unless I add "--use-gl=egl" flag.


Hmm. One other reported the same thing. I can actually fix this, but fixing it will break acceleration on Nvidia.

Offline

#116 2019-07-07 13:25:53

CarbonChauvinist
Member
Registered: 2012-06-16
Posts: 136

Re: chromium: hardware video acceleration with VA-API

For the time being, I'm just using the chromium-vaapi package, editing the PKGBUILD to remove the newly added vaapi patch, and then passing --use-gl=egl to get back to working hw decode.

--edit: Having more time to play with this I've found that wayland is contributing to the loss of vaapi, at least for me.

I ran tests playing youtube vp9 (I know I should test vp8, but couldn't quickly/easily find a vp8 youtube video to test) and h264 videos on the latest chromium-vaapi-bin package using the three available libva drivers (intel-media-driver, libva-intel-driver, libva-intel-driver-hybrid + intel-hybrid-codec-driver). Here's what I found:

1. None of the drivers' hwdecode worked with wayland sessions.

2. None of the drivers worked with xorg sessions when using the "--use-gl=egl" flag.

3. In an xorg session the standard libva (libva-intel-driver/i965) and intel media (intel-media-driver/iHD) drivers' hwdecode worked with h264 videos using the Mojo decoder.

4, In an xorg session the hybrid libva (libva-intel-driver-hybrid/i965 + intel-hybrid-codec-driver) driver hwdecode worked with both h264 and vp9 videos using Mojo decoder. Interestingly, with this driver pair, in a wayland session it at least first tried to use Mojo before falling back to Vpxdecoder for vp9 and FFMPeg decoder for h264 videos. None of the other wayland session tests tried Mojo first besides this one.

With the hybrid drivers my skylake's intel HD 530 gets an additional decode VAEntrypointVLD for VP9Profile0 which I don't have with any other driver as shown below (which IIUC is a hybrid hw/sw decode):

vainfo: VA-API version: 1.5 (libva 2.4.1)
vainfo: Driver version: Intel i965 driver for Intel(R) Skylake - 2.3.0
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            :	VAEntrypointVLD
      VAProfileMPEG2Simple            :	VAEntrypointEncSlice
      VAProfileMPEG2Main              :	VAEntrypointVLD
      VAProfileMPEG2Main              :	VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline:	VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:	VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline:	VAEntrypointEncSliceLP
      VAProfileH264ConstrainedBaseline:	VAEntrypointFEI
      VAProfileH264ConstrainedBaseline:	VAEntrypointStats
      VAProfileH264Main               :	VAEntrypointVLD
      VAProfileH264Main               :	VAEntrypointEncSlice
      VAProfileH264Main               :	VAEntrypointEncSliceLP
      VAProfileH264Main               :	VAEntrypointFEI
      VAProfileH264Main               :	VAEntrypointStats
      VAProfileH264High               :	VAEntrypointVLD
      VAProfileH264High               :	VAEntrypointEncSlice
      VAProfileH264High               :	VAEntrypointEncSliceLP
      VAProfileH264High               :	VAEntrypointFEI
      VAProfileH264High               :	VAEntrypointStats
      VAProfileH264MultiviewHigh      :	VAEntrypointVLD
      VAProfileH264MultiviewHigh      :	VAEntrypointEncSlice
      VAProfileH264StereoHigh         :	VAEntrypointVLD
      VAProfileH264StereoHigh         :	VAEntrypointEncSlice
      VAProfileVC1Simple              :	VAEntrypointVLD
      VAProfileVC1Main                :	VAEntrypointVLD
      VAProfileVC1Advanced            :	VAEntrypointVLD
      VAProfileNone                   :	VAEntrypointVideoProc
      VAProfileJPEGBaseline           :	VAEntrypointVLD
      VAProfileJPEGBaseline           :	VAEntrypointEncPicture
      VAProfileVP8Version0_3          :	VAEntrypointVLD
      VAProfileVP8Version0_3          :	VAEntrypointEncSlice
      VAProfileHEVCMain               :	VAEntrypointVLD
      VAProfileHEVCMain               :	VAEntrypointEncSlice
      VAProfileVP9Profile0            :	VAEntrypointVLD

Last edited by CarbonChauvinist (2019-07-07 16:26:10)


"the wind-blown way, wanna win? don't play"

Offline

#117 2019-07-09 15:24:17

bsdice
Member
Registered: 2016-08-06
Posts: 4

Re: chromium: hardware video acceleration with VA-API

Pentium N5000 aka Geminilake UHD 605 user here. I've now looked at the PKGBUILDs of chromium, ungoogled-chromium, ungoogled-chromium-archlinux, chromium-vaapi, and at least two more hosted on github and privately. Congrats, you guys are the winner with the most complete set of fixes+workarounds as of 75.0.3770.100-1. ;-)

By chance has anybody merged chromium-vaapi with ungoogled-chromium and might want to share a link to the PKGBUILD?

Offline

#118 2019-07-09 16:52:49

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

Re: chromium: hardware video acceleration with VA-API

bsdice wrote:

By chance has anybody merged chromium-vaapi with ungoogled-chromium and might want to share a link to the PKGBUILD?

Why would anyone wants to merge chromium-vaapi with ungoogled-chromium? Just use the vaapi-fix patch and add it to ungoogled-chromium.


BTW, @maximbaz, please add this patch back to the chromium-vaapi AUR package. Anyone who uses it will want to turn vaapi by default. If anyone is having problems can switch to the chromium package in the Arch repositories.

I have removed Nvidia blacklist from the patch as well.

Offline

#119 2019-07-10 08:09:16

goyis1000
Member
Registered: 2019-06-23
Posts: 6

Re: chromium: hardware video acceleration with VA-API

Are very good news that everything worked to fix some issues with vaapi in chromium. Also, I tried to build chromium 77.0.3824.6 and it builds successfully, I only needed to delete, update certain patches that were merged to main project of chromium and delete workarounds that are not needed anymore in the PKGBUILD. I am using right now the package that I built and I don't see any bug, vaapi still working flawlessly, I can share it here if there is not problem, I used and adapted the PKGBUILD for also work in the Open Build Service, it builds chromium very fast, the package is there.

Offline

#120 2019-08-10 15:46:07

enihcam
Member
From: Internet
Registered: 2009-12-20
Posts: 206

Re: chromium: hardware video acceleration with VA-API

@maximbaz, you may want to take a look at this:
https://lists.freedesktop.org/archives/ … 00442.html

Offline

#121 2019-08-11 08:29:16

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

Re: chromium: hardware video acceleration with VA-API

@akarshanbiswas Indeed, the vaapi-fix.patch is not required for hardware with updated VA-API driver. The patch is too specific to NVIDIA binary blobs that only provide VDPAU and use translation layer to get VA-API. The translation layer has not been update to catch up with recent libva development after version 2.0.0. Hence, it does not provide VAProfileNone. Today, the hardware with proper VA-API are Intel, as VA-API originated from them, and hardware that supported by MESA/Gallium/st_va which I had tested nouveau, r600 and radeonsi.

Without applying vaapi-fix.patch, Chromium-vaapi works on r600 and radeonsi drivers regardless of Xorg/Wayland session. Intel i965 driver requires Xorg session, Wayland does not work due to i965/libva DRI3 issues. Nouveau does not work at all for now, but they are getting close in fixing (which I believed) the final hurdle of getting to VA-API in shape for Chromium, at least for GK10x/GK20x family.

I am still not quite sure if vaapi-fix.patch actually fixed Intel i965 issues with Wayland, by simply removing the need to make use of VPP through VAProfileNone entrypoint and changing the behavior of buffer management. Intel i965 driver does have VAProfileNone entrypoint, so it sounds strange that the entrypoint was provided for nothing.

The good news is, vaapi-fix.patch does indeed make Chromium-vaapi work for NVIDIA binary blobs through libva-vdpau-driver, but crippling the rest of the *proper* drivers with valid VAProfileNone. I tested nvidia-390xx which supports renderNode. For older NVIDIA blobs such as nvidia-340xx which does not have renderNode, the patch redirects the DRM fd to "/dev/dri/nvidiactl", and I highly doubt if it is functionally equivalent to renderNode.

Offline

#122 2019-08-20 05:34:51

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

Re: chromium: hardware video acceleration with VA-API

liewkj wrote:

@akarshanbiswas Indeed, the vaapi-fix.patch is not required for hardware with updated VA-API driver. The patch is too specific to NVIDIA binary blobs that only provide VDPAU and use translation layer to get VA-API. The translation layer has not been update to catch up with recent libva development after version 2.0.0. Hence, it does not provide VAProfileNone. Today, the hardware with proper VA-API are Intel, as VA-API originated from them, and hardware that supported by MESA/Gallium/st_va which I had tested nouveau, r600 and radeonsi.

Without applying vaapi-fix.patch, Chromium-vaapi works on r600 and radeonsi drivers regardless of Xorg/Wayland session. Intel i965 driver requires Xorg session, Wayland does not work due to i965/libva DRI3 issues. Nouveau does not work at all for now, but they are getting close in fixing (which I believed) the final hurdle of getting to VA-API in shape for Chromium, at least for GK10x/GK20x family.

I am still not quite sure if vaapi-fix.patch actually fixed Intel i965 issues with Wayland, by simply removing the need to make use of VPP through VAProfileNone entrypoint and changing the behavior of buffer management. Intel i965 driver does have VAProfileNone entrypoint, so it sounds strange that the entrypoint was provided for nothing.

The good news is, vaapi-fix.patch does indeed make Chromium-vaapi work for NVIDIA binary blobs through libva-vdpau-driver, but crippling the rest of the *proper* drivers with valid VAProfileNone. I tested nvidia-390xx which supports renderNode. For older NVIDIA blobs such as nvidia-340xx which does not have renderNode, the patch redirects the DRM fd to "/dev/dri/nvidiactl", and I highly doubt if it is functionally equivalent to renderNode.

@liewkj
You're correct. This actually does hit a "dead end". I can re enable VAProfileNone but that will break Nvidia. Do we really need VPP? But anyways, we are getting vulkan video decoding implementation in 2020 so finger crossed! Maybe we might get a common api across all GPU vendors.

Offline

#123 2019-08-24 19:25:03

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

Re: chromium: hardware video acceleration with VA-API

https://bugs.freedesktop.org/show_bug.cgi?id=111213
Nouveau VA-API works for Chromium-vaapi without vaapi-fix.patch after the bug fixed.

The clean way to fix NVIDIA binary blobs compatibility is to update libva-vdpau-driver-chromium to support VAProfileNone, though this can just be a dummy entrypoint that does nothing. This would leave Chromium in clean state and never have to worry about future Chromium code refactoring.

Offline

Board footer

Powered by FluxBB