You are not logged in.

#1026 2024-05-31 08:03:03

lukp0t
Member
Registered: 2022-07-31
Posts: 14

Re: chromium: hardware video acceleration with VA-API

expoodo wrote:

Tried using the patch from hmann, but I still can't get vaapi to work yet (at least for Youtube videos + h264ify) on chromium 120.0.6099.129 and X11.

[10101:10101:0102/010719.677963:WARNING:sandbox_linux.cc(400)] : InitializeSandbox() called with multiple threads in process gpu-process.
[10101:10101:0102/010805.751357:ERROR:shared_image_factory.cc(951)] : Could not find SharedImageBackingFactory with params: usage: DisplayRead|Scanout, format: (Y_UV, 420, 8unorm, ExtSamplerOn), share_between_threads: 0, gmb_type: platform, debug_label: MailboxVideoFrameConverter_Cid:9_Pid:10226
[10101:10101:0102/010805.752193:ERROR:shared_image_stub.cc(250)] : SharedImageStub: Unable to create shared image
[10101:10101:0102/010805.758882:ERROR:shared_image_manager.cc(220)] : SharedImageManager::ProduceSkia: Trying to Produce a Skia representation from a non-existent mailbox.

Any luck for me?

I get the same errors as yours with Mesa 24.1 and Chromium 125. Did you find any solution?

Offline

#1027 2024-05-31 16:52:52

prydom
Member
From: Western Canada
Registered: 2014-12-07
Posts: 11

Re: chromium: hardware video acceleration with VA-API

lukp0t wrote:

I get the same errors as yours with Mesa 24.1 and Chromium 125. Did you find any solution?

What GPU do you have?

If you have an AMD one, you need to enable Vulkan - either on x11 now or optionally with Wayland once the Arch Chromium package rebuilds for 125.0.6422.141. Hmann's patch works by conforming the VA-API behavior but Chromium only triggers the correct code path when Vulkan is used as the render backend.

If it's Intel, you didn't need hmann's patch (which is now available at https://archlinux.org/packages/extra/x86_64/mesa/ regardless) but you do need to add VaapiVideoDecodeLinuxGL to your Chromium feature flags. Not sure about NVIDIA.

Offline

#1028 2024-05-31 17:31:23

lukp0t
Member
Registered: 2022-07-31
Posts: 14

Re: chromium: hardware video acceleration with VA-API

prydom wrote:

What GPU do you have?.

It's an old laptop with Radeon R5 graphics (which might be the case, as HW acceleration works fine on my main PC.). Mainly using it for YouTube and hardware acceleration was all fine until Chromium 116. I just sticked with 115 before Hmann's patch was merged.

I'm using these flags:

--ozone-platform=x11
--use-gl=angle
--use-angle=vulkan
--enable-features=Vulkan,VulkanFromANGLE,DefaultANGLEVulkan,PlatformHEVCDecoderSupport,UseMultiPlaneFormatForHardwareVideo,VaapiVideoDecoder,VaapiIgnoreDriverChecks,VaapiVideoEncoder

And getting this when I try to play any video:

[10692:10692:0531/195436.365059:ERROR:shared_image_factory.cc(985)] : Could not find SharedImageBackingFactory with params: usage: DisplayRead|Scanout, format: (Y_UV, 420, 8unorm, ExtSamplerOn), share_between_threads: 0, gmb_type: platform, debug_label: MailboxVideoFrameConverter_Pid:10887
[10692:10692:0531/195436.365785:ERROR:shared_image_stub.cc(291)] : SharedImageStub: Unable to create shared image

Offline

#1029 2024-05-31 19:22:42

prydom
Member
From: Western Canada
Registered: 2014-12-07
Posts: 11

Re: chromium: hardware video acceleration with VA-API

lukp0t wrote:

It's an old laptop with Radeon R5 graphics

