From: Trevor Woerner <twoerner@gmail.com>
To: yocto-patches@lists.yoctoproject.org
Cc: Quentin Schulz <quentin.schulz@cherry.de>
Subject: [meta-rockchip][scarthgap][PATCH 09/10] enable HW VPU decoding for SoCs that have stateless VPUs
Date: Mon, 9 Sep 2024 10:55:29 -0400 [thread overview]
Message-ID: <20240909145530.25301-10-twoerner@gmail.com> (raw)
In-Reply-To: <20240909145530.25301-1-twoerner@gmail.com>
From: Quentin Schulz <quentin.schulz@cherry.de>
v4l2codecs is the gstreamer plugin for V4L2 stateless video hardware
decoding. The Rockchip SoCs that have a VPU all seems to be based on
Hantro, RKVDEC or RKVDECv2, all stateless encoding/decoding VPUs.
Therefore, let's enable VPU decoding in Gstreamer whenever possible,
when the SoC supports it.
PX30, RK3066, RK3188, RK3288, RK3328, RK3399, RK356x and RK3588(s) all
have at least one Hantro VPU.
RK3328, RK3399, RK356x and RK3588(s) all have at least one
RKVDEC/RKVDECv2 VPU (though not necessarily supported in the upstream
kernel just yet).
=== PX30
Tested on PX30 Ringneck with with Haikou+Haikou Video Demo adapter:
$ gst-launch-1.0 filesrc location=$FILE ! parsebin ! v4l2slh264dec ! waylandsink
with FILE storing the path to any h264 file, e.g.
https://download.blender.org/peach/bigbuckbunny_movies/big_buck_bunny_720p_h264.mov
https://download.blender.org/peach/bigbuckbunny_movies/big_buck_bunny_1080p_h264.mov
Needed packages are:
- weston
- gstreamer1.0-plugins-bad (for waylandsink and v4l2slh264dec)
- gstreamer1.0-plugins-base (for parsebin)
A few frames are dropped every other second for 1080p but otherwise
smooth.
=== RK3399
Tested on RK3399 Puma with Haikou:
$ gst-launch-1.0 filesrc location=$FILE ! parsebin ! v4l2slh264dec ! waylandsink
with FILE storing the path to any h264 file, e.g.
https://download.blender.org/peach/bigbuckbunny_movies/big_buck_bunny_1080p_h264.mov
https://download.blender.org/demo/movies/BBB/bbb_sunflower_2160p_30fps_normal.mp4.zip
Needed packages are:
- weston
- gstreamer1.0-plugins-bad (for waylandsink and v4l2codecs)
- gstreamer1.0-plugins-base (for parsebin)
=== RK3588
Tested on a RK3588 Tiger with Haikou+Haikou Video Demo adapter - on a
downstream v6.6 (upstream-based, not Rockchip BSP-based) with DSI
patches - :
$ gst-launch-1.0 filesrc location=$FILE ! parsebin ! v4l2slav1dec ! fakesink
with FILE storing the path to any AV1 file, e.g.
http://download.opencontent.netflix.com.s3.amazonaws.com/AV1/cmaf/spark-8b-59.94fps/spark_606kbps_432p.mp4
https://woolyss.com/f/av1-nosound-chimera.mp4
https://woolyss.com/f/av1-opus-sita.webm
Needed packages are:
- gstreamer1.0-plugins-bad (for fakesink and v4l2slav1dec)
- gstreamer1.0-plugins-base (for parsebin)
For some reason though, waylandsink is very choppy. Combining
fpsdisplaysink with fakesink shows a ~60fps when decoding the 432p file,
~24fps for the two others.
Note that 10b-depth isn't supported (at least in my setup).
Reviewed-by: Trevor Woerner <twoerner@gmail.com>
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
---
README | 22 +++++++++++++++++++
conf/machine/include/px30.inc | 2 ++
conf/machine/include/rk3066.inc | 2 ++
conf/machine/include/rk3188.inc | 2 ++
conf/machine/include/rk3288.inc | 2 ++
conf/machine/include/rk3328.inc | 2 ++
conf/machine/include/rk3399.inc | 2 ++
conf/machine/include/rk3566.inc | 2 ++
conf/machine/include/rk3568.inc | 2 ++
conf/machine/include/rk3588s.inc | 2 ++
.../gstreamer1.0-plugins-bad_%.bbappend | 1 +
11 files changed, 41 insertions(+)
create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_%.bbappend
diff --git a/README b/README
index 8ff006e942b9..09f8691300f4 100644
--- a/README
+++ b/README
@@ -103,6 +103,28 @@ Notes:
this layer, perform the same steps as above except for the step enabling
RK_RAUC_DEMO.
+ HW video decoding with gstreamer
+
+ Most Rockchip SoCs have some integrated VPU, either Hantro, RKVDEC or
+ RKVDECv2. Those are called stateless VPUs and they require tools to be
+ adapted so they can be used. Upstream ffmpeg doesn't support them (yet)
+ but gstreamer does, via the v4l2sl* plugins. However, by default those
+ aren't built in OE-Core. This layer enables these plugins by default for
+ all SoCs that have at least one VPU (at the time of writing, all SoCs
+ supported by this layer to the exception of RK3308).
+
+ If you wish to NOT build those plugins anymore, you can set
+
+ ENABLE_STATELESS_VPU_GST = "0"
+
+ in any appropriate conf file (or in a
+ gstreamer1.0-plugins-bad_%.bbappend in your own layer).
+
+ Note that this is only relevant for upstream-based Linux kernels as
+ Rockchip have developed their own ABI for their own kernel that isn't
+ compatible (see Rockchip Media Process Platform (MPP) and
+ downstream gstreamer-rockchip plugin for those kernels).
+
U-Boot Environment:
------------------
In order to configure U-Boot to be able to store its environment into the
diff --git a/conf/machine/include/px30.inc b/conf/machine/include/px30.inc
index d78409ee5c7e..8173cb19be2c 100644
--- a/conf/machine/include/px30.inc
+++ b/conf/machine/include/px30.inc
@@ -19,3 +19,5 @@ TFA_BUILD_TARGET = "bl31"
UBOOT_SUFFIX ?= "itb"
UBOOT_ENTRYPOINT ?= "0x06000000"
+
+ENABLE_STATELESS_VPU_GST ?= "1"
diff --git a/conf/machine/include/rk3066.inc b/conf/machine/include/rk3066.inc
index 026d5b556db7..a898309bbf88 100644
--- a/conf/machine/include/rk3066.inc
+++ b/conf/machine/include/rk3066.inc
@@ -12,3 +12,5 @@ SERIAL_CONSOLES = "115200;ttyS2"
KBUILD_DEFCONFIG = "multi_v7_defconfig"
KERNEL_FEATURES:append:rk3066 = " bsp/rockchip/remove-non-rockchip-arch-arm.scc"
KERNEL_IMAGETYPE ?= "zImage"
+
+ENABLE_STATELESS_VPU_GST ?= "1"
diff --git a/conf/machine/include/rk3188.inc b/conf/machine/include/rk3188.inc
index 0120e2fd585f..554d4f1c904d 100644
--- a/conf/machine/include/rk3188.inc
+++ b/conf/machine/include/rk3188.inc
@@ -12,3 +12,5 @@ SERIAL_CONSOLES = "115200;ttyFIQ0"
KBUILD_DEFCONFIG = "multi_v7_defconfig"
KERNEL_FEATURES:append:rk3188 = " bsp/rockchip/remove-non-rockchip-arch-arm.scc"
KERNEL_IMAGETYPE ?= "zImage"
+
+ENABLE_STATELESS_VPU_GST ?= "1"
diff --git a/conf/machine/include/rk3288.inc b/conf/machine/include/rk3288.inc
index 684e8645d176..06fda69a3eb7 100644
--- a/conf/machine/include/rk3288.inc
+++ b/conf/machine/include/rk3288.inc
@@ -14,3 +14,5 @@ KERNEL_FEATURES:append:rk3288 = " bsp/rockchip/remove-non-rockchip-arch-arm.scc"
KERNEL_IMAGETYPE ?= "zImage"
UBOOT_SUFFIX ?= "bin"
+
+ENABLE_STATELESS_VPU_GST ?= "1"
diff --git a/conf/machine/include/rk3328.inc b/conf/machine/include/rk3328.inc
index 4ecd6814f9ba..e6f810dcd2ca 100644
--- a/conf/machine/include/rk3328.inc
+++ b/conf/machine/include/rk3328.inc
@@ -20,3 +20,5 @@ TFA_BUILD_TARGET = "bl31"
UBOOT_SUFFIX ?= "itb"
UBOOT_ENTRYPOINT ?= "0x06000000"
+
+ENABLE_STATELESS_VPU_GST ?= "1"
diff --git a/conf/machine/include/rk3399.inc b/conf/machine/include/rk3399.inc
index 47f0560d1578..cd1be49064ed 100644
--- a/conf/machine/include/rk3399.inc
+++ b/conf/machine/include/rk3399.inc
@@ -20,3 +20,5 @@ TFA_BUILD_TARGET = "bl31"
UBOOT_SUFFIX ?= "itb"
UBOOT_ENTRYPOINT ?= "0x06000000"
+
+ENABLE_STATELESS_VPU_GST ?= "1"
diff --git a/conf/machine/include/rk3566.inc b/conf/machine/include/rk3566.inc
index 586d68806df6..2522851fa392 100644
--- a/conf/machine/include/rk3566.inc
+++ b/conf/machine/include/rk3566.inc
@@ -19,3 +19,5 @@ PREFERRED_PROVIDER_optee-os = "rockchip-rkbin"
UBOOT_SUFFIX ?= "itb"
UBOOT_ENTRYPOINT ?= "0x06000000"
+
+ENABLE_STATELESS_VPU_GST ?= "1"
diff --git a/conf/machine/include/rk3568.inc b/conf/machine/include/rk3568.inc
index 1da212a1530c..db188a311297 100644
--- a/conf/machine/include/rk3568.inc
+++ b/conf/machine/include/rk3568.inc
@@ -19,3 +19,5 @@ PREFERRED_PROVIDER_optee-os = "rockchip-rkbin"
UBOOT_SUFFIX ?= "itb"
UBOOT_ENTRYPOINT ?= "0x06000000"
+
+ENABLE_STATELESS_VPU_GST ?= "1"
diff --git a/conf/machine/include/rk3588s.inc b/conf/machine/include/rk3588s.inc
index cd84461dab41..d349108fb973 100644
--- a/conf/machine/include/rk3588s.inc
+++ b/conf/machine/include/rk3588s.inc
@@ -18,3 +18,5 @@ PREFERRED_PROVIDER_optee-os = "rockchip-rkbin"
UBOOT_SUFFIX ?= "itb"
UBOOT_ENTRYPOINT ?= "0x06000000"
+
+ENABLE_STATELESS_VPU_GST ?= "1"
diff --git a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_%.bbappend b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_%.bbappend
new file mode 100644
index 000000000000..276230411e9c
--- /dev/null
+++ b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_%.bbappend
@@ -0,0 +1 @@
+PACKAGECONFIG:append:rockchip = "${@' v4l2codecs' if bb.utils.to_boolean(d.getVar('ENABLE_STATELESS_VPU_GST'), False) else ''}"
--
2.44.0.478.g7774cfed6261
next prev parent reply other threads:[~2024-09-09 14:56 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-09 14:55 [meta-rockchip][scarthgap][PATCH 00/10] scarthgap update Trevor Woerner
2024-09-09 14:55 ` [meta-rockchip][scarthgap][PATCH 01/10] mesa: enable lima on all rk3328 boards Trevor Woerner
2024-09-09 14:55 ` [meta-rockchip][scarthgap][PATCH 02/10] mesa: build panfrost for RK3568 boards Trevor Woerner
2024-09-09 14:55 ` [meta-rockchip][scarthgap][PATCH 03/10] user-selectable wic compression Trevor Woerner
2024-09-09 14:55 ` [meta-rockchip][scarthgap][PATCH 04/10] rockchip-rkbin: bump SRCREV Trevor Woerner
2024-09-09 14:55 ` [meta-rockchip][scarthgap][PATCH 05/10] radxa-zero-3{e|w}: add Trevor Woerner
2024-09-09 14:55 ` [meta-rockchip][scarthgap][PATCH 06/10] README: sort MACHINE names Trevor Woerner
2024-09-09 14:55 ` [meta-rockchip][scarthgap][PATCH 07/10] mesa: build panfrost for RK3566 boards Trevor Woerner
2024-09-09 14:55 ` [meta-rockchip][scarthgap][PATCH 08/10] rauc demo: add Trevor Woerner
2024-09-09 14:55 ` Trevor Woerner [this message]
2024-09-09 16:01 ` [yocto-patches] [meta-rockchip][scarthgap][PATCH 09/10] enable HW VPU decoding for SoCs that have stateless VPUs Quentin Schulz
2024-09-10 4:52 ` Trevor Woerner
2024-09-10 9:12 ` Quentin Schulz
2024-09-09 14:55 ` [meta-rockchip][scarthgap][PATCH 10/10] linux-torvalds-next: bump to next-20240904 Trevor Woerner
2024-09-13 2:57 ` [meta-rockchip][scarthgap][PATCH 00/10] scarthgap update Trevor Woerner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240909145530.25301-10-twoerner@gmail.com \
--to=twoerner@gmail.com \
--cc=quentin.schulz@cherry.de \
--cc=yocto-patches@lists.yoctoproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.