RPi 4 - testing ffmpeg patch with HW HVEC support

Hey guys - firstly thanks for all your work, you’re awesome noble knights of modern age :stuck_out_tongue:.

There has been released a temporary patch for ffmpeg to support hw HEVC decoding on RPi 4 (before V4L2 is ready for that matter).
It is available through testing ppa on raspberrypi archive, but only for armhf because Rpi4’s GPU is 32 bit from what I understand.

I’m trying to make it work it with BalenaOS and balenalib/raspberrypi3:buster-run docker image.

When I open HEVC video in VLC, the mmal loads the hevc decoder, but says that decoder memory device is missing:
[hevc @ 0xc547d0] can't open /dev/rpivid-hevcmem
The playing user is in video group, so it’s not a permission issue and the devices are also missing on host OS.

I found that /dev/rpivid-* devices are mentioned in rpivid-mem module of broadcom driver but my noobness prevented me to move any further. My guess is that balenaOS is using open source graphics drivers by default, so official ones are not loaded.

Is there a way to enable the broadcom driver in BalenaOS? I found the dtoverlay config, but not sure how to proceed. Thanks.

Hey,

We will take a look and try to get the requried components built into the balenaOS image.

Issue to track this here: https://github.com/balena-os/balena-raspberrypi/issues/453

Thanks.

By testing the patch on Raspbian and LibreELEC I found that the patch uses also these VideoCore devices:

/dev/vc-mem
/dev/vcsm
/dev/vcsm-cma
/dev/vchiq
/dev/vcio

In case that would help I’m attaching a list of loaded kernel modules from LibreELEC where it works smoothly :

LibreELEC:~/videos # less /proc/modules
hci_uart 40960 1 - Live 0xbf4cd000
btbcm 16384 1 hci_uart, Live 0xbf4c6000
serdev 16384 1 hci_uart, Live 0xbf4bd000
bluetooth 434176 23 hci_uart,btbcm, Live 0xbf432000
ecdh_generic 28672 2 bluetooth, Live 0xbf428000
8021q 28672 0 - Live 0xbf41b000
bcm2835_codec 32768 0 - Live 0xbf40d000 ©
videobuf2_dma_contig 20480 1 bcm2835_codec, Live 0xbf404000
videobuf2_memops 16384 1 videobuf2_dma_contig, Live 0xbf3fd000
bcm2835_mmal_vchiq 28672 1 bcm2835_codec, Live 0xbf3f1000 ©
v4l2_mem2mem 20480 1 bcm2835_codec, Live 0xbf3e8000
videobuf2_v4l2 20480 2 bcm2835_codec,v4l2_mem2mem, Live 0xbf3df000
brcmfmac 258048 0 - Live 0xbf2d5000
brcmutil 16384 1 brcmfmac, Live 0xbf2c5000
videobuf2_common 36864 3 bcm2835_codec,v4l2_mem2mem,videobuf2_v4l2, Live 0xbf2b5000
cfg80211 512000 1 brcmfmac, Live 0xbf11d000
videodev 151552 4 bcm2835_codec,v4l2_mem2mem,videobuf2_v4l2,videobuf2_common, Live 0xbf069000
media 28672 3 bcm2835_codec,v4l2_mem2mem,videodev, Live 0xbf05c000
rfkill 24576 5 bluetooth,cfg80211, Live 0xbf038000
fixed 16384 0 - Live 0xbf028000
rpivid_mem 16384 36 - Live 0xbf005000
bcm2835_gpiomem 16384 0 - Live 0xbf000000