Are you using "amdvlk" by any chance? Review https://wiki.archlinux.org/title/AMDGPU#Installation if you aren't sure.
You want to be using https://docs.mesa3d.org/drivers/radv.html (packaged in Arch as https://archlinux.org/packages/extra/x8 … an-radeon/) if you can. Chromium has a bunch of workarounds for "amdvlk" and I would not be surprised if one interfered.

Something else to check is if libva-mesa-driver is installed and if `vainfo` does contain the codec for the video you're testing with.

Last edited by prydom (2024-05-31 19:27:24)

Offline

#1030 2024-06-01 07:49:06

lukp0t
Member
Registered: 2022-07-31
Posts: 14

Re: chromium: hardware video acceleration with VA-API

prydom wrote:

Are you using "amdvlk" by any chance?

No, it doesn't work for me, I have vulkan-radeon.

Here's the output of vainfo:

Trying display: wayland
Trying display: x11
vainfo: VA-API version: 1.21 (libva 2.21.0)
vainfo: Driver version: Mesa Gallium driver 24.1.0-arch1.1 for AMD Radeon R5 Graphics (radeonsi, kabini, LLVM 17.0.6, DRM 3.57, 6.9.2-zen1-1-zen)
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            :	VAEntrypointVLD
      VAProfileMPEG2Main              :	VAEntrypointVLD
      VAProfileVC1Simple              :	VAEntrypointVLD
      VAProfileVC1Main                :	VAEntrypointVLD
      VAProfileVC1Advanced            :	VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:	VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:	VAEntrypointEncSlice
      VAProfileH264Main               :	VAEntrypointVLD
      VAProfileH264Main               :	VAEntrypointEncSlice
      VAProfileH264High               :	VAEntrypointVLD
      VAProfileH264High               :	VAEntrypointEncSlice
      VAProfileNone                   :	VAEntrypointVideoProc

Pretty sure H264 should work, well as it did before. So I'm really confused what's wrong.

Offline

#1031 2024-06-01 22:56:58

adi222
Member
Registered: 2023-01-03
Posts: 11

Re: chromium: hardware video acceleration with VA-API

Works for me on 6650xt with mesa 24.1 using these flags:
--use-angle=vulkan
--enable-features=Vulkan,VulkanFromANGLE,DefaultANGLEVulkan,VaapiIgnoreDriverChecks,VaapiVideoDecoder,UseMultiPlaneFormatForHardwareVideo,VaapiVideoEncoder

with xwayland, on wayland it disabled gpu for anything in browser, chrome 125.0.6422.141

edit: With https://aur.archlinux.org/packages/goog … and-vulkan works even with full wayland using --ozone-platform=wayland

Last edited by adi222 (2024-06-01 23:01:01)

Offline

#1032 2024-06-02 02:06:42

hduyudh
Member
Registered: 2016-03-13
Posts: 9

Re: chromium: hardware video acceleration with VA-API

I absolutely love this massive thread. I will contribute my part by showing what worked for me on my hardware:

Google Chrome version 125.0.6422.141 (from google-chrome AUR)
Thinkpad P14s G4 with AMD 7840U
Plasma 6.0.5 on Wayland with mesa 24.1
Using basic recommended setup from AMDGPU archwiki page and VAAPI on Hardware Acceleration page
6.9.3-arch1 vanilla kernel

Chrome flags:

--enable-features=VaapiVideoDecoder,VaapiVideoEncoder,UseChromeOSDirectVideoDecoder,VaapiIgnoreDriverChecks,Vulkan,DefaultANGLEVulkan,VulkanFromANGLE
--use-gl=angle
--use-angle=vulkan
--use-vulkan=native
--ignore-gpu-blocklist
--enable-zero-copy
--enable-gpu-rasterization
--enable-native-gpu-memory-buffers
--enable-gpu-memory-buffer-video-frames

Last edited by hduyudh (2024-06-02 02:24:18)

Offline

#1033 2024-06-05 15:46:39

Ventil1
Member
Registered: 2010-03-17
Posts: 143

