V4L2 AV1 decoding on rk3588 linux platform

722 views
Skip to first unread message

Jianfeng Liu

unread,
Apr 1, 2024, 3:16:19 PM4/1/24
to Chromium-dev, benjamin...@collabora.com, stev...@google.com, we...@chromium.org
Hello everyone,
I am trying to make chromium decode av1 with v4l2 stateless decoder these days on rk3588 with mainline 6.8.2 kernel since av1 decoder of rk3588 is merged to mainline kernel v6.5 and gpu of rk3588 is going  to get merged to mainline v6.10.

At the moment chromium's av1 v4l2 decoding  support is limitted to ChromeOS, so I added a patch to enable it for linux: https://paste.armbian.com/ozulogupim.
And another patch to let chromium support multi v4l2 decoder devices because rk3588 has another hantro g1 v4l2 decoder for 1080p h264/vp8: https://paste.armbian.com/becoqedeku. I built chromium v123 with these two patches.

Then I added the following udev rules to create video-dec*/media-dec* devices for chromium:
```
SUBSYSTEM=="video4linux", ATTR{name}=="rockchip,rk3568-vpu-dec", SYMLINK+="video-dec%n"
SUBSYSTEM=="video4linux", ATTR{name}=="rockchip,rk3588-av1-vpu-dec", SYMLINK+="video-dec%n"
SUBSYSTEM=="media", ATTR{model}=="hantro-vpu", SYMLINK+="media-dec%n"
```

Then run chromium with flags "-disable_webgpu_shared_images=1", now I can decode 1080p h264 videos with v4l2 decoder. But when playing av1 video, the video is not displayed well. You can see it in the artifact.

I also confirmed that gstreamer 1.24 v4l2slav1dec works fine, here is the fluster test result: https://paste.armbian.com/viyudaxoge.swift

Although v4l2 av1 decoding is limitted to ChromeOS. I think ChromeOS is also using similar uAPI as mainline linux kernel.
Here is related code of chromium:

And here is related code of gstreamer:

I can build chromium and test if anyone need further logs.

Regards,
Jianfeng
Screencast from 03-29-2024 051013 PM.webm
Reply all
Reply to author
Forward
0 new messages