Browse Source

vpu-lib: upgrade to a3109a35b230a57d

Signed-off-by: Chunrong Guo <guochunrong@phytium.com.cn>
pull/1/head
Chunrong Guo 2 years ago
parent
commit
1b3392e238
  1. 12
      README.md
  2. 1
      board/phytium/common/debian-package-installer
  3. 2
      board/phytium/common/post-custom-skeleton-debian-base-11.sh
  4. 14
      board/phytium/common/post-custom-skeleton-ubuntu-base-20.04.sh
  5. 4
      board/phytium/common/ubuntu-additional_packages_list
  6. 4
      configs/phytium_d2000_debian_defconfig
  7. 7
      configs/phytium_d2000_debian_desktop_defconfig
  8. 4
      configs/phytium_d2000_defconfig
  9. 7
      configs/phytium_d2000_ubuntu_defconfig
  10. 4
      configs/phytium_e2000_debian_defconfig
  11. 7
      configs/phytium_e2000_debian_desktop_defconfig
  12. 2
      configs/phytium_e2000_defconfig
  13. 4
      configs/phytium_e2000_ubuntu_defconfig
  14. 7
      configs/phytium_e2000_ubuntu_desktop_defconfig
  15. 1
      package/Config.in
  16. 9050
      package/ffmpeg/0001-Add-ftomx-plugin-for-vpu-hardware-decoder.patch
  17. 43
      package/ffmpeg/0001-swscale-x86-yuv2rgb-Fix-build-without-SSSE3.patch
  18. 36
      package/ffmpeg/0002-avcodec-vaapi_h264-skip-decode-if-pic-has-no-slices.patch
  19. 72
      package/ffmpeg/0003-libavutil-Fix-mips-build.patch
  20. 47
      package/ffmpeg/0004-configure-add-extralibs-to-extralibs_xxx.patch
  21. 1
      package/ffmpeg/Config.in
  22. 3
      package/ffmpeg/ffmpeg.hash
  23. 8
      package/ffmpeg/ffmpeg.mk
  24. 12
      package/vpu-lib/Config.in
  25. 17
      package/vpu-lib/vpu-lib.mk

12
README.md