Re: chromium: hardware video acceleration with VA-API

jr1991 wrote:

I noticed the patch works just fine on AMD, but it produces a lot of tearing on GeForce Now, making it unfit to game on. Does anyone else here experienced this? Using the latest stable version of Google Chrome. It occurs on all chromium derivatives as well. On X11 and xWayland.

The tearing is happening on my AMD Ryzen 7 6800U, 680M too with the latest mesa 24.1, wayland and latest Brave v1.66.118.
I am using these flags:

--enable-features=VaapiVideoDecoder,VaapiVideoEncoder,UseMultiPlaneFormatForHardwareVideo,VaapiIgnoreDriverChecks,Vulkan,DefaultANGLEVulkan,VulkanFromANGLE
--use-angle=vulkan

The youtube hardware acceleration finnaly started working. But the tearing is so annoying sometimes that I will disable the flags now which will disable the hardware acceleration again.

Offline

#1034 2024-06-05 15:59:03

CBiX
Member
Registered: 2013-07-15
Posts: 21

Re: chromium: hardware video acceleration with VA-API

Ventil1 wrote:

The youtube hardware acceleration finnaly started working. But the tearing is so annoying sometimes that I will disable the flags now which will disable the hardware acceleration again.

Make sure to include

--ozone-platform-hint=auto

to actually enable Wayland support. Also try with the chromium package, Brave might not include the patch that allows Wayland + Vulkan.

Last edited by CBiX (2024-06-05 16:00:28)

Offline

#1035 2024-06-06 12:45:04

Ventil1
Member
Registered: 2010-03-17
Posts: 143

Re: chromium: hardware video acceleration with VA-API

CBiX wrote:

Make sure to include

--ozone-platform-hint=auto

to actually enable Wayland support. Also try with the chromium package, Brave might not include the patch that allows Wayland + Vulkan.


Just tried with that flag, but the hardware acceleration doesn't work then on youtube.
I tried the bottom flag too and it doesn't work then either.

--ozone-platform=wayland

Offline

#1036 2024-06-07 08:36:57

spiffeeroo
Member
Registered: 2021-04-23
Posts: 23

Re: chromium: hardware video acceleration with VA-API

Ventil1 wrote:

Just tried with that flag, but the hardware acceleration doesn't work then on youtube.
I tried the bottom flag too and it doesn't work then either.

--ozone-platform=wayland

Are you using the Chromium package in the Arch Linux repo? The Arch package includes a patch to enable Va-api acceleration in Wayland. It will not work for brave-bin in the AUR. The google-chrome AUR package also does not have Va-api acceleration in Wayland. The google-chrome-wayland-vulkan AUR package works with Va-api in Wayland.

chrome://media-internals/

event: kPlay
kIsVideoDecryptingDemuxerStream: false
kVideoDecoderName: VaapiVideoDecoder
kIsPlatformVideoDecoder: true
dimensions: 3840x2160
kResolution: 3840x2160
duration: 871.201
pipeline_buffering_state: [object Object]
video_buffering_state: [object Object]

Last edited by spiffeeroo (2024-06-07 08:48:35)

Offline

#1037 2024-06-10 18:34:18

xuanrui
Member
Registered: 2018-09-27
Posts: 48

Re: chromium: hardware video acceleration with VA-API

Does the Vulkan support work only with mesa drivers?
cos I'm using nvidia and it certainly doesn't work for me

Offline

#1038 2024-06-14 10:00:56

0BADC0DE
Member
From: Regnum Utriusque Siciliae
Registered: 2018-02-21
Posts: 314

Re: chromium: hardware video acceleration with VA-API

[NEWS]

