J E L L Y E N T
Raspberry Pi 4: Hardware accelerated video decoding (GPU) in Chromium

Two months throughout the past, I wrote an tutorial that explains the becoming reach to actual DRM give a admire shut to on Chromium on the Raspberry Pi. All the diagram in which thru the tournament you look the steps of that tutorial:

you might presumably presumably presumably must per chance employ the Chromium safe browser to play videos from Netflix, Hulu, HBO, Disney+, Amazon Top, Spotify, Pandora, and plenty others (explore Fig. 1 & 2).

Supported Browser

Fig. 1: Taking part in videos on Amazon Top

the utilization of Chromium on the Raspberry Pi OS.

Supported Browser

Fig. 2: Taking part in tune on Spotify

the utilization of Chromium on the Raspberry Pi OS.

AnthonyD wrote throughout the observation fragment:

That will presumably per chance very successfully be a suitable formulation to the DRM strength of will on Raspberry Pi! How is the video playback improbable in Chromium? Produce you label if it makes employ of hardware acceleration or genuine the CPU?

Final week I had a whereas to creep some assessments and extended the educational so that you might per chance add give a admire shut to for hardware acceleration for the video decoding.

To acknowledge to that quiz, the video playback improbable is moral, nonetheless, per default Chromium makes employ of Tool (CPU) to decode the video. This reach, no hardware acceleration.

Graphics Feature Station - Tool Acceleration

Fig. 3: Graphics Attribute Preserve – Chromium on Raspberry Pi 4.

On the opposite hand, we can alternate that on this tutorial!

Hardware and Tool

You’ve to per chance need the following hardware and strength for this tutorial:

DIY: Video Decode the utilization of Hardware Acceleration

Or no longer it’s illustrious to establish in a pair of libraries, nonetheless first, the important step is to replace the create typing the following on a Terminal:

sudo appropriate-actual replace
sudo appropriate-actual enhance

Then, set up the libraries typing:

sudo appropriate-actual set up libgles2-mesa libgles2-mesa-dev xorg-dev

To be ready to web page off the hardware acceleration, first we must enable the 3D video driver (so-is opinion as False KMS), after which divulge of affairs the reminiscence to e.g. 128 MB (right here is on the full a default price).
To construct that:

  1. Open the raspi-config configurator, typing in a Terminal:
    sudo raspi-config
  2. Accelerate to Developed Alternate choices > GL Driver
  3. Preserve the choice GL (False KMS) OpenGL desktop driver with inaccurate KMS and Click on on OK
  4. Accelerate to Developed Alternate choices > Memory Sever up
  5. Create 128 and click on on on OK
  6. Preserve Quit and Reboot the create.

Ticket: whereas you might presumably presumably presumably must per chance very successfully be fresh to this configurator, you might presumably presumably presumably must per chance navigate the menu the utilization of the arrows and the tab key from your keyboard.

Once your Raspberry reboots, you might presumably presumably presumably must per chance steal a explore at that the 3D drivers are loaded and dealing:

cat /proc/instrument-tree/soc/firmwarekms@7e600000/role
cat /proc/instrument-tree/v3dbus/v3d@7ec04000/role

If every and every instructions return k, then the hardware acceleration is working and activated.

Allow hardware acceleration in Chromium

If commence a Chromium and bustle to chrome://gpu, you might presumably presumably presumably must per chance tranquil actual Fig. 1. To interchange that, we must bustle to chrome://flags and look for

  • Override instrument rendering list
  • GPU rasterization
  • Out of route of rasterization

and alternate these settings to Enabled (explore Fig. 4). After restarting the clutch browser, you might presumably presumably presumably must per chance refresh chrome://gpu and moreover you might presumably presumably presumably must per chance actual Fig. 5.

Chromium flags - hardware acceleration

Fig. 4: Chromium flags – Atmosphere flags to web page off the Hardware Acceleration.

Graphics Feature Station - Hardware Acceleration activated

Fig. 5: Graphics Attribute Preserve – Video Decode: Hardware accelerated.

That you just ravishing can steal a explore at if a video is decoded the utilization of hardware or instrument checking the chrome://media-internals/ URL whereas taking half in it. Fig. 6 displays the instrument decoder (sooner than the adjustments). Fig. 7 reach that the MmalVideoDecoder decoder is being dilapidated (after the adjustments). Appropriate right here’s the Broadcom’s library for H.264 hardware acceleration on the Raspberry Pi.

Video Decoder: DecryptingVideoDecoder

Fig. 6: Media internals – Tool Decoder

Video Decoder: MmalVideoDecoder

Fig. 7: Media internals – Hardware Decoder

Sever masks masks tearing (Update 20.08.2020)

You’ve to per chance tranquil actual the occasional « masks masks tearing ». You’ve to per chance clutch extra recordsdata about this on the dialogue board subject.

The solution is to disable the xcompmgr composition supervisor. To construct that, you might presumably presumably presumably must per chance transfer/snatch away the xcompmgr.desktop file typing:

sudo mv /and plenty others/xdg/autostart/xcompmgr.desktop /home/pi/backup.xcompmgr.desktop
sudo reboot

in every other case you might presumably presumably presumably must per chance look these steps:

  1. Open the raspi-config configurator, typing in a Terminal
    sudo raspi-config
  2. Navigate to Developed Alternate choices > Compositor > xcompmgr composition supervisor
  3. Preserve No
  4. Reboot the Raspberry Pi
    sudo reboot

That must solve most elements! I tranquil noticed a limited minute bit of masks masks tearing.

Study More

Related Post

5 Commentaires

Leave a Comment

Recent Posts

An oil tanker with 60M gallons of oil aboard is all thru the meantime sinking [video]
Amazon’s $23M book about flies (2011)
Google Coral Dev Board mini SBC is now on hand for $100
Glow: Markdown reader for the terminal with a TUI and encrypted cloud stash
The manner you would possibly well abolish your occupation, one entirely extremely contented one year at a time

Recent Posts

An oil tanker with 60M gallons of oil aboard is all thru the meantime sinking [video]
Amazon’s $23M book about flies (2011)
Google Coral Dev Board mini SBC is now on hand for $100
Glow: Markdown reader for the terminal with a TUI and encrypted cloud stash
The manner you would possibly well abolish your occupation, one entirely extremely contented one year at a time
fr_FRFrench
en_USEnglish fr_FRFrench