You are not logged in.

#551 2021-10-29 22:56:10

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

Re: chromium: hardware video acceleration with VA-API

With these flags I think vaapi is working as chromium://media-internals suggests that VDADecoder is in use during this video: https://www.youtube.com/watch?v=LXb3EKWsInQ

--use-gl=desktop
--extension-mime-request-handling=always-prompt-for-install
--force-dark-mode
--enable-features=WebUIDarkMode,OverlayScrollbar,VaapiVideoDecoder
--disable-features=UseSkiaRenderer

I'm using ungoogled chromium if that helps, though, IIRC in order to know if vaapi was working the decoder should be Mojo, did the devs change it?


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

Offline

#552 2021-10-30 00:50:05

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

Re: chromium: hardware video acceleration with VA-API

What's the version reported if you go to help->about (or whatever it is?)

Offline

#553 2021-10-30 03:31:28

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

Re: chromium: hardware video acceleration with VA-API

Version is 95.0.4638.69
Forgot to add, I'm using an i5 11400 with X11


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

Offline

#554 2021-10-30 15:12:33

thwalker3
Member
Registered: 2021-10-25
Posts: 4

Re: chromium: hardware video acceleration with VA-API

justkdng wrote:

With these flags I think vaapi is working as chromium://media-internals suggests that VDADecoder is in use during this video: https://www.youtube.com/watch?v=LXb3EKWsInQ

I'm using ungoogled chromium if that helps, though, IIRC in order to know if vaapi was working the decoder should be Mojo, did the devs change it?

Yes, Mojo changed to VDAVideoDecoder a couple major releases ago.

Sadly, I have no luck with Chrome 95.0.4638.69 or Chrome Beta 96.0.4664.27.  Last to work was 94.0.4606.81.  i7-10710U w/ X11.

Offline

#555 2021-10-30 23:31:34

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

Re: chromium: hardware video acceleration with VA-API