I just found out that MS Teams video conferencing on my browser (Vivaldi 6.7.3329.41 (Stable channel) stable (64-bit) ) uses hw accelerated encoding/decoding.
I could see that with "sudo intel_gpu_top".
I also tested that Google Meet and Zoom still use sw encoder/decoder.
It would be nice to know how it works!
Vivaldi, like any other chromium-based browser, supports "WebRTC hardware video encoding/decoding" only on Android (where it is pretty useless) and ChromeOS (where it makes senes) as per "vivaldi://flags".
Nonetheless I saw both "Video" and "VideoEnhance" values going up and down during my calls.

My system:

GPU:  Intel Corporation TigerLake-LP GT2 [Iris Xe Graphics] (rev 01)
Kernel Version : 6.9.4.zen1-1
Plasma Version : 6.0.5-2
KDE Version : 24.05.1-1
Frameworks Version : 6.3.0-1
Qt5 Version : 5.15.14+kde+r7-1
Qt6 Version : 6.7.1-4
Wayland Version : 1.23.0-1
XOrg/Wayland Version : 24.1.0-1
Mesa Version : 1:24.1.1-1
LibVA Version : 2.21.0-1
VDPAU Version : 1.5-2
LIBVA_DRIVER_NAME=iHD
VDPAU_DRIVER=va_gl

Browser options:

--enable-features=VaapiVideoDecodeLinuxGL,VaapiVideoEncoder,CanvasOopRasterization --password-store=kwallet5 --ignore-gpu-blocklist --enable-webrtc-hw-decoding --enable-webrtc-hw-encoding --ozone-platform=wayland --use-gl=angle --use-angle=gl

Last edited by 0BADC0DE (2024-06-14 11:41:26)


Maybe Computers Will Never Become As Intelligent
As Humans. Surely They Won't Ever Become So Stupid.

Offline

#1039 2024-06-14 10:35:45

darkbasic
Member
Registered: 2015-06-22
Posts: 44

Re: chromium: hardware video acceleration with VA-API

lukp0t wrote:

Pretty sure H264 should work, well as it did before. So I'm really confused what's wrong.

Be aware that Youtube won't serve you h264 anymore unless you use something like h264ify.

Offline

#1040 2024-06-14 11:35:56

0BADC0DE
Member
From: Regnum Utriusque Siciliae
Registered: 2018-02-21
Posts: 314

Re: chromium: hardware video acceleration with VA-API

darkbasic wrote:
lukp0t wrote:

Pretty sure H264 should work, well as it did before. So I'm really confused what's wrong.

Be aware that Youtube won't serve you h264 anymore unless you use something like h264ify.

YT hw decoding works great to me (vivaldi browser) and I don't have any specific extension (only "Plasma integration").

Last edited by 0BADC0DE (2024-06-14 11:36:10)


Maybe Computers Will Never Become As Intelligent
As Humans. Surely They Won't Ever Become So Stupid.

Offline

#1041 2024-06-14 12:42:29

darkbasic
Member
Registered: 2015-06-22
Posts: 44

Re: chromium: hardware video acceleration with VA-API

0BADC0DE wrote:

YT hw decoding works great to me (vivaldi browser) and I don't have any specific extension (only "Plasma integration").

I guess your hardware supports vp9 because otherwise it falls back to software decoding rather than h264.

Offline

#1042 2024-06-14 13:03:56

0BADC0DE
Member
From: Regnum Utriusque Siciliae
Registered: 2018-02-21
Posts: 314

Re: chromium: hardware video acceleration with VA-API

darkbasic wrote:
0BADC0DE wrote:

YT hw decoding works great to me (vivaldi browser) and I don't have any specific extension (only "Plasma integration").

I guess your hardware supports vp9 because otherwise it falls back to software decoding rather than h264.

I don't think so...
vdapuinfo says I only have h.264.

Decoder capabilities:

