mbox series

[meta-rockchip,0/9] enable v4l2codecs gstreamer plugin for VPU decoding

Message ID 20240820-gst-hantro-v1-0-335c4eaf8e8b@cherry.de
Headers show
Series enable v4l2codecs gstreamer plugin for VPU decoding | expand

Message

Quentin Schulz Aug. 20, 2024, 12:56 p.m. UTC
(Most) Rockchip SoCs have a VPU that can be used with v4l2codecs plugin
from gstreamer. In the kernel this VPU is supported by the Hantro driver
which does both stateless HW video encoding and decoding, however
gstreamer only supports decoding for now, see [1] for encoding support.

All Rockchip SoCs supported in this layer to the exception of the RK3308
have a Hantro VPU according to the compatible list in the Linux kernel,
so all SoC includes (except the one for the RK3308) now set HAS_HANTRO
value to enable VPU decoding via gstreamer.

This was only tested on RK3399 Puma and PX30 Ringneck with Haikou (+
Haikou Video Demo adapter for Ringneck) on Scarthgap 5.0.2.

Note that RK3588 upstream Linux kernel only supports AV1 decoding right
now. Also, there's currently no video output support, so this was tested
on a private downstream branch supporting DSI on RK3588 Tiger with
Haikou + Haikou Video Demo adapter).

Note that Gstreamer v4l2codecs only added support for av1 decoding in
1.23.1, so RK3588 commit doesn't necessarily make sense to be backported
right now to other branches (e.g. scarthgap or kirkstone), at the very
least until more than AV1 decoding is supported (which will probably
land this year or the next).

[1] https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5676

Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
---
Quentin Schulz (9):
      gstreamer-plugins-bad: build v4l2codecs if SoC has a VPU
      px30: enable gstreamer v4l2codecs support
      rk3399: enable gstreamer v4l2codecs support
      rk3066: enable gstreamer v4l2codecs support
      rk3188: enable gstreamer v4l2codecs support
      rk3288: enable gstreamer v4l2codecs support
      rk3328: enable gstreamer v4l2codecs support
      rk356x: enable gstreamer v4l2codecs support
      rk3588(s): enable gstreamer v4l2codecs support

 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 ++
 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_%.bbappend | 1 +
 10 files changed, 19 insertions(+)
---
base-commit: d9566c54b72fd83f1a953fb691ad61f1144544a6
change-id: 20240813-gst-hantro-be7a2abd839f

Best regards,

Comments

Quentin Schulz Aug. 20, 2024, 1:24 p.m. UTC | #1
Hi all,

On 8/20/24 2:56 PM, Quentin Schulz wrote:
> (Most) Rockchip SoCs have a VPU that can be used with v4l2codecs plugin
> from gstreamer. In the kernel this VPU is supported by the Hantro driver
> which does both stateless HW video encoding and decoding, however
> gstreamer only supports decoding for now, see [1] for encoding support.
> 
> All Rockchip SoCs supported in this layer to the exception of the RK3308
> have a Hantro VPU according to the compatible list in the Linux kernel,
> so all SoC includes (except the one for the RK3308) now set HAS_HANTRO
> value to enable VPU decoding via gstreamer.
> 
> This was only tested on RK3399 Puma and PX30 Ringneck with Haikou (+
> Haikou Video Demo adapter for Ringneck) on Scarthgap 5.0.2.
> 
> Note that RK3588 upstream Linux kernel only supports AV1 decoding right
> now. Also, there's currently no video output support, so this was tested
> on a private downstream branch supporting DSI on RK3588 Tiger with
> Haikou + Haikou Video Demo adapter).
> 
> Note that Gstreamer v4l2codecs only added support for av1 decoding in
> 1.23.1, so RK3588 commit doesn't necessarily make sense to be backported
> right now to other branches (e.g. scarthgap or kirkstone), at the very
> least until more than AV1 decoding is supported (which will probably
> land this year or the next).
> 

Note that this cannot be backported to scarthgap as is as the "rockchip" 
OVERRIDES doesn't exist in that branch (yet?). I'll try to not forget 
sending a series for scarthgap if this gets merged (I am only planning 
to do so for RK3399 and PX30 as those are the only SoCs I can test and 
that can work with Gstreamer from scarthgap).

Cheers,
Quentin
Quentin Schulz Aug. 21, 2024, 3:34 p.m. UTC | #2
Hi all,

On 8/20/24 2:56 PM, Quentin Schulz wrote:
> (Most) Rockchip SoCs have a VPU that can be used with v4l2codecs plugin
> from gstreamer. In the kernel this VPU is supported by the Hantro driver
> which does both stateless HW video encoding and decoding, however
> gstreamer only supports decoding for now, see [1] for encoding support.
> 
> All Rockchip SoCs supported in this layer to the exception of the RK3308
> have a Hantro VPU according to the compatible list in the Linux kernel,
> so all SoC includes (except the one for the RK3308) now set HAS_HANTRO
> value to enable VPU decoding via gstreamer.
> 
> This was only tested on RK3399 Puma and PX30 Ringneck with Haikou (+
> Haikou Video Demo adapter for Ringneck) on Scarthgap 5.0.2.
> 

Ok, so I had leftovers from previous debugging sessions where I had an 
old version of weston (10.0.2) instead of the one from Scarthgap 
(13.0.x). Note that the color is off (red on RK3399, "negative"-like 
filter on PX30) when using weston from Scarthgap. This is apparently a 
known issue, c.f. 
https://gitlab.freedesktop.org/wayland/weston/-/issues/839. Note that 
Robert said it would be fixed in gstreamer 1.22 but the linked patch 
only made it to 1.23 (Scarthgap has 1.22, Styhead 1.24).

With Styhead, RK3399 and PX30 are working fine with weston. Considering 
what Robert said in the link above, I assume people using another 
compositor than weston may be fine on Scarthgap, so I would suggest to 
backport the patches I submitted in this series to scarthgap anyway? One 
is not forced to use weston to do VPU decoding.
FYI, I gave ~30min at backporting the gstreamer patches to 1.22.11 but 
this is above my skill set today.

Cheers,
Quentin

> Note that RK3588 upstream Linux kernel only supports AV1 decoding right
> now. Also, there's currently no video output support, so this was tested
> on a private downstream branch supporting DSI on RK3588 Tiger with
> Haikou + Haikou Video Demo adapter).
> 
> Note that Gstreamer v4l2codecs only added support for av1 decoding in
> 1.23.1, so RK3588 commit doesn't necessarily make sense to be backported
> right now to other branches (e.g. scarthgap or kirkstone), at the very
> least until more than AV1 decoding is supported (which will probably
> land this year or the next).
> 
> [1] https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5676
> 
> Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
> ---
> Quentin Schulz (9):
>        gstreamer-plugins-bad: build v4l2codecs if SoC has a VPU
>        px30: enable gstreamer v4l2codecs support
>        rk3399: enable gstreamer v4l2codecs support
>        rk3066: enable gstreamer v4l2codecs support
>        rk3188: enable gstreamer v4l2codecs support
>        rk3288: enable gstreamer v4l2codecs support
>        rk3328: enable gstreamer v4l2codecs support
>        rk356x: enable gstreamer v4l2codecs support
>        rk3588(s): enable gstreamer v4l2codecs support
> 
>   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 ++
>   recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_%.bbappend | 1 +
>   10 files changed, 19 insertions(+)
> ---
> base-commit: d9566c54b72fd83f1a953fb691ad61f1144544a6
> change-id: 20240813-gst-hantro-be7a2abd839f
> 
> Best regards,