I also have no luck with the above settings (or any other configuration I've attempted to tweak) using official/branded Chrome Stable 95.0.4638.69. If I go to chrome://gpu I see the following (yet videos are still software decoded):

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
Skia Renderer: Enabled
Video Decode: Hardware accelerated
Vulkan: Enabled
WebGL: Hardware accelerated
WebGL2: Hardware accelerated

Offline

#556 2021-10-31 19:07:37

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

Re: chromium: hardware video acceleration with VA-API

Running ungoogled-chromium from flatpak version 95.0.4638.69 gives following log in media-internals:

    00:00:00.103	info	"Failed to initialize DecryptingVideoDecoder"
    00:00:00.103	info	"Failed to initialize VDAVideoDecoder"
    00:00:00.103	kIsVideoDecryptingDemuxerStream	false
    00:00:00.103	kVideoDecoderName	"VpxVideoDecoder"
    00:00:00.103	kIsPlatformVideoDecoder	false
    00:00:00.103	info	"Selected VpxVideoDecoder for video decoding, config: codec: vp9, profile: vp9 profile0, level: not available, alpha_mode: is_opaque, coded size: [640,360], visible rect: [0,0,640,360], natural size: [640,360], has extra data: false, encryption scheme: Unencrypted, rotation: 0°, flipped: 0, color space: {primaries:BT709, transfer:BT709, matrix:BT709, range:LIMITED} 

This is somewhat better than previous tries when chromium didn't even try to initialize VDAVideoDecoder and straight goes for VpxVideoDecoder. Now we just have to make it initialize VDAVideoDecoder successfully somehow. How to find the reason behind the unsuccessful init of VDAVideoDecoder?

Terminal output:

[33:33:1101/002554.096605:ERROR:gpu_init.cc(453)] Passthrough is not supported, GL is desktop, ANGLE is 
[33:33:1101/002554.119776:ERROR:sandbox_linux.cc(384)] InitializeSandbox() called with multiple threads in process gpu-process.
[2:27:1101/002556.419389:ERROR:chrome_browser_main_extra_parts_metrics.cc(230)] crbug.com/1216328: Checking Bluetooth availability started. Please report if there is no report that this ends.
[2:27:1101/002556.419419:ERROR:chrome_browser_main_extra_parts_metrics.cc(233)] crbug.com/1216328: Checking Bluetooth availability ended.
[2:27:1101/002556.419425:ERROR:chrome_browser_main_extra_parts_metrics.cc(236)] crbug.com/1216328: Checking default browser status started. Please report if there is no report that this ends.
[2:27:1101/002556.427652:ERROR:chrome_browser_main_extra_parts_metrics.cc(240)] crbug.com/1216328: Checking default browser status ended.
[2:26:1101/002558.802545:ERROR:ev_root_ca_metadata.cc(841)] Failed to register OID: 0
Fontconfig error: Cannot load default config file: No such file: (null)

Offline

#557 2021-10-31 20:10:21

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

Re: chromium: hardware video acceleration with VA-API

thwalker3 wrote:

Sadly, I have no luck with Chrome 95.0.4638.69 or Chrome Beta 96.0.4664.27.  Last to work was 94.0.4606.81.  i7-10710U w/ X11.

IIRC google chrome doesn't enable hwaccel

moturhead wrote:

Running ungoogled-chromium from flatpak

Try using binary releases instead of flatpak


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

Offline

#558 2021-10-31 20:22:10

thwalker3
Member
Registered: 2021-10-25
Posts: 4

Re: chromium: hardware video acceleration with VA-API

justkdng wrote:
thwalker3 wrote:

Sadly, I have no luck with Chrome 95.0.4638.69 or Chrome Beta 96.0.4664.27.  Last to work was 94.0.4606.81.  i7-10710U w/ X11.

IIRC google chrome doesn't enable hwaccel

HW video decode has worked for at least a half-dozen releases with various required flags (as of 94.0.4606.81 using '--enable-features=VaapiVideoDecoder --use-gl=desktop --disable-features=UseOzonePlatform').  As noted by others earlier in this thread, Chrome (and Chromium) 95 ripped out the fallback to use the old non-Ozone X11 backend even though Ozone's va-api implementation is still broken.  Hence why hw video decode no longer works...

Offline

#559 2021-10-31 20:55:51

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

Re: chromium: hardware video acceleration with VA-API

Can anyone tell what exactly the errors

[33:33:1101/002554.096605:ERROR:gpu_init.cc(454)] Passthrough is not supported, GL is desktop, ANGLE is 
[33:33:1101/002554.119776:ERROR:sandbox_linux.cc(374)] InitializeSandbox() called with multiple threads in process gpu-process.

mean? because I'm getting same error on Chrome 94.0.4606.81. Therefore, on enabling flags mentioned in earlier posts should enable HW acceleration on it. It is also failing to initialize VDAVideoDecoder just like Chromium 95.

Edit: 94.x isn't flatpak if it matters.

Last edited by moturhead (2021-10-31 20:57:10)

Offline

#560 2021-11-01 06:07:36

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

Re: chromium: hardware video acceleration with VA-API

What does the commandline show on the chrome://version site?


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

Offline

#561 2021-11-01 19:56:23

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

Re: chromium: hardware video acceleration with VA-API

chromium --use-gl=desktop --enable-crashpad --flag-switches-begin --enable-gpu-rasterization --ignore-gpu-blocklist --flag-switches-end --enable-features=VaapiVideoDecoder --disable-features=UseOzonePlatform --enable-quic

Last edited by moturhead (2021-11-01 19:56:54)

Offline

#562 2021-11-01 22:26:06

thwalker3
Member
Registered: 2021-10-25
Posts: 4

Re: chromium: hardware video acceleration with VA-API

Ah, arch is carrying a chromium patch in 95 that didn't land until 96.  Although I still can't get Chrome 96 beta to work so?
https://github.com/archlinux/svntogit-p … -API.patch

Offline

#563 2021-11-02 04:29:25

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

Re: chromium: hardware video acceleration with VA-API

moturhead wrote:
chromium --use-gl=desktop --enable-crashpad --flag-switches-begin --enable-gpu-rasterization --ignore-gpu-blocklist --flag-switches-end --enable-features=VaapiVideoDecoder --disable-features=UseOzonePlatform --enable-quic

Try removing

--disable-features=UseOzonePlatform

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

Offline

#564 2021-11-02 14:24:03

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

Re: chromium: hardware video acceleration with VA-API

On 97.0.4681.0, VA-API still does not seem to be functional:

[4210:4961:1102/135750.651953:FATAL:vaapi_wrapper.cc(2358)] : Check failed: sequence_checker_.CalledOnValidSequence(). 
#0 0x7f8c160035fe base::debug::CollectStackTrace() 
#1 0x7f8c15f30efb base::debug::StackTrace::StackTrace() 
#2 0x7f8c15f4c0ea logging::LogMessage::~LogMessage() 
#3 0x7f8c15f4cc85 logging::LogMessage::~LogMessage() 
#4 0x7f8c064c84fa media::VaapiWrapper::SubmitBuffers() 
#5 0x7f8c064a038f (/usr/lib/chromium/libservice.so+0x23238e) 
#6 0x7f8c064d4fa4 media::H264Decoder::StartNewFrame() 
#7 0x7f8c064d7904 media::H264Decoder::Decode() 
#8 0x7f8c064aa50f media::VaapiVideoDecodeAccelerator::DecodeTask() 
#9 0x7f8c15fb30bc base::TaskAnnotator::RunTask() 
#10 0x7f8c15fc95be base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWorkImpl() 
#11 0x7f8c15fc92fc base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWork() 
#12 0x7f8c15fc9989 base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWork() 
#13 0x7f8c15f569db base::MessagePumpDefault::Run() 
#14 0x7f8c15fc9c26 base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::Run() 
#15 0x7f8c15f89061 base::RunLoop::Run() 
#16 0x7f8c15fea29b base::Thread::Run() 
#17 0x7f8c15fea451 base::Thread::ThreadMain() 
#18 0x7f8c1601894c (/usr/lib/chromium/libbase.so+0x22294b) 
#19 0x7f8c0700b259 start_thread 
#20 0x7f8c069f25e3 __GI___clone Task trace: 
#0 0x7f8c064ac67e media::VaapiVideoDecodeAccelerator::AssignPictureBuffers() 
#1 0x7f8c0d82075a (/usr/lib/chromium/libmedia_mojo_services.so+0x9f759) 
#2 0x7f8c064ab814 media::VaapiVideoDecodeAccelerator::TryFinishSurfaceSetChange() 
#3 0x7f8c064aa80b media::VaapiVideoDecodeAccelerator::DecodeTask() 
#4 0x7f8c064aa01b media::VaapiVideoDecodeAccelerator::QueueInputBuffer() Task trace buffer limit hit, update PendingTask::kTaskBacktraceLength to increase. Crash keys: "last-video-decoder" = "name=VDAVideoDecoder:codec=h264:profile=3:size=1280x720:cs=[1,1,2,1]:hdrm=0" "num-video-decoders" = "1"
GpuProcessHost: The GPU process crashed!

Last edited by DAC324 (2021-11-02 15:22:24)

Offline

#565 2021-11-02 18:49:42

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

Re: chromium: hardware video acceleration with VA-API

justkdng wrote:

Try removing

--disable-features=UseOzonePlatform

Doesn't help. The result is the same. VpxVideoDecoder is being selected after DeccryptingVideoDecoder and VDAVideoDecoder fail to initialize.

Offline

#566 2021-11-02 20:09:37

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

Re: chromium: hardware video acceleration with VA-API

moturhead wrote:
justkdng wrote:

Try removing

--disable-features=UseOzonePlatform

Doesn't help. The result is the same. VpxVideoDecoder is being selected after DeccryptingVideoDecoder and VDAVideoDecoder fail to initialize.

have you checked if your GPU supports VP9 decoding? If it doesn't it will use software decoding, nothing you can do about that. https://wiki.archlinux.org/title/Hardwa … son_tables


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

Offline

#567 2021-11-02 20:19:33

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

Re: chromium: hardware video acceleration with VA-API

I have Ryzen R3 5300U with Renoir graphics. Firefox successfully decodes VP9 video, as evidenced in the output of

cat /sys/kernel/debug/dri/0/amdgpu_pm_info

I can see VCN enabling when I use either Firefox or mpv. But neither Chromium, Opera nor Chrome seems to do that.

Offline

#568 2021-11-03 00:48:53

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

Re: chromium: hardware video acceleration with VA-API

Hmmm, only explanation I can think of is that intel-media-driver works better with chromium than libva-mesa-driver, maybe try the flags I posted above on a clean profile.


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

Offline

#569 2021-11-03 14:15:03

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

Re: chromium: hardware video acceleration with VA-API

I installed Chrome 94 on second laptop running Wayland (i5 8250u integrated graphics), installed intel-media-va-driver-non-free, and in about://gpu I got info about "Video Acceleration Information" field as:

Decoding (VideoDecoder)
Decode h264 baseline        16x16 to 4096x4096 pixels
Decode h264 main              16x16 to 4096x4096 pixels
Decode h264 high               16x16 to 4096x4096 pixels
Decode vp8                         16x16 to 4096x4096 pixels
Decode vp9 profile0            16x16 to 4096x4096 pixels
Decoding (Legacy VideoDecodeAccelerator)
Decode h264 baseline        16x16 to 4096x4096 pixels
Decode h264 main              16x16 to 4096x4096 pixels
Decode h264 high               16x16 to 4096x4096 pixels
Decode vp8                         16x16 to 4096x4096 pixels
Decode vp9 profile0            16x16 to 4096x4096 pixels
Encoding

Although I can't get hardware acceleration to work on that system either.
On my laptop (AMD 5300u, AMD Renior X11) this field is empty on all chromium installs.

Offline

#570 2021-11-05 13:28:48

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

Re: chromium: hardware video acceleration with VA-API

Just an update from my side:

Looks like version 95.0.4621.4 works best here when it comes to VA-API support and accelerated video playback. I just verified this by compiling a 97.x version which fails on initialization of VDAVideoDecoder:

[4210:4961:1102/135750.651953:FATAL:vaapi_wrapper.cc(2358)] : Check failed: sequence_checker_.CalledOnValidSequence(). 
#0 0x7f8c160035fe base::debug::CollectStackTrace() 
#1 0x7f8c15f30efb base::debug::StackTrace::StackTrace() 
#2 0x7f8c15f4c0ea logging::LogMessage::~LogMessage() 
#3 0x7f8c15f4cc85 logging::LogMessage::~LogMessage() 
#4 0x7f8c064c84fa media::VaapiWrapper::SubmitBuffers() 
#5 0x7f8c064a038f (/usr/lib/chromium-dev/libservice.so+0x23238e) 
#6 0x7f8c064d4fa4 media::H264Decoder::StartNewFrame() 
#7 0x7f8c064d7904 media::H264Decoder::Decode() 
#8 0x7f8c064aa50f media::VaapiVideoDecodeAccelerator::DecodeTask() 
#9 0x7f8c15fb30bc base::TaskAnnotator::RunTask() 
#10 0x7f8c15fc95be base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWorkImpl() 
#11 0x7f8c15fc92fc base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWork() 
#12 0x7f8c15fc9989 base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWork() 
#13 0x7f8c15f569db base::MessagePumpDefault::Run() 
#14 0x7f8c15fc9c26 base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::Run() 
#15 0x7f8c15f89061 base::RunLoop::Run() 
#16 0x7f8c15fea29b base::Thread::Run() 
#17 0x7f8c15fea451 base::Thread::ThreadMain() 
#18 0x7f8c1601894c (/usr/lib/chromium-dev/libbase.so+0x22294b) 
#19 0x7f8c0700b259 start_thread 
#20 0x7f8c069f25e3 __GI___clone Task trace: 
#0 0x7f8c064ac67e media::VaapiVideoDecodeAccelerator::AssignPictureBuffers() 
#1 0x7f8c0d82075a (/usr/lib/chromium-dev/libmedia_mojo_services.so+0x9f759) 
#2 0x7f8c064ab814 media::VaapiVideoDecodeAccelerator::TryFinishSurfaceSetChange() 
#3 0x7f8c064aa80b media::VaapiVideoDecodeAccelerator::DecodeTask() 
#4 0x7f8c064aa01b media::VaapiVideoDecodeAccelerator::QueueInputBuffer() Task trace buffer limit hit, update PendingTask::kTaskBacktraceLength to increase. Crash keys: "last-video-decoder" = "name=VDAVideoDecoder:codec=h264:profile=3:size=1280x720:cs=[1,1,2,1]:hdrm=0" "num-video-decoders" = "1"
GpuProcessHost: The GPU process crashed!

This does not happen with 95.0.4621.4 that I had to recompile due to the latest harfbuzz update as well.
Only drawback there: Any videos from sites other than YouTube are played using FFMPEGVideoDecoder, regardless of their codec being H.264 as well.
When I try to play a video someone sent me on Whatsapp, Chromium does not even seem to try to initialize the VDAVideodecoder:

"Selected FFmpegVideoDecoder for video decoding, config: codec: h264, profile: h264 baseline, level: not available, alpha_mode: is_opaque, coded size: [640,352], visible rect: [0,0,640,352], natural size: [640,352], has extra data: true, encryption scheme: Unencrypted, rotation: 90°, flipped: 0, color space: {primaries:SMPTE170M, transfer:SMPTE170M, matrix:SMPTE170M, range:LIMITED}"

In contrast, for YouTube, VDAVideoVideoDecoder is chosen automatically:

"Selected VDAVideoDecoder for video decoding, config: codec: h264, profile: h264 main, level: not available, alpha_mode: is_opaque, coded size: [1280,720], visible rect: [0,0,1280,720], natural size: [1280,720], has extra data: false, encryption scheme: Unencrypted, rotation: 0°, flipped: 0, color space: {primaries:BT709, transfer:BT709, matrix:BT709, range:LIMITED}"

Last edited by DAC324 (2021-11-09 12:46:50)

Offline

#571 2021-11-10 19:33:58

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

Re: chromium: hardware video acceleration with VA-API

It is interesting that there seems to be almost no interest in this topic.
There are no responses or contributions, even in the bug reports.

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

Offline

#572 2021-11-10 20:01:36

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

Re: chromium: hardware video acceleration with VA-API

why everyone set '--disable-features=UseOzonePlatform'?

Offline

#573 2021-11-11 13:47:17

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

Re: chromium: hardware video acceleration with VA-API

once wrote:

why everyone set '--disable-features=UseOzonePlatform'?

According to information from the net (including this thread here), there are problems with Ozone running under X11. In particular, video acceleration (VA-API support) does not seem to work with Ozone enabled.
But, as far as I know, starting with Chromium 96.x, Ozone will be the default platform, and cannot be disabled. Hence, '--disable-features=UseOzonePlatform' will have no effect anymore.
If Ozone is not working as expected, all you can do, is revert to Chromium 95.x versions.

Good news: I am just testing 98.0.4696.4 (installed via the Chromium-dev AUR package). Hardware acceleration for video decoding appears to be working (no crash, VDAVideoDecoder chosen on YouTube). However, Video Encoding is set to "Software only".

Last edited by DAC324 (2021-11-11 13:52:23)

Offline

#574 2021-11-11 17:42:57

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

Re: chromium: hardware video acceleration with VA-API

DAC324 wrote:
once wrote:

why everyone set '--disable-features=UseOzonePlatform'?

According to information from the net (including this thread here), there are problems with Ozone running under X11. In particular, video acceleration (VA-API support) does not seem to work with Ozone enabled.
But, as far as I know, starting with Chromium 96.x, Ozone will be the default platform, and cannot be disabled. Hence, '--disable-features=UseOzonePlatform' will have no effect anymore.
If Ozone is not working as expected, all you can do, is revert to Chromium 95.x versions.

Good news: I am just testing 98.0.4696.4 (installed via the Chromium-dev AUR package). Hardware acceleration for video decoding appears to be working (no crash, VDAVideoDecoder chosen on YouTube). However, Video Encoding is set to "Software only".

Which flags did you use?

Offline

#575 2021-11-12 09:10:52

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

Re: chromium: hardware video acceleration with VA-API

moturhead wrote:
DAC324 wrote:

Good news: I am just testing 98.0.4696.4 (installed via the Chromium-dev AUR package). Hardware acceleration for video decoding appears to be working (no crash, VDAVideoDecoder chosen on YouTube). However, Video Encoding is set to "Software only".

Which flags did you use?

I currently have the following flags active:

--disable-software-rasterizer
--disable-gpu-driver-bug-workarounds
--disable-gpu-driver-workarounds
--disable-gpu-vsync
--enable-accelerated-video-decode
--enable-accelerated-mjpeg-decode
--enable-features=VaapiVideoDecoder,CanvasOopRasterization
--disable-features=UseOzonePlatform
--enable-gpu-compositing
--enable-gpu-rasterization
--enable-native-gpu-memory-buffers
--enable-oop-rasterization
--enable-zero-copy
--ignore-gpu-blocklist
--use-gl=desktop
--num-raster-threads=6
# regain Sync and Google Login
--user-agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.74 Safari/537.36"

Offline

Board footer

Powered by FluxBB