name                        level macbs width height
----------------------------------------------------
MPEG1                          --- not supported ---
MPEG2_SIMPLE                   --- not supported ---
MPEG2_MAIN                     --- not supported ---
H264_BASELINE                  51 16384  2048  2048
H264_MAIN                      51 16384  2048  2048
H264_HIGH                      51 16384  2048  2048
VC1_SIMPLE                     --- not supported ---
VC1_MAIN                       --- not supported ---
VC1_ADVANCED                   --- not supported ---
MPEG4_PART2_SP                 --- not supported ---
MPEG4_PART2_ASP                --- not supported ---
DIVX4_QMOBILE                  --- not supported ---
DIVX4_MOBILE                   --- not supported ---
DIVX4_HOME_THEATER             --- not supported ---
DIVX4_HD_1080P                 --- not supported ---
DIVX5_QMOBILE                  --- not supported ---
DIVX5_MOBILE                   --- not supported ---
DIVX5_HOME_THEATER             --- not supported ---
DIVX5_HD_1080P                 --- not supported ---
H264_CONSTRAINED_BASELINE      51 16384  2048  2048
H264_EXTENDED                  --- not supported ---
H264_PROGRESSIVE_HIGH          --- not supported ---
H264_CONSTRAINED_HIGH          --- not supported ---
H264_HIGH_444_PREDICTIVE       --- not supported ---
VP9_PROFILE_0                  --- not supported ---
VP9_PROFILE_1                  --- not supported ---
VP9_PROFILE_2                  --- not supported ---
VP9_PROFILE_3                  --- not supported ---
HEVC_MAIN                      --- not supported ---
HEVC_MAIN_10                   --- not supported ---
HEVC_MAIN_STILL                --- not supported ---
HEVC_MAIN_12                   --- not supported ---
HEVC_MAIN_444                  --- not supported ---
HEVC_MAIN_444_10               --- not supported ---
HEVC_MAIN_444_12               --- not supported ---
AV1_MAIN                       --- not supported ---
AV1_HIGH                       --- not supported ---
AV1_PROFESSIONAL               --- not supported ---

Maybe Computers Will Never Become As Intelligent
As Humans. Surely They Won't Ever Become So Stupid.

Offline

#1043 2024-06-14 13:22:10

darkbasic
Member
Registered: 2015-06-22
Posts: 44

Re: chromium: hardware video acceleration with VA-API

That's really weird, this is not how youtube behaved last time I've had an h264 only video card.
Also youtube doesn't encode anything beyond 1080p or 30fps in h264.

Offline

#1044 2024-06-14 14:17:30

Bzzz_56
Member
Registered: 2021-05-14
Posts: 34

Re: chromium: hardware video acceleration with VA-API

0BADC0DE wrote:
darkbasic wrote:
0BADC0DE wrote:

YT hw decoding works great to me (vivaldi browser) and I don't have any specific extension (only "Plasma integration").

I guess your hardware supports vp9 because otherwise it falls back to software decoding rather than h264.

I don't think so...
vdapuinfo says I only have h.264.

Decoder capabilities:

name                        level macbs width height
----------------------------------------------------
MPEG1                          --- not supported ---
MPEG2_SIMPLE                   --- not supported ---
MPEG2_MAIN                     --- not supported ---
H264_BASELINE                  51 16384  2048  2048
H264_MAIN                      51 16384  2048  2048
H264_HIGH                      51 16384  2048  2048
VC1_SIMPLE                     --- not supported ---
VC1_MAIN                       --- not supported ---
VC1_ADVANCED                   --- not supported ---
MPEG4_PART2_SP                 --- not supported ---
MPEG4_PART2_ASP                --- not supported ---
DIVX4_QMOBILE                  --- not supported ---
DIVX4_MOBILE                   --- not supported ---
DIVX4_HOME_THEATER             --- not supported ---
DIVX4_HD_1080P                 --- not supported ---
DIVX5_QMOBILE                  --- not supported ---
DIVX5_MOBILE                   --- not supported ---
DIVX5_HOME_THEATER             --- not supported ---
DIVX5_HD_1080P                 --- not supported ---
H264_CONSTRAINED_BASELINE      51 16384  2048  2048
H264_EXTENDED                  --- not supported ---
H264_PROGRESSIVE_HIGH          --- not supported ---
H264_CONSTRAINED_HIGH          --- not supported ---
H264_HIGH_444_PREDICTIVE       --- not supported ---
VP9_PROFILE_0                  --- not supported ---
VP9_PROFILE_1                  --- not supported ---
VP9_PROFILE_2                  --- not supported ---
VP9_PROFILE_3                  --- not supported ---
HEVC_MAIN                      --- not supported ---
HEVC_MAIN_10                   --- not supported ---
HEVC_MAIN_STILL                --- not supported ---
HEVC_MAIN_12                   --- not supported ---
HEVC_MAIN_444                  --- not supported ---
HEVC_MAIN_444_10               --- not supported ---
HEVC_MAIN_444_12               --- not supported ---
AV1_MAIN                       --- not supported ---
AV1_HIGH                       --- not supported ---
AV1_PROFESSIONAL               --- not supported ---

