The main problem here is that Chromium is shipped as Snap, so VA-API is not available as we are running on ARM.
So the first step is obvious - remove Snap version of Chromium by sudo snap remove chromium
.
The second step is installation of Chromium as deb-package from RaspberryPi OS repository using below commands:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 82B129927FA3303E
sudo apt-add-repository "deb http://archive.raspberrypi.org/debian/ bullseye main"
cat <<EOF | sudo tee /etc/apt/preferences.d/pin-chromium
Package: *
Pin: release o=Raspberry Pi Foundation
Pin-Priority: -1
Package: chromium*
Pin: release o=Raspberry Pi Foundation
Pin-Priority: 1000
EOF
sudo apt-get update
sudo apt-get install chromium-browser
Then launch Chromium to configure it as usual - enable the following options on chrome://flags
:
- Override software rendering list aka
#ignore-gpu-blocklist
;
- GPU rasterization aka
#enable-gpu-rasterization
;
- Zero-copy rasterizer aka
#enable-zero-copy
;
- Enables Display Compositor to use a new gpu thread. aka
#enable-drdc
;
- Out-of-process 2D canvas rasterization. aka
#canvas-oop-rasterization
.
Relaunch it using chromium-browser --enable-features=VaapiVideoDecoder
, visit chrome://gpu
to ensure that you have all (excluding Vulkan) options enabled:
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: Disabled
- WebGL: Hardware accelerated
- WebGL2: Hardware accelerated
To make --enable-features=VaapiVideoDecoder
flag permanent one should edit the relevant config-file programmatically as shown below:
echo 'CHROMIUM_FLAGS="${CHROMIUM_FLAGS} --enable-features=VaapiVideoDecoder"' | sudo tee /etc/chromium.d/92-vaapi-hardware-decoding
As the result all web-players will play 1080p without lags and tearing.