You are not logged in.

#576 2021-11-12 13:03:52

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

Re: chromium: hardware video acceleration with VA-API

DAC324 wrote:

Looks like nobody needs to care about video acceleration anymore as computers sold these days are fast enough to make accelerated video playback unnecessary.

Except old systems which can't decode 1080p60 playback.

Offline

#577 2021-11-12 21:29:41

dalingrin
Member
Registered: 2009-03-18
Posts: 128

Re: chromium: hardware video acceleration with VA-API

digitalone wrote:
DAC324 wrote:

Looks like nobody needs to care about video acceleration anymore as computers sold these days are fast enough to make accelerated video playback unnecessary.

Except old systems which can't decode 1080p60 playback.

I like to think my i7-10875H is fairly modern but it seems to have trouble with 4k 60fps videos without VA-API.
I also prefer the much lower power consumption.

I'm sticking with Firefox for now until this gets fixed upstream.

Last edited by dalingrin (2021-11-12 21:30:23)

Offline

#578 2021-11-14 09:19:21

once
Member
From: Taiwan
Registered: 2006-09-12
Posts: 255

Re: chromium: hardware video acceleration with VA-API

what is benefit --enable-vulkan ?

Offline

#579 2021-11-15 17:15:21

hogehoge
Member
Registered: 2013-05-22
Posts: 12

Re: chromium: hardware video acceleration with VA-API

Failed to hardware decode vdpau-va-driver ( Version 97.0.4692.8 )

chromium-browser  --enable-features=VaapiVideoDecoder

00:00:02.801 | event | "kPlay"
00:00:02.891 | kIsVideoDecryptingDemuxerStream | false
00:00:02.891 | kVideoDecoderName | "VDAVideoDecoder"
00:00:02.891 | kIsPlatformVideoDecoder | true
00:00:02.891 | info | "Selected VDAVideoDecoder for video decoding, config: codec: h264, profile: h264 main, level: not available, alpha_mode: is_opaque, coded size: [854,480], visible rect: [0,0,854,480], natural size: [854,480], has extra data: false, encryption scheme: Unencrypted, rotation: 0°, flipped: 0, color space: {primaries:BT709, transfer:BT709, matrix:BT709, range:LIMITED}"
00:00:02.891 | pipeline_state | "kPlaying"
00:00:02.923 | seek_target | 5950.4
00:00:02.934 | seek_target | 5953.019705
00:00:02.936 | pipeline_state | "kSeeking"
00:00:02.991 | pipeline_state | "kPlaying"
00:00:02.997 | error | "VDA Error 4"
00:00:02.997 | warning | "video decoder fallback after initial decode error."
00:00:02.997 | info | "Failed to initialize VpxVideoDecoder"
00:00:02.997 | info | "Failed to initialize Dav1dVideoDecoder"
00:00:03.001 | kIsVideoDecryptingDemuxerStream | false
00:00:03.001 | kVideoDecoderName | "FFmpegVideoDecoder"
00:00:03.001 | kIsPlatformVideoDecoder | false
00:00:03.001 | info | "Selected FFmpegVideoDecoder for video decoding, config: codec: h264, profile: h264 main, level: not available, alpha_mode: is_opaque, coded size: [854,480], visible rect: [0,0,854,480], natural size: [854,480], has extra data: false, encryption scheme: Unencrypted, rotation: 0°, flipped: 0, color space: {primaries:BT709, transfer:BT709, matrix:BT709, range:LIMITED}"

What means VDA Error 4?

Last edited by hogehoge (2021-11-15 17:15:55)

Offline

#580 2021-11-15 20:52:51

moturhead
Member
Registered: 2021-10-31
Posts: 12

Re: chromium: hardware video acceleration with VA-API

This is the output of Chromium 87.0.4280.141 in chrome://gpu:
HWdecode supported

Whereas this is the output of Chromium 95.0.4638.54:
No HWdecode

So unless the browser itself reports the decoding information, you won't get hardware decoding (based on my observation).

Offline

#581 2021-11-16 03:33:37

hogehoge
Member
Registered: 2013-05-22
Posts: 12