why vdpau... what is listed in vainfo?

Offline

#1045 2024-06-14 14:19:05

0BADC0DE
Member
From: Regnum Utriusque Siciliae
Registered: 2018-02-21
Posts: 314

Re: chromium: hardware video acceleration with VA-API

darkbasic wrote:

That's really weird, this is not how youtube behaved last time I've had an h264 only video card.
Also youtube doesn't encode anything beyond 1080p or 30fps in h264.

Yes, indeed.
But this what happens to me.
Maybe someone else can provide for more tests and possibly compare their setup with mine.
When I will get also Zoom, Meet and Slack Huddles work like that I will be really happy: it's the only pesky thing so far on mi ArchLinux daily driver.


Maybe Computers Will Never Become As Intelligent
As Humans. Surely They Won't Ever Become So Stupid.

Offline

#1046 2024-06-14 15:43:40

seth
Member
Registered: 2012-09-03
Posts: 58,246

Re: chromium: hardware video acceleration with VA-API

You can rightclick the video and check the "stats for nerds" to see what kind of video codec YT hands you.

Offline

#1047 2024-06-14 20:27:40

0BADC0DE
Member
From: Regnum Utriusque Siciliae
Registered: 2018-02-21
Posts: 314

Re: chromium: hardware video acceleration with VA-API

seth wrote:

You can rightclick the video and check the "stats for nerds" to see what kind of video codec YT hands you.

It says "av01.0.08M.08 (399)" for the video,
SHOT-20240614-222105-0200.png

Last edited by 0BADC0DE (2024-06-14 20:29:44)


Maybe Computers Will Never Become As Intelligent
As Humans. Surely They Won't Ever Become So Stupid.

Offline

#1048 2024-06-14 20:33:15

seth
Member
Registered: 2012-09-03
Posts: 58,246

Re: chromium: hardware video acceleration with VA-API

That's https://en.wikipedia.org/wiki/AV1 and according to your vdpauinfo output not supported, but I'd agree with Bzzz_56 that you want to look at vainfo

Offline

#1049 2024-06-15 07:25:08

0BADC0DE
Member
From: Regnum Utriusque Siciliae
Registered: 2018-02-21
Posts: 314

Re: chromium: hardware video acceleration with VA-API

My vainfo output.

It looks like there is both support for a number of codecs: MPEG2, VC1, H264, HEVC and VP9 among a few others.
Unluckily I have partial knowledge on how this gfx stack is organized and works.


Maybe Computers Will Never Become As Intelligent
As Humans. Surely They Won't Ever Become So Stupid.

Offline

#1050 2024-06-15 12:28:31

seth
Member
Registered: 2012-09-03
Posts: 58,246

Re: chromium: hardware video acceleration with VA-API

VDPAU is mostly an nvidia thing and you'll only use it through a translation layer and not at all with browsers.
The VAAPI situation is relevant and you're getting an AV1 video that your IGP can decode in HW.

Offline

Board footer

Powered by FluxBB