You are not logged in.

#1051 2024-06-15 12:55:49

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

Re: chromium: hardware video acceleration with VA-API

seth wrote:

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.

I thought that VDPAU was more hw agnostic. But it could be my lack of knowledge.
Anyway, this means that anyone using, at least, Xe iGPU can get the same. Which is good imho.

Last edited by 0BADC0DE (2024-06-15 13:07:53)


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

Offline

#1052 2024-06-15 13:34:04

YOLO
Member
Registered: 2024-06-09
Posts: 4

Re: chromium: hardware video acceleration with VA-API

For me, hardware acceleration doesn't work on chromium-based browsers on wayland with a 5800H

Only the following works under xwayland (checked with the media tab in devtools)

--enable-features=Vulkan,VulkanFromANGLE,DefaultANGLEVulkan,VaapiIgnoreDriverChecks,VaapiVideoDecoder,VaapiVideoEncoder

Tested on google-chrome (126.0.6478.61) and microsoft-edge-dev (127.0.2638.2)

vainfo output:

Trying display: wayland
vainfo: VA-API version: 1.21 (libva 2.21.0)
vainfo: Driver version: Mesa Gallium driver 24.1.1-arch1.1 for AMD Radeon Graphics (radeonsi, renoir, LLVM 17.0.6, DRM 3.57, 6.9.4-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
      VAProfileHEVCMain               : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointEncSlice
      VAProfileHEVCMain10             : VAEntrypointVLD
      VAProfileHEVCMain10             : VAEntrypointEncSlice
      VAProfileJPEGBaseline           : VAEntrypointVLD
      VAProfileVP9Profile0            : VAEntrypointVLD
      VAProfileVP9Profile2            : VAEntrypointVLD
      VAProfileNone                   : VAEntrypointVideoProc

Edit: Edge is weird. It randomly doesn't offload to the GPU and needs a restart for it to start working again. Not sure if it happens on chrome as well.

Also, vp9 hardware acceleration doesn't work in either chrome or edge, but works in firefox

Lost touchpad gestures (pinch to zoom and horizontal overscroll for going backwards/forwards in history) as well. Any idea how to get it back (under xwayland)?

Last edited by YOLO (2024-06-15 13:44:07)

Offline

#1053 2024-06-15 16:41:35

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

Re: chromium: hardware video acceleration with VA-API

You will get your answer a few posts back, basically you either need chromium or a binary patched version of chrome from the aur.

Offline

#1054 2024-06-15 17:02:10

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

Re: chromium: hardware video acceleration with VA-API

Can you try vlc with vaapi decoder enabled over different encoded videos?
From cli you can see whether hw assisted decoding works. If it does, the. The problem is in the browser .


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

Offline

#1055 2024-06-15 17:02:48

YOLO
Member
Registered: 2024-06-09
Posts: 4

Re: chromium: hardware video acceleration with VA-API

Patched chrome doesn't work for me, and neither does chromium (also, the patch was reverted on chromium from what I can see). Wayland results in a crash on the patched version, and without wayland, it's just like any other chromium based browser

Offline

#1056 2024-06-15 17:04:56

YOLO
Member
Registered: 2024-06-09
Posts: 4

Re: chromium: hardware video acceleration with VA-API

0BADC0DE wrote:

Can you try vlc with vaapi decoder enabled over different encoded videos?
From cli you can see whether hw assisted decoding works. If it does, the. The problem is in the browser .

vlc, mpv and Firefox all work properly on wayland. It's only chromium browsers that don't work for me

Offline

#1057 2024-06-15 17:26:16

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

Re: chromium: hardware video acceleration with VA-API

No it's not been reverted in Arch Linux, only upstream and that's why Chrome won't work without the binary patch.

Last edited by darkbasic (2024-06-15 17:26:49)

Offline

#1058 2024-06-15 19:36:43

YOLO
Member
Registered: 2024-06-09
Posts: 4

Re: chromium: hardware video acceleration with VA-API

YOLO wrote:

For me, hardware acceleration doesn't work on chromium-based browsers on wayland with a 5800H

Only the following works under xwayland (checked with the media tab in devtools)

--enable-features=Vulkan,VulkanFromANGLE,DefaultANGLEVulkan,VaapiIgnoreDriverChecks,VaapiVideoDecoder,VaapiVideoEncoder

Tested on google-chrome (126.0.6478.61) and microsoft-edge-dev (127.0.2638.2)

vainfo output:

Trying display: wayland
vainfo: VA-API version: 1.21 (libva 2.21.0)
vainfo: Driver version: Mesa Gallium driver 24.1.1-arch1.1 for AMD Radeon Graphics (radeonsi, renoir, LLVM 17.0.6, DRM 3.57, 6.9.4-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
      VAProfileHEVCMain               : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointEncSlice
      VAProfileHEVCMain10             : VAEntrypointVLD
      VAProfileHEVCMain10             : VAEntrypointEncSlice
      VAProfileJPEGBaseline           : VAEntrypointVLD
      VAProfileVP9Profile0            : VAEntrypointVLD
      VAProfileVP9Profile2            : VAEntrypointVLD
      VAProfileNone                   : VAEntrypointVideoProc

Edit: Edge is weird. It randomly doesn't offload to the GPU and needs a restart for it to start working again. Not sure if it happens on chrome as well.

Also, vp9 hardware acceleration doesn't work in either chrome or edge, but works in firefox

Lost touchpad gestures (pinch to zoom and horizontal overscroll for going backwards/forwards in history) as well. Any idea how to get it back (under xwayland)?

Ok, after a few more hours, I can say this setup is unreliable. chrome, chromium and edge randomly fall back to software decoding and then need a restart. Hardware acceleration also only worked for me for h264 videos on YouTube. In other places (e.g., Twitter), it was either software decoding or, on one occasion, hardware decoding activating, but the video not playing.

Last edited by YOLO (2024-06-15 19:37:12)

Offline

#1059 2024-06-16 07:59:05

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

Re: chromium: hardware video acceleration with VA-API

I wonder what is preventing Zoom, Slack and Meet from using hw-assisted en/decoding.
I feel puzzled by the fact that Teams can but Meet (Google's brainchild) cannot.
Can that be due to JS libraries?
I my very specific case, I don't mind about YT decoding too much. I mind about WebRTC communication services.
Almost everything works fine with my Xe Intel GPU.

Last edited by 0BADC0DE (2024-06-16 08:20:51)


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

Offline

#1060 2024-06-17 22:12:56

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

Re: chromium: hardware video acceleration with VA-API

CBiX wrote:
Bzzz_56 wrote:

Is hevc decoding broken in google-chrome on amdgpu? It works in chromium (xwayland) with mesa 24.1 but not in google-chrome-wayland-vulkan (either ozone wayland or ozone x11).

Can't reproduce on 5850U, but maybe it depends on the hardware. vainfo yields

      VAProfileHEVCMain               :	VAEntrypointVLD
      VAProfileHEVCMain               :	VAEntrypointEncSlice
      VAProfileHEVCMain10             :	VAEntrypointVLD
      VAProfileHEVCMain10             :	VAEntrypointEncSlice

and testing with https://test-videos.co.uk/vids/bigbuckb … 0s_1MB.mp4 prints this under chrome://media-internals

kVideoDecoderName	"VaapiVideoDecoder"
kIsPlatformVideoDecoder	true
info	"Selected VaapiVideoDecoder for video decoding, config: codec: hevc, profile: hevc main, level: not available, alpha_mode: is_opaque, coded size: [1920,1080], visible rect: [0,0,1920,1080], natural size: [1920,1080], has extra data: true, encryption scheme: Unencrypted, rotation: 0°, flipped: 0, color space: {primaries:BT709, transfer:BT709, matrix:BT709, range:LIMITED}"

It is kind of strange that hevc decode truly cannot work in some cases, e.g., HEVC Video Test... and i'm wondering if intel gpus can decode this video without these vulkan flags needed for amdgpus, iirc, i've had an intel laptop which can decode hevc videos on bilibili (presumably videos in hev1 format, while live stream hvc1 is totally fine)...

The mediainfo read on the media-internals page as

"FFmpegDemuxer: created video stream, config codec: hevc, profile: hevc main 10, level: not available, alpha_mode: is_opaque, coded size: [416,234], visible rect: [0,0,416,234], natural size: [416,234], has extra data: true, encryption scheme: Unencrypted, rotation: 0°, flipped: 0, color space: {primaries:BT709, transfer:BT709, matrix:BT709, range:LIMITED}"

and this results in a familiar error as previous...

"VaapiVideoDecoder: failed Initialize()ing the frame pool"

Offline

#1061 2024-06-18 06:18:06

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

Re: chromium: hardware video acceleration with VA-API

Bzzz_56 wrote:

It is kind of strange that hevc decode truly cannot work in some cases, e.g., HEVC Video Test... and i'm wondering if intel gpus can decode this video without these vulkan flags needed for amdgpus, iirc, i've had an intel laptop which can decode hevc videos on bilibili (presumably videos in hev1 format, while live stream hvc1 is totally fine)...

The mediainfo read on the media-internals page as

"FFmpegDemuxer: created video stream, config codec: hevc, profile: hevc main 10, level: not available, alpha_mode: is_opaque, coded size: [416,234], visible rect: [0,0,416,234], natural size: [416,234], has extra data: true, encryption scheme: Unencrypted, rotation: 0°, flipped: 0, color space: {primaries:BT709, transfer:BT709, matrix:BT709, range:LIMITED}"

and this results in a familiar error as previous...

"VaapiVideoDecoder: failed Initialize()ing the frame pool"

That HEVC-10 test video doesn't play in my case (Iris Xe/Wayland/Mesa) though vainfo says that it should support several HEVC profiles.
Useless to say that VLC reports

[00007b24c8001180] mp4 demux: Fragment sequence discontinuity detected 1 != 0
[00007b24c8c02670] avcodec decoder: Using Intel iHD driver for Intel(R) Gen Graphics - 24.2.3 () for hardware decoding

and "sudo intel_gpu_top" reports the Video engine to be a little bit busy.
I would say the decoder support is there, only chromium-based browsers cannot really use it.
Firefox seems to have no support at all of that, though:

No video with supported format and MIME type found.

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

Offline

#1062 2024-06-27 06:12:01

fpe04021
Member
Registered: 2024-06-27
Posts: 1

Re: chromium: hardware video acceleration with VA-API

Hello,
I'm trying to get HW acceleration to work with ungoogled-chromium on a mid 2012 macbook pro.

I've tried a plethora of flags and configs but nothing seems to work sad

Here's my setup

 $ inxi -b
System:
  Host: MB Kernel: 6.6.35-2-lts arch: x86_64 bits: 64
  Desktop: KDE Plasma v: 6.1.0 Distro: Arch Linux
Machine:
  Type: Laptop System: Apple product: MacBookPro9,2 v: 1.0
  Mobo: Apple model: Mac v: MacBookPro9,2
CPU:
  Info: dual core Intel Core i5-3210M [MT MCP] speed (MHz): avg: 3100
    min/max: 1200/3100
Graphics:
  Device-1: Intel 3rd Gen Core processor Graphics driver: i915 v: kernel
  Display: x11 server: X.Org v: 21.1.13 with: Xwayland v: 24.1.0 driver: X:
    loaded: modesetting unloaded: vesa dri: crocus gpu: i915
    resolution: 1280x800~60Hz
  API: OpenGL v: 4.5 compat-v: 4.2 vendor: intel mesa v: 24.1.2-arch1.1
    renderer: Mesa Intel HD Graphics 4000 (IVB GT2)
 $ vainfo
Trying display: wayland
Trying display: x11
vainfo: VA-API version: 1.21 (libva 2.22.0)
vainfo: Driver version: Intel i965 driver for Intel(R) Ivybridge Mobile - 2.4.1
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Simple            : VAEntrypointEncSlice
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSlice
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSlice
      VAProfileH264StereoHigh         : VAEntrypointVLD
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileNone                   : VAEntrypointVideoProc
      VAProfileJPEGBaseline           : VAEntrypointVLD

Here's the output of chrome://gpu
https://i.postimg.cc/KYXHFyM4/chrome-gpu-opt.png

I've verified that HW acceleration works correctly with both Firefox and mpv using intel_gpu_top. I've installed enhanced-h264ify to make sure youtube sends me the h264 version to allow hwacc.

I've deleted (after creating a backup ofc) ~/.config/chromium and ~/.config/chromium-flags.conf to ensure there's no conflict with previous versions to no avail.

I'd appreciate any help I can get here smile

Last edited by fpe04021 (2024-06-27 06:13:11)

Offline

#1063 2024-07-03 14:53:47

xxxxp
Member
Registered: 2024-06-15
Posts: 1

Re: chromium: hardware video acceleration with VA-API

fastfetch

CPU: AMD Ryzen 7 8845HS w/ Radeon 780M Graphics (16) @ 5.14z
GPU: AMD Phoenix3 @ 0.80 GHz [Integrated]

chrome://media-internals/

kIsPlatformVideoDecoder	true
kIsVideoDecryptingDemuxerStream	false
kRendererName	"RendererImpl"
kResolution	"1934x1080"
kVideoDecoderName	"VaapiVideoDecoder"

chrome://version

Chromium	126.0.6478.126 (Official Build) Arch Linux (64-bit)
/usr/lib/chromium/chromium --ozone-platform=wayland --enable-features=VaapiVideoDecoder,VaapiIgnoreDriverChecks,Vulkan,DefaultANGLEVulkan,VulkanFromANGLE,TouchpadOverscrollHistoryNavigation,OverlayScrollbar --oauth2-client-id=77185425430.apps.googleusercontent.com --oauth2-client-secret=OTJgUOQcT7lO7GsGZq2G4IlT --flag-switches-begin --flag-switches-end --eye-dropper-not-supported

Offline

#1064 2024-07-12 16:54:46

druidamix
Member
Registered: 2023-11-27
Posts: 4

Re: chromium: hardware video acceleration with VA-API

Hello,

Running google-chrome-wayland on Hyprland.

With this settings:

--use-gl=angle
--use-angle=vulkan
--enable-features=VaapiVideoEncoder,VaapiIgnoreDriverChecks,Vulkan,DefaultANGLEVulkan,VulkanFromANGLE
--ozone-platform=wayland
--use-angle=vulkan

Hardware accelerations is working. No on youtube though.

Graphics Feature Status
=======================
*   Canvas: Hardware accelerated
*   Canvas out-of-process rasterization: Enabled
*   Direct Rendering Display Compositor: Disabled
*   Compositing: Software only. Hardware acceleration disabled
*   Multiple Raster Threads: Enabled
*   OpenGL: Enabled
*   Rasterization: Hardware accelerated
*   Raw Draw: Disabled
*   Skia Graphite: Disabled
*   Video Decode: Hardware accelerated
*   Video Encode: Software only. Hardware acceleration disabled
*   Vulkan: Disabled
*   WebGL: Hardware accelerated but at reduced performance
*   WebGL2: Hardware accelerated but at reduced performance
*   WebGPU: Disabled
*   WebNN: Disabled

Cheers.

Last edited by druidamix (2024-07-12 18:17:31)

Offline

#1065 2024-07-14 00:18:38

cloverskull
Member
Registered: 2018-09-30
Posts: 185

Re: chromium: hardware video acceleration with VA-API

I'm not using any specific settings, but I am using wayland (kde) and Chrome video acceleration is working fine. Maybe try removing all custom flags?

Offline

#1066 2024-07-19 17:58:42

feinedsquirrel
Member
Registered: 2020-12-11
Posts: 38

Re: chromium: hardware video acceleration with VA-API

If I enable vulkan using params from post #1027, I lose hardware acceleration on compositing, and WebGL{,2} both go from "hardware accelerated" (green) to "hardware accelerated but at reduced performance"

Is there any benefit to gaining Vulkan if compositing becomes software based?

edit to add: I've tried several combinations of parameters mentioned in neighboring posts to #1027 as well

edit 2: just kidding, I just forced vulkan to use only the intel card. Setting "MESA_VK_DEVICE_SELECT" without the "!" didn't force chrome to use the intel graphics. After appending "!" chrome://gpu now shows "accelerated" without caveats on "compositor" and "webgl{,2}"
"*ACTIVE*" is also labeled next to GPU1, in the table lower down on that same page, where as before GPU0, the nvidia card, was labeled as active. Even better, "power_state" on my nvidia card now reads "d3cold" now.
So, it must be accurate to say that vulkan provided from the "nvidia" proprietary driver doesn't support full acceleration in chromium, unless I'm missing other necessary flags. Here are the flags I'm using:

--ozone-platform-hint=auto
--use-gl=angle
--use-angle=vulkan
--enable-features=WebUIDarkMode,AllowQt,TouchpadOverscrollHistoryNavigation,NativeNotifications,ChromeRefresh2023,Vulkan,VulkanFromANGLE,DefaultANGLEVulkan,VaapiVideoEncoder

I used to have "VaapiVideoDecodeLinuxGL" before attempting to enable Vulkan, but it seems it and "VaapiVideoDecoder" do not make a difference.

In the future, I may want to use the nvidia card for certain chrome tasks, so my original question still stands out of curiosity. Also, is there a way, flags or otherwise, to get full acceleration with the nvidia driver?

Last edited by feinedsquirrel (2024-07-19 18:45:08)

Offline

#1067 2024-07-19 20:16:57

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

Re: chromium: hardware video acceleration with VA-API

It seems that hevc main profile 10 is not supported now.. which explains the problem I've encountered

10-bit Video Decoding Not Supported by Chromium's Linux VA-API Decoder

Offline

Board footer

Powered by FluxBB