@ -232,14 +232,4 @@ chown -R user:user /home/user
```
将user用户加入audio组,可解决user用户下没声音的问题
gpasswd -a user audio
如果经过上述配置后还是没声音,或者在root用户下没声音,需要配置寄存器
(1)uboot命令行增加:
mw 0x32b30240 0x46; mw 0x32b30244 0x46;
(2)使用devmem2配置寄存器
devmem2 0x32b30210 w 0x71
devmem2 0x32b30214 w 0x71
devmem2 0x32b30218 w 0x71
devmem2 0x32b3021c w 0x71
devmem2 0x32b30220 w 0x71
```
```

1
board/phytium/common/debian-package-installer

@ -86,6 +86,7 @@ do_distrorfs_second_stage() {
[ -f /usr/bin/sudo -a ! -u /usr/bin/sudo ] && chmod +s /usr/bin/sudo
[ -d /var/cache/man ] && chown -R man:root /var/cache/man
[ -d /var/lib/sddm ] && chown -R sddm:sddm /var/lib/sddm
[ -L /lib/lib ] && rm -rf /lib/lib
# some shared libraries locate in /lib/aarch64-linux-gnu(or /lib/arm-linux-gnueabihf) and /usr/local/lib
echo export LD_LIBRARY_PATH=/usr/local/lib:/usr/lib/$sysarch:/lib/$sysarch >> /etc/profile

2
board/phytium/common/post-custom-skeleton-debian-base-11.sh

@ -78,7 +78,7 @@ do_distrorfs_first_stage() {
if [ ! -d $RFSDIR/debootstrap ]; then
echo "testdeboot"
export LANG=zh_CN.UTF-8
sudo debootstrap --arch=$1 --foreign bullseye $RFSDIR http://ftp.cn.debian.org/debian/
sudo debootstrap --arch=$1 --foreign bullseye $RFSDIR http://mirrors.163.com/debian/
echo "installing for second-stage ..."
export LC_ALL="zh_CN.UTF-8" && export LANGUAGE="zh_CN:zh" && export LANG="zh_CN.UTF-8"

14
board/phytium/common/post-custom-skeleton-ubuntu-base-20.04.sh

@ -99,7 +99,13 @@ do_distrorfs_first_stage() {
fi
# sudo chroot $RFSDIR systemctl enable systemd-rootfs-resize
file_s=$(sudo find $RFSDIR -perm -4000)
sudo chown -R $USER:$GROUPS $RFSDIR
for f in $file_s; do
sudo chmod u+s $f
done
sudo chmod u+s $RFSDIR/sbin/unix_chkpwd
if dpkg-query -l snapd | grep ii 1>/dev/null; then
chmod +rw -R $RFSDIR/var/lib/snapd/
fi
@ -237,6 +243,14 @@ main()
sudo chroot ${1} systemctl enable systemd-rootfs-chown.service
fi
if grep -Eq "^BR2_PACKAGE_VPU_LIB=y$" ${BR2_CONFIG}; then
make vpu-lib-rebuild ${O:+O=$O}
fi
if grep -Eq "^BR2_PACKAGE_FFMPEG=y$" ${BR2_CONFIG}; then
make ffmpeg-rebuild ${O:+O=$O}
fi
exit $?
}

4
board/phytium/common/ubuntu-additional_packages_list

@ -1,6 +1,6 @@
# additional packages list for SDK main userland gathered from main repo
additional_full_packages_list=" "
# for Lite userland gathered from main repo
additional_base_packages_list="net-tools iputils-ping gcc vim make autoconf automake bison bc flex libssl-dev"
additional_base_packages_list="net-tools iputils-ping gcc vim make autoconf automake bison bc flex libssl-dev \
libgstreamer1.0-0 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-tools gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-qt5 gstreamer1.0-pulseaudio "

4
configs/phytium_d2000_debian_defconfig

@ -64,3 +64,7 @@ BR2_PACKAGE_HOST_MTOOLS=y
BR2_PACKAGE_XORG_ROGUE_UMLIBS=y
BR2_PACKAGE_BUSYBOX=n
# Vpu-lib
BR2_PACKAGE_VPU_LIB=y
BR2_PACKAGE_VPU_LIB_CPU_MODEL="d2000"

7
configs/phytium_d2000_debian_desktop_defconfig

@ -65,3 +65,10 @@ BR2_PACKAGE_HOST_MTOOLS=y
BR2_PACKAGE_ROOTFS_DESKTOP=y
BR2_PACKAGE_XORG_ROGUE_UMLIBS=y
BR2_PACKAGE_BUSYBOX=n
# Vpu-lib
BR2_PACKAGE_VPU_LIB=y
BR2_PACKAGE_VPU_LIB_CPU_MODEL="d2000"
# FFmpeg
BR2_PACKAGE_FFMPEG=y

4
configs/phytium_d2000_defconfig

@ -131,3 +131,7 @@ BR2_PACKAGE_LIBOPEN62541=y
BR2_PACKAGE_LIBOPEN62541_BUILD_EXAMPLES=y
BR2_PACKAGE_XORG_ROGUE_UMLIBS=y
# Vpu-lib
BR2_PACKAGE_VPU_LIB=y
BR2_PACKAGE_VPU_LIB_CPU_MODEL="d2000"

7
configs/phytium_d2000_ubuntu_defconfig

@ -65,3 +65,10 @@ BR2_PACKAGE_HOST_MTOOLS=y
#BR2_PACKAGE_ROOTFS_DESKTOP=y
BR2_PACKAGE_XORG_ROGUE_UMLIBS=y
BR2_PACKAGE_BUSYBOX=n
# Vpu-lib
BR2_PACKAGE_VPU_LIB=y
BR2_PACKAGE_VPU_LIB_CPU_MODEL="d2000"
# FFmpeg
BR2_PACKAGE_FFMPEG=y

4
configs/phytium_e2000_debian_defconfig

@ -59,3 +59,7 @@ BR2_PACKAGE_HOST_GENIMAGE=y
BR2_PACKAGE_HOST_MTOOLS=y
BR2_PACKAGE_BUSYBOX=n
# Vpu-lib
BR2_PACKAGE_VPU_LIB=y
BR2_PACKAGE_VPU_LIB_CPU_MODEL="e2000"

7
configs/phytium_e2000_debian_desktop_defconfig

@ -60,3 +60,10 @@ BR2_PACKAGE_HOST_MTOOLS=y
BR2_PACKAGE_ROOTFS_DESKTOP=y
BR2_PACKAGE_BUSYBOX=n
# Vpu-lib
BR2_PACKAGE_VPU_LIB=y
BR2_PACKAGE_VPU_LIB_CPU_MODEL="e2000"
# FFmpeg
BR2_PACKAGE_FFMPEG=y

2
configs/phytium_e2000_defconfig

@ -57,3 +57,5 @@ BR2_TARGET_GRUB2=y
BR2_PACKAGE_HOST_DOSFSTOOLS=y
BR2_PACKAGE_HOST_GENIMAGE=y
BR2_PACKAGE_HOST_MTOOLS=y
BR2_PACKAGE_VPU_LIB=y
BR2_PACKAGE_VPU_LIB_CPU_MODEL="e2000"

4
configs/phytium_e2000_ubuntu_defconfig

@ -59,3 +59,7 @@ BR2_PACKAGE_HOST_GENIMAGE=y
BR2_PACKAGE_HOST_MTOOLS=y
BR2_PACKAGE_BUSYBOX=n
# Vpu-lib
BR2_PACKAGE_VPU_LIB=y
BR2_PACKAGE_VPU_LIB_CPU_MODEL="e2000"

7
configs/phytium_e2000_ubuntu_desktop_defconfig

@ -60,3 +60,10 @@ BR2_PACKAGE_HOST_MTOOLS=y
BR2_PACKAGE_ROOTFS_DESKTOP=y
BR2_PACKAGE_BUSYBOX=n
# Vpu-lib
BR2_PACKAGE_VPU_LIB=y
BR2_PACKAGE_VPU_LIB_CPU_MODEL="e2000"
# FFmpeg
BR2_PACKAGE_FFMPEG=y

1
package/Config.in

@ -437,6 +437,7 @@ menu "Firmware"
source "package/wilink-bt-firmware/Config.in"
source "package/zd1211-firmware/Config.in"
source "package/xorg-rogue-umlibs/Config.in"
source "package/vpu-lib/Config.in"
endmenu
source "package/18xx-ti-utils/Config.in"
source "package/a10disp/Config.in"

9050
package/ffmpeg/0001-Add-ftomx-plugin-for-vpu-hardware-decoder.patch

File diff suppressed because it is too large

43
package/ffmpeg/0001-swscale-x86-yuv2rgb-Fix-build-without-SSSE3.patch

@ -1,43 +0,0 @@
From bf8eae2d30a205bb76ac625e04c0351106981b9e Mon Sep 17 00:00:00 2001
From: Parker Ernest <@>
Date: Sun, 23 Feb 2020 13:22:42 +0100
Subject: [PATCH] swscale/x86/yuv2rgb: Fix build without SSSE3
commit fc6a5883d6af8cae0e96af84dda0ad74b360a084 breaks build on
x86_64 CPUs which do not have SSSE3, e.g. AMD Phenom-II
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
[bernd.kuhls@t-online.de:
- retrieved from upstream patchwork:
https://patchwork.ffmpeg.org/project/ffmpeg/patch/20200223122256.23402-1-michael@niedermayer.cc/
]
Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
[yann.morin.1998@free.fr: fix reference top patchwork and SoB order]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
---
libswscale/x86/yuv2rgb.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libswscale/x86/yuv2rgb.c b/libswscale/x86/yuv2rgb.c
index c12e88cbb5..4791e5b93a 100644
--- a/libswscale/x86/yuv2rgb.c
+++ b/libswscale/x86/yuv2rgb.c
@@ -83,6 +83,7 @@ av_cold SwsFunc ff_yuv2rgb_init_x86(SwsContext *c)
#if HAVE_X86ASM
int cpu_flags = av_get_cpu_flags();
+#if HAVE_SSSE3
if (EXTERNAL_SSSE3(cpu_flags)) {
switch (c->dstFormat) {
case AV_PIX_FMT_RGB32:
@@ -111,6 +112,7 @@ av_cold SwsFunc ff_yuv2rgb_init_x86(SwsContext *c)
return yuv420_rgb15_ssse3;
}
}
+#endif
if (EXTERNAL_MMXEXT(cpu_flags)) {
switch (c->dstFormat) {
--
2.26.2

36
package/ffmpeg/0002-avcodec-vaapi_h264-skip-decode-if-pic-has-no-slices.patch

@ -1,36 +0,0 @@
From 2c6b3f357331e203ad87214984661c40704aceb7 Mon Sep 17 00:00:00 2001
From: Rainer Hochecker <fernetmenta@online.de>
Date: Sat, 26 Jan 2019 19:48:35 +0100
Subject: [PATCH] avcodec/vaapi_h264: skip decode if pic has no slices
This fixes / workarounds https://bugs.freedesktop.org/show_bug.cgi?id=105368.
It was hit frequently when watching h264 channels received via DVB-X.
Corresponding kodi bug: https://github.com/xbmc/xbmc/issues/15704
Downloaded from Kodi ffmpeg repo:
https://github.com/xbmc/FFmpeg/commit/2c6b3f357331e203ad87214984661c40704aceb7
Patch was sent upstream:
http://ffmpeg.org/pipermail/ffmpeg-devel/2019-March/240863.html
Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
---
libavcodec/vaapi_h264.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/libavcodec/vaapi_h264.c b/libavcodec/vaapi_h264.c
index dd2a6571604..e521a05c4ff 100644
--- a/libavcodec/vaapi_h264.c
+++ b/libavcodec/vaapi_h264.c
@@ -314,6 +314,11 @@ static int vaapi_h264_end_frame(AVCodecContext *avctx)
H264SliceContext *sl = &h->slice_ctx[0];
int ret;
+ if (pic->nb_slices == 0) {
+ ret = AVERROR_INVALIDDATA;
+ goto finish;
+ }
+
ret = ff_vaapi_decode_issue(avctx, pic);
if (ret < 0)
goto finish;

72
package/ffmpeg/0003-libavutil-Fix-mips-build.patch

@ -1,72 +0,0 @@
From 6e8daf0d502a2a822f1f08f42368d7d676dc1a9e Mon Sep 17 00:00:00 2001
From: Bernd Kuhls <bernd.kuhls@t-online.de>
Date: Sun, 6 Jun 2021 08:54:53 +0200
Subject: [PATCH] libavutil: Fix mips build
Check for sys/auxv.h because not all toolchains contain this header.
Fixes https://trac.ffmpeg.org/ticket/9138
Patch sent upstream:
http://ffmpeg.org/pipermail/ffmpeg-devel/2021-June/281272.html
Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
---
configure | 2 ++
libavutil/mips/cpu.c | 6 +++---
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/configure b/configure
index 6bfd98b384..773a7d516c 100755
--- a/configure
+++ b/configure
@@ -2161,6 +2161,7 @@ HEADERS_LIST="
opencv2_core_core_c_h
OpenGL_gl3_h
poll_h
+ sys_auxv_h
sys_param_h
sys_resource_h
sys_select_h
@@ -6218,6 +6219,7 @@ check_func_headers VideoToolbox/VTCompressionSession.h VTCompressionSessionPrepa
check_headers windows.h
check_headers X11/extensions/XvMClib.h
check_headers asm/types.h
+check_headers sys/auxv.h
# it seems there are versions of clang in some distros that try to use the
# gcc headers, which explodes for stdatomic
diff --git a/libavutil/mips/cpu.c b/libavutil/mips/cpu.c
index 59619d54de..19196de50b 100644
--- a/libavutil/mips/cpu.c
+++ b/libavutil/mips/cpu.c
@@ -19,7 +19,7 @@
#include "libavutil/cpu.h"
#include "libavutil/cpu_internal.h"
#include "config.h"
-#if defined __linux__ || defined __ANDROID__
+#if (defined __linux__ || defined __ANDROID__) && HAVE_SYS_AUXV_H
#include <stdint.h>
#include <stdio.h>
#include <string.h>
@@ -28,7 +28,7 @@
#include "libavutil/avstring.h"
#endif
-#if defined __linux__ || defined __ANDROID__
+#if (defined __linux__ || defined __ANDROID__) && HAVE_SYS_AUXV_H
#define HWCAP_LOONGSON_CPUCFG (1 << 14)
@@ -105,7 +105,7 @@ static int cpu_flags_cpuinfo(void)
int ff_get_cpu_flags_mips(void)
{
-#if defined __linux__ || defined __ANDROID__
+#if (defined __linux__ || defined __ANDROID__) && HAVE_SYS_AUXV_H
if (cpucfg_available())
return cpu_flags_cpucfg();
else
--
2.29.2

47
package/ffmpeg/0004-configure-add-extralibs-to-extralibs_xxx.patch

@ -1,47 +0,0 @@
From 0c288853630b7b4e004774c39945d4a804afcfa8 Mon Sep 17 00:00:00 2001
From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Date: Fri, 6 Aug 2021 09:17:20 +0200
Subject: [PATCH] configure: add extralibs to extralibs_xxx
Add extralibs to extralibs_xxx (e.g. extralibs_avformat) to allow
applications such as motion to retrieve ffmpeg dependencies such as
-latomic through pkg-config
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
[Upstream status: not upstreamable]
---
configure | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/configure b/configure
index 0bb3a7cf2b..3bda99e415 100755
--- a/configure
+++ b/configure
@@ -7602,15 +7602,15 @@ rpath=$(enabled rpath && echo "-Wl,-rpath,\${libdir}")
source_path=${source_path}
LIBPREF=${LIBPREF}
LIBSUF=${LIBSUF}
-extralibs_avutil="$avutil_extralibs"
-extralibs_avcodec="$avcodec_extralibs"
-extralibs_avformat="$avformat_extralibs"
-extralibs_avdevice="$avdevice_extralibs"
-extralibs_avfilter="$avfilter_extralibs"
-extralibs_avresample="$avresample_extralibs"
-extralibs_postproc="$postproc_extralibs"
-extralibs_swscale="$swscale_extralibs"
-extralibs_swresample="$swresample_extralibs"
+extralibs_avutil="$avutil_extralibs $extralibs"
+extralibs_avcodec="$avcodec_extralibs $extralibs"
+extralibs_avformat="$avformat_extralibs $extralibs"
+extralibs_avdevice="$avdevice_extralibs $extralibs"
+extralibs_avfilter="$avfilter_extralibs $extralibs"
+extralibs_avresample="$avresample_extralibs $extralibs"
+extralibs_postproc="$postproc_extralibs $extralibs"
+extralibs_swscale="$swscale_extralibs $extralibs"
+extralibs_swresample="$swresample_extralibs $extralibs"
EOF
for lib in $LIBRARY_LIST; do
--
2.30.2

1
package/ffmpeg/Config.in

@ -50,6 +50,7 @@ config BR2_PACKAGE_FFMPEG_FFMPEG
config BR2_PACKAGE_FFMPEG_FFPLAY
bool "Build ffplay"
default y
depends on !BR2_STATIC_LIBS # sdl2
select BR2_PACKAGE_FFMPEG_SWSCALE
select BR2_PACKAGE_SDL2

3
package/ffmpeg/ffmpeg.hash

@ -1,5 +1,6 @@
# Locally calculated
sha256 eadbad9e9ab30b25f5520fbfde99fae4a92a1ae3c0257a8d68569a4651e30e02 ffmpeg-4.4.1.tar.xz
#sha256 eadbad9e9ab30b25f5520fbfde99fae4a92a1ae3c0257a8d68569a4651e30e02 ffmpeg-4.4.1.tar.xz
sha256 0d5da81feba073ee78e0f18e0966bcaf91464ae75e18e9a0135186249e3d2a0b ffmpeg-4.2.4.tar.xz
sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 COPYING.GPLv2
sha256 b634ab5640e258563c536e658cad87080553df6f34f62269a21d554844e58bfe COPYING.LGPLv2.1
sha256 cb48bf09a11f5fb576cddb0431c8f5ed0a60157a9ec942adffc13907cbe083f2 LICENSE.md

8
package/ffmpeg/ffmpeg.mk

@ -4,7 +4,7 @@
#
################################################################################
FFMPEG_VERSION = 4.4.1
FFMPEG_VERSION = 4.2.4
FFMPEG_SOURCE = ffmpeg-$(FFMPEG_VERSION).tar.xz
FFMPEG_SITE = http://ffmpeg.org/releases
FFMPEG_INSTALL_STAGING = YES
@ -34,6 +34,7 @@ FFMPEG_CONF_OPTS = \
--disable-small \
--enable-dct \
--enable-fft \
--enable-ftomx \
--enable-mdct \
--enable-rdft \
--disable-crystalhd \
@ -573,4 +574,9 @@ define FFMPEG_REMOVE_EXAMPLE_SRC_FILES
endef
FFMPEG_POST_INSTALL_TARGET_HOOKS += FFMPEG_REMOVE_EXAMPLE_SRC_FILES
define FFMPEG_INSTALL_TARGET_CMDS
$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install DESTDIR=$(TARGET_DIR)
cp $(TARGET_DIR)/usr/lib/libavcodec.so.58.54.100 $(TARGET_DIR)/usr/lib/aarch64-linux-gnu
endef
$(eval $(autotools-package))

12
package/vpu-lib/Config.in

@ -0,0 +1,12 @@
config BR2_PACKAGE_VPU_LIB
bool "vpu-lib"
help
This is a comment that explains what vpu-lib is. The help text
should be wrapped.
https://gitee.com/phytium_embedded/vpu-lib.git
config BR2_PACKAGE_VPU_LIB_CPU_MODEL
string "cpu model"
help
This is a comment that defines cpu model is, d2000 or e2000

17
package/vpu-lib/vpu-lib.mk

@ -0,0 +1,17 @@
################################################################################
#
# vpu lib
#
################################################################################
VPU_LIB_VERSION = a3109a35b230a57d860bce66d4369a74c56f12a8
VPU_LIB_SITE = https://gitee.com/phytium_embedded/vpu-lib.git
VPU_LIB_INSTALL_IMAGES = YES
VPU_LIB_SITE_METHOD = git
VPU_LIB_DEPENDENCIES = linux
define VPU_LIB_INSTALL_TARGET_CMDS
$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install DESTDIR=$(TARGET_DIR) CPU_MODEL=$(BR2_PACKAGE_VPU_LIB_CPU_MODEL)
endef
$(eval $(generic-package))
Loading…
Cancel
Save