Re: chromium: hardware video acceleration with VA-API

This is Acceleration Information

Video Acceleration Information
Decoding (VideoDecoder)   
Decode h264 main    16x16 to 2048x2048 pixels
Decode h264 high    16x16 to 2048x2048 pixels
Decoding (Legacy VideoDecodeAccelerator)   
Decode h264 main    16x16 to 2048x2048 pixels
Decode h264 high    16x16 to 2048x2048 pixels

Offline

#582 2021-11-16 04:41:37

once
Member
From: Taiwan
Registered: 2006-09-12
Posts: 255

Re: chromium: hardware video acceleration with VA-API

what is Raw Draw for? 96.0.4664.45.

Offline

#583 2021-11-16 06:09:30

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

Re: chromium: hardware video acceleration with VA-API

I've just taken an update to google-chrome-stable, currently Version 96.0.4664.45 (Official Build) (64-bit)

This is my ~/.config/chrome-flags.conf:

--enable-features=VaapiVideoDecoder
--use-gl=desktop
--disable-features=UseSkiaRenderer

In chrome://flags I have the following settings manually set to non-default values:

#ignore-gpu-blocklist - "Override software rendering list" - Enabled
#enable-gpu-rasterization - "GPU Rasterization" - Enabled
#enable-vulkan - "Vulkan" - Enabled
#canvas-oop-rasterization - "Out-of-process 2D Canvas Rasterization." - Enabled
#enable-raw-draw - "Enable raw draw" - Enabled

Note that in some of these cases, I am clueless what these settings actually do, so please take with a grain of salt and/or help enrich this thread with some feedback so we can collectively hone in on the actual needed configuration switches.

Here's my top chrome://gpu

Graphics Feature Status
Canvas: Hardware accelerated
Canvas out-of-process rasterization: Enabled
Compositing: Hardware accelerated
Multiple Raster Threads: Enabled
Out-of-process Rasterization: Hardware accelerated
OpenGL: Enabled
Rasterization: Hardware accelerated on all pages
Raw Draw: Enabled
Skia Renderer: Enabled
Video Decode: Hardware accelerated
Vulkan: Enabled
WebGL: Hardware accelerated
WebGL2: Hardware accelerated

I'm using the enanced-h264ify plugin - https://chrome.google.com/webstore/deta … odlk?hl=en - and am not actually blocking anything at the moment and am seeing quite a bit of success with hardware video decoding on YouTube, however ymmv.

I hope this is helpful.

edit - seems like a number of hardware accelerated vids render completely blank. Sad.

Last edited by cloverskull (2021-11-16 06:12:55)

Offline

#584 2021-11-16 11:06:01

DAC324
Member
Registered: 2020-03-12
Posts: 70

Re: chromium: hardware video acceleration with VA-API

hogehoge wrote:

Failed to hardware decode vdpau-va-driver ( Version 97.0.4692.8 )
[...]

00:00:02.997 | error | "VDA Error 4"
00:00:02.997 | warning | "video decoder fallback after initial decode error."
00:00:02.997 | info | "Failed to initialize VpxVideoDecoder"
00:00:02.997 | info | "Failed to initialize Dav1dVideoDecoder"

What means VDA Error 4?

Interesting about that VDA Error 4 is that all you will find searching for it, are complaints by other users experiencing this error. There is no explanation, left alone a solution provided.

In your situation, I would recommend installing Chromium-Dev from AUR. Before installing this package, I downloaded all required files to an empty directory and then modified the pkgver entry in PKGBUILD to 98.0.4696.4.
After that, I executed makepkg -i in that folder so I got a working Chromium version 98.0.4696.4 without that dreaded VDA Error 4.

Last edited by DAC324 (2021-11-16 11:06:48)

Offline

#585 2021-11-16 17:10:34

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

Re: chromium: hardware video acceleration with VA-API

Sorry to post yet again, but I have seemingly gotten Chrome Stable (Version 96.0.4664.45 (Official Build) (64-bit)) to work reliably with hardware video decoding and wanted to share the working configuration here.

