Enabling V4L2 Driver in Chromium Builds

1,574 views
Skip to first unread message

Ethan Joseph

unread,
May 4, 2021, 4:56:38 PM5/4/21
to Chromium-dev
Hello,

I am interested in enabling the V4L2 video API in standard Chromium builds. One particular device which needs this is the Rockchip RK3288 SoC. This SoC uses the Hantro G1 VPU which to accelerate video playback.

As far as I am concerned, the correct Rockchip VPU driver (from the rockchip-linux Github repo) has already been built into mainline kernel which is what I am using.

One particular device with this SoC is the Asus C201PA Chromebook. Under ChromeOS, this device uses a custom build of proprietary Google Chrome for ARM. This build uses the V4L2 API and accelerates video playback.

I am just wondering if there is any way to enable this API or if there are any plans to implement this in a Chromium build.

Thank you,

Ethan Joseph

Andres Calderon Jaramillo

unread,
May 4, 2021, 10:35:52 PM5/4/21
to ethan....@gmail.com, Chromium-dev
Hi Ethan. While we don't support this configuration officially (non-Chrome OS Linux + ARM + video acceleration) and don't make any guarantees for it, it should be possible to enable it in your own Chromium builds. I wouldn't be surprised if there's some iterating to be done, but a good starting point for enabling video decode acceleration is the following:

1) Set use_v4l2_codec=true in your GN args.

2) Run Chromium with --enable-features=VaapiVideoDecoder or change this to FEATURE_ENABLED_BY_DEFAULT (ignore the "Vaapi" in the name - it's not necessarily VA-API-specific).

Let me know how that goes because there are other interesting places in the code to look at. Specifically, we're trying to refactor the way we do video decode acceleration for VA-API and V4L2 in Chromium, and some extra changes are needed to use the new way.

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/25e24849-13f6-4b4b-87e8-ad654cfdf776n%40chromium.org.

Ethan Joseph

unread,
Dec 30, 2021, 12:38:06 PM12/30/21
to Chromium-dev, andr...@chromium.org, Chromium-dev, Ethan Joseph
Hello,

Thank you for your reply. I apologize for how long this took as I just recently got to it. When compiling Chromium for ARM with the changes you suggested, I got several errors about missing kernel media headers. One example of this is

../../media/gpu/v4l2/v4l2_video_decoder_delegate_vp9_legacy.cc:12:10: fatal error: 'linux/media/vp9-ctrls-legacy.h' file not found

Do you know by any chance how I can get these headers?

kwange e

unread,
Jan 27, 2022, 8:36:34 PM1/27/22
to Chromium-dev, ethan....@gmail.com, andr...@chromium.org, Chromium-dev
Hi Ethan.
I also meet the same build error as you.
What I found is some stateless codec related header is not exist in kernel 5.11 below.

So, if you fetch the version of chromium that includes V4L2VDA that supports stateless codec and build it under kernel 5.11, such a problem seems to occur.

I think there are two solutions,
fetch slightly older chromium without stateless codec code,
Or, apply fetch, which provides temporary headers as shown in the link below.

I'm going to try the second method, and I'll share the results later.

2021년 12월 31일 금요일 오전 2시 38분 6초 UTC+9에 ethan....@gmail.com님이 작성:
Reply all
Reply to author
Forward
0 new messages