~/.config/chrome-flags.conf

--enable-features=VaapiVideoDecoder
--use-gl=desktop
--disable-features=UseSkiaRenderer

Non-default settings in chrome://flags

Override Software Rendering List (#ignore-gpu-blocklist) - Enabled
GPU Rasterization (#enable-gpu-rasterization) - Enabled

I'm using the enhanced-h264ify Chrome extension: https://chrome.google.com/webstore/deta … ikinpkodlk

I have the extension configured to block AV1

All youtube videos thus far are working with GPU hardware decoding, no issues. Cheers.

Last edited by cloverskull (2021-11-16 17:13:46)

Offline

#586 2021-11-17 15:04:35

dmig
Member
Registered: 2021-11-17
Posts: 1

Re: chromium: hardware video acceleration with VA-API

Seems, they fixed something in version 96.xx. Chromium 96.0.4664.45 now plays videos with hardware acceleration. But only under X.org. No hardware acceleration on Wayland.
Enabling vulkan renderer causes white background instead of video.

I'm using only `--enable-features=VaapiVideoDecoder` flag. Installed enhanced-h264ify extension to block av1 following cloverskull advice.

Offline

#587 2021-11-17 16:01:32

martinc2
Member
Registered: 2011-09-23
Posts: 49

Re: chromium: hardware video acceleration with VA-API

Huh.  I can't get HW acceleration under chrome (official) 96.0.4664.45.  (With enhanced-h264ify.)  Worked in previous chromes; works fine with, e.g., VLC, but using chrome `sudo intel_gpu_top` confirms there is no video acceleration.  (Intel gen 11 graphics, iHD)

Offline

#588 2021-11-18 13:29:26

Inixi
Member
Registered: 2016-10-15
Posts: 50

Re: chromium: hardware video acceleration with VA-API

My current system specs:
iGPU - AMD Radeon Vega 8
dGPU - NVIDIA GeForce RTX2060 Max-Q Design
kernel - 5.15.2-arch1-g14-1
drivers - nvidia 495.44-7
Xserver - X11
chromium version - 96.0.4664.45-1
running desktop in dGPU mode

I use following flags:

--use-vulkan
--use-gl=desktop
--enable-features=WebUIDarkMode,VaapiVideoDecoder
--force-dark-mode
--enable-zero-copy
--enable-gpu-rasterization
--enable-oop-rasterization
--enable-accelerated-2d-canvas
--enable-accelerated-video-decode

I have also installed libva-vdpau-driver-vp9-git r57.509d3b2-3

The result on about GPU page is:

Graphics Feature Status:

Canvas: Hardware accelerated
Canvas out-of-process rasterization: Disabled
Compositing: Hardware accelerated
Multiple Raster Threads: Enabled
Out-of-process Rasterization: Hardware accelerated
OpenGL: Enabled
Rasterization: Hardware accelerated on all pages
Raw Draw: Disabled
Skia Renderer: Enabled
Video Decode: Hardware accelerated
Vulkan: Enabled
WebGL: Hardware accelerated
WebGL2: Hardware accelerated


Driver Bug Workarounds:

adjust_src_dst_region_for_blitframebuffer
clear_uniforms_before_first_program_use
disable_discard_framebuffer
enable_webgl_timer_query_extensions
exit_on_context_lost
force_cube_complete
init_gl_position_in_vertex_shader
init_vertex_attributes
pack_parameters_workaround_with_pack_buffer
reset_base_mipmap_level_before_texstorage
unpack_alignment_workaround_with_unpack_buffer
unpack_overlapping_rows_separately_unpack_buffer
use_virtualized_gl_contexts
disabled_extension_GL_KHR_blend_equation_advanced
disabled_extension_GL_KHR_blend_equation_advanced_coherent
disabled_extension_GL_MESA_framebuffer_flip_y

The following videos on youtube work for me with VDAVideoDecoder and Hardware acceleration enabled from 144p, through 1080p up to 4k
https://www.youtube.com/watch?v=vX2vsvdq8nw
https://www.youtube.com/watch?v=JfVOs4VSpmA
This one is pretty strange, because the hardware acceleration does not work on 1080p and 8k, but does work on 1440p and 4k (probably because FullHD mode is in HDR, which is not supported by proprietary drivers on Linux)
https://www.youtube.com/watch?v=-ucUFBTUYLI
And finally all other h264 videos from other sites are working in hardware accelerated mode even though I am not using h264ify nor enhanced-h264ify extension.

I will be also observing the stability, because I know from my previous experiments that I had some issues with that...

Seems like chromium needs to have #enable-accelerated-video-decode enforced either by cmd flag --enable-accelerated-video-decode or manually in the flags. Without this flag there is no way to enable hardware accelerated videos.

Last edited by Inixi (2021-11-18 13:31:40)


Linux vampirhon 5.15.7-xanmod1-rog-1 @ 2020 ASUS Zephyrus G14

Offline

#589 2021-11-18 17:16:33

martinc2
Member
Registered: 2011-09-23
Posts: 49

Re: chromium: hardware video acceleration with VA-API

Following up on #587:  A mystery I can't solve.

For Chrome 96.0.4664.45 (Official Build), with the following config with Intel Gen 11 integrated graphics (and iHD):

--enable-features=VaapiVideoDecoder
  • starting Chrome (google-chrome-stable) from the command line:  Video acceleration works, as verified using intel_gpu_top

  • starting Chrome via a .desktop entry (i.e., by clicking on an icon):  Video acceleration doesn't work

NB., by "starting" I mean closing down the previous instance (Alt-F X) and then (re)starting.  Once Chrome is running, new windows behave according to how it was initially started, however they're opened.

This is on KDE Plasma 5.23.3.

Anyone got a clue what's going on?  I got as far as checking the .desktop file, which just wants to run google-chrome-stable, as far as I can see.

Last edited by martinc2 (2021-11-18 17:17:05)

Offline

#590 2021-11-18 17:27:24

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

Re: chromium: hardware video acceleration with VA-API

After the 96.0.4664.45 update GPU decoding still works under X11 with my previously posted flags.

@Inixi

I'd run the desktop with the amd gpu and use prime offloading for heavy stuff tbh


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

Offline

#591 2021-11-18 20:14:53

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

Re: chromium: hardware video acceleration with VA-API

@martinc2 - add the flag

--enable-features=VaapiVideoDecoder

to ~/.config/chrome-flags.conf

Offline

#592 2021-11-18 20:17:32

martinc2
Member
Registered: 2011-09-23
Posts: 49

Re: chromium: hardware video acceleration with VA-API

@cloverskull Sorry, should have said, the flag _is_ in chrome-flags.conf (I don't pass any arguments on the command line). Thanks, apologies that wasn't clear

Offline

#593 2021-11-18 20:24:27

Inixi
Member
Registered: 2016-10-15
Posts: 50

Re: chromium: hardware video acceleration with VA-API

justkdng wrote:

@Inixi
I'd run the desktop with the amd gpu and use prime offloading for heavy stuff tbh

I wish to run the desktop with iGPU, but I connect my laptop to docking station via usb-c and it also connects DP and this DP is bridged to GeForce. Reverse prime does not work well with setup like AMD -> Nvidia, I am patiently waiting for this to be solved -> https://gitlab.freedesktop.org/xorg/dri … equests/62

But not to offtopic, @justkdng , do you know if Hardware Accelerated Video (Youtube and else) works in Chromium with AMD GPUs?


Linux vampirhon 5.15.7-xanmod1-rog-1 @ 2020 ASUS Zephyrus G14

Offline

#594 2021-11-18 22:08:14

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

Re: chromium: hardware video acceleration with VA-API

@Inixi

I have a 5600xt and hwaccel doesn't work with it, I'm using prime offloading though, not sure how it'd behave without it. Using the iGPU of my 11400 hwaccel works without a problem

Last edited by justkdng (2021-11-18 22:08:29)


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

Offline

#595 2021-11-19 00:16:03

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

Re: chromium: hardware video acceleration with VA-API

@martinc2 - ahhh, gotcha. I'm not in front of my arch machine at the moment but I believe the /usr/share/applications/google-chrome.desktop _does_ make a reference to the ~/.config/chrome-flags.conf - I suppose it's possible the .desktop file you're using doesn't have those references. Maybe worth a double check?

For the larger discussion here, I figured I'd post a link to an interesting reddit thread about the state of hw accelerated video in linux browsers: https://www.reddit.com/r/linuxquestions … _on_linux/

Offline

#596 2021-11-19 05:25:59

hogehoge
Member
Registered: 2013-05-22
Posts: 12

Re: chromium: hardware video acceleration with VA-API

Here is debug log
How can I solve "Failed to create dedicated X11 display!"

[28879:28879:1119/044417.905406:VERBOSE2:vaapi_video_decode_accelerator.cc(202)] Initialize(): Initializing VAVDA, profile: h264 main
Failed to create dedicated X11 display!
[28879:29011:1119/044418.115009:VERBOSE2:vaapi_video_decode_accelerator.cc(483)] DecodeTask(): Decoder requesting a new set of surfaces
[28879:28879:1119/044418.129512:VERBOSE2:vaapi_video_decode_accelerator.cc(578)] InitiateSurfaceSetChange():  |requested_num_pics_| = 6; |requested_num_reference_frames_| = 7
[28879:28879:1119/044418.129997:VERBOSE2:vaapi_video_decode_accelerator.cc(644)] TryFinishSurfaceSetChange(): Requesting 6 pictures of size: 864x480 and visible rectangle = 0,0 854x480
[28879:28879:1119/044418.157057:VERBOSE1:vaapi_video_decode_accelerator.cc(144)] NotifyError(): Notifying of error 4
[28879:28879:1119/044418.174829:VERBOSE2:vaapi_video_decode_accelerator.cc(1043)] Cleanup(): Destroying VAVDA
[28840:28840:1119/044421.283124:INFO:CONSOLE(0)] "The resource https://r4---sn-3qqp-ioqls.googlevideo.com/generate_204?conn2 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.", source: https://www.youtube.com/watch?v=hxAF6lVXYJI (0)
[28840:28840:1119/044421.283717:INFO:CONSOLE(0)] "The resource https://i.ytimg.com/generate_204 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.", source: https://www.youtube.com/watch?v=hxAF6lVXYJI (0)
[28840:28840:1119/044421.284075:INFO:CONSOLE(0)] "The resource https://r4---sn-3qqp-ioqls.googlevideo.com/generate_204 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.", source: https://www.youtube.com/watch?v=hxAF6lVXYJI (0)
[28991:29009:1119/044422.769840:WARNING:sync_reader.cc(187)] ASR: No room in socket buffer.: Broken pipe (32)
[28840:28840:1119/044423.288355:WARNING:pref_notifier_impl.cc(40)] Pref observer for media_router.cast_allow_all_ips found at shutdown.

Offline

#597 2021-11-19 11:02:44

Inixi
Member
Registered: 2016-10-15
Posts: 50

Re: chromium: hardware video acceleration with VA-API

cloverskull wrote:

@martinc2 - ahhh, gotcha. I'm not in front of my arch machine at the moment but I believe the /usr/share/applications/google-chrome.desktop _does_ make a reference to the ~/.config/chrome-flags.conf - I suppose it's possible the .desktop file you're using doesn't have those references. Maybe worth a double check?

For the larger discussion here, I figured I'd post a link to an interesting reddit thread about the state of hw accelerated video in linux browsers: https://www.reddit.com/r/linuxquestions … _on_linux/

I can confirm that when you use Chromium from extra/chromium then putting settings in ~/.config/chromium-flags.conf works in the way that is provided in the wiki https://wiki.archlinux.org/title/Chromi … persistent

Regarding my previous post:

Inixi wrote:

My current system specs:
iGPU - AMD Radeon Vega 8
dGPU - NVIDIA GeForce RTX2060 Max-Q Design
kernel - 5.15.2-arch1-g14-1
drivers - nvidia 495.44-7
Xserver - X11
chromium version - 96.0.4664.45-1
running desktop in dGPU mode

I use following flags:

--use-vulkan
--use-gl=desktop
--enable-features=WebUIDarkMode,VaapiVideoDecoder
--force-dark-mode
--enable-zero-copy
--enable-gpu-rasterization
--enable-oop-rasterization
--enable-accelerated-2d-canvas
--enable-accelerated-video-decode

I have also installed libva-vdpau-driver-vp9-git r57.509d3b2-3

The result on about GPU page is:

Graphics Feature Status:

Canvas: Hardware accelerated
Canvas out-of-process rasterization: Disabled
Compositing: Hardware accelerated
Multiple Raster Threads: Enabled
Out-of-process Rasterization: Hardware accelerated
OpenGL: Enabled
Rasterization: Hardware accelerated on all pages
Raw Draw: Disabled
Skia Renderer: Enabled
Video Decode: Hardware accelerated
Vulkan: Enabled
WebGL: Hardware accelerated
WebGL2: Hardware accelerated


Driver Bug Workarounds:

adjust_src_dst_region_for_blitframebuffer
clear_uniforms_before_first_program_use
disable_discard_framebuffer
enable_webgl_timer_query_extensions
exit_on_context_lost
force_cube_complete
init_gl_position_in_vertex_shader
init_vertex_attributes
pack_parameters_workaround_with_pack_buffer
reset_base_mipmap_level_before_texstorage
unpack_alignment_workaround_with_unpack_buffer
unpack_overlapping_rows_separately_unpack_buffer
use_virtualized_gl_contexts
disabled_extension_GL_KHR_blend_equation_advanced
disabled_extension_GL_KHR_blend_equation_advanced_coherent
disabled_extension_GL_MESA_framebuffer_flip_y

The following videos on youtube work for me with VDAVideoDecoder and Hardware acceleration enabled from 144p, through 1080p up to 4k
https://www.youtube.com/watch?v=vX2vsvdq8nw
https://www.youtube.com/watch?v=JfVOs4VSpmA
This one is pretty strange, because the hardware acceleration does not work on 1080p and 8k, but does work on 1440p and 4k (probably because FullHD mode is in HDR, which is not supported by proprietary drivers on Linux)
https://www.youtube.com/watch?v=-ucUFBTUYLI
And finally all other h264 videos from other sites are working in hardware accelerated mode even though I am not using h264ify nor enhanced-h264ify extension.

I will be also observing the stability, because I know from my previous experiments that I had some issues with that...

Seems like chromium needs to have #enable-accelerated-video-decode enforced either by cmd flag --enable-accelerated-video-decode or manually in the flags. Without this flag there is no way to enable hardware accelerated videos.

I can tell that stability of the browser is kind of poor. Sometimes I get one or two second freezes while doing some work (not only watching videos) and sometimes I get permanent freezes. Most of the time I can work in the browser, but it scares me that in any second browser might freeze and I can loose data to be posted.


Linux vampirhon 5.15.7-xanmod1-rog-1 @ 2020 ASUS Zephyrus G14

Offline

#598 2021-11-19 16:19:29

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

Re: chromium: hardware video acceleration with VA-API

Hey @Inixi, I had similar issues when I had vulkan enabled. Try disabling that and see if the issues continue to present.

Offline

#599 2021-11-19 18:43:50

moturhead
Member
Registered: 2021-10-31
Posts: 12

Re: chromium: hardware video acceleration with VA-API

Can confirm on version 96.0.4664.45 Hardware acceleration is working with flags

--enable-gpu-rasterization --enable-zero-copy --ignore-gpu-blocklist --enable-features=VaapiVideoDecoder,CanvasOopRasterization

No need for

--use-gl=desktop

flag.

Offline

#600 2021-11-20 01:51:07

hogehoge
Member
Registered: 2013-05-22
Posts: 12

Re: chromium: hardware video acceleration with VA-API

After setting "Enable software compositing window manager" on
It enabled to VDAVideoDecoder youtube
But, screen is black. what's wrong?

Offline

Board footer

Powered by FluxBB