Browse Source

usdk: update for the 2 phase multimedia dev

1. update linux config to switch to drm from framebuffer display framework
2. update buildroot to add or enable the pacakges:
    ffmpeg, libcamera, libcamera-apps, drm_test, ffmpeg_test,
    sf-gst-omx, sf-omx-il, wave511, wave521, gstream rtsp server
3. update README.md

Signed-off-by: andy.hu <andy.hu@starfivetech.com>
andy.hu 2 years ago
parent
commit
347596e09b
5 changed files with 131 additions and 17 deletions
  1. 10 3
      Makefile
  2. 97 7
      README.md
  3. 1 1
      build.sh
  4. 5 3
      conf/beaglev_defconfig_513
  5. 18 3
      conf/buildroot_initramfs_config

+ 10 - 3
Makefile

@@ -192,8 +192,8 @@ $(vmlinux): $(linux_srcdir) $(linux_wrkdir)/.config $(target_gcc) $(buildroot_in
 		modules_install
 
 # vpu building depend on the $(vmlinux), $(vmlinux) depend on $(buildroot_initramfs_sysroot)
-# so vpubuild should be built after $(vmlinux)
-vpubuild: $(vmlinux) wave511-build omxil-build gstomx-build
+# so vpubuild should be built seperately
+vpubuild: $(vmlinux) wave511-build wave521-build omxil-build gstomx-build vpudriver-build
 wave511-build:
 	$(MAKE) -C $(buildroot_initramfs_wrkdir) O=$(buildroot_initramfs_wrkdir) wave511-dirclean
 	$(MAKE) -C $(buildroot_initramfs_wrkdir) O=$(buildroot_initramfs_wrkdir) wave511-rebuild
@@ -206,8 +206,11 @@ omxil-build:
 gstomx-build:
 	$(MAKE) -C $(buildroot_initramfs_wrkdir) O=$(buildroot_initramfs_wrkdir) sf-gst-omx-dirclean
 	$(MAKE) -C $(buildroot_initramfs_wrkdir) O=$(buildroot_initramfs_wrkdir) sf-gst-omx-rebuild
+vpudriver-build:
+	$(MAKE) -C $(buildroot_initramfs_wrkdir) O=$(buildroot_initramfs_wrkdir) wave511driver
+	$(MAKE) -C $(buildroot_initramfs_wrkdir) O=$(buildroot_initramfs_wrkdir) wave521driver
 
-vpubuild_rootfs: $(vmlinux) wave511-build-rootfs omxil-build-rootfs gstomx-build-rootfs
+vpubuild_rootfs: $(vmlinux) wave511-build-rootfs wave521-build-rootfs omxil-build-rootfs gstomx-build-rootfs vpudriver-build-rootfs
 wave511-build-rootfs:
 	$(MAKE) -C $(buildroot_rootfs_wrkdir) O=$(buildroot_rootfs_wrkdir) wave511-dirclean
 	$(MAKE) -C $(buildroot_rootfs_wrkdir) O=$(buildroot_rootfs_wrkdir) wave511-rebuild
@@ -220,6 +223,10 @@ omxil-build-rootfs:
 gstomx-build-rootfs:
 	$(MAKE) -C $(buildroot_rootfs_wrkdir) O=$(buildroot_rootfs_wrkdir) sf-gst-omx-dirclean
 	$(MAKE) -C $(buildroot_rootfs_wrkdir) O=$(buildroot_rootfs_wrkdir) sf-gst-omx-rebuild
+vpudriver-build-rootfs:
+	$(MAKE) -C $(buildroot_rootfs_wrkdir) O=$(buildroot_rootfs_wrkdir) wave511driver
+	$(MAKE) -C $(buildroot_rootfs_wrkdir) O=$(buildroot_rootfs_wrkdir) wave521driver
+
 
 .PHONY: initrd
 initrd: $(initramfs)

+ 97 - 7
README.md

@@ -22,7 +22,7 @@ Install required additional packages.
 	$ sudo apt-get install autoconf automake autotools-dev bc bison xxd \
 	build-essential curl flex gawk gdisk git gperf libgmp-dev \
 	libmpc-dev libmpfr-dev libncurses-dev libssl-dev libtool \
-	patchutils python screen texinfo unzip zlib1g-dev device-tree-compiler
+	patchutils python screen texinfo unzip zlib1g-dev device-tree-compiler libyaml-dev
 
 ## Fetch code Instructions ##
 
@@ -38,10 +38,10 @@ fail because certain dependencies don't have the best git hosting.
 Once the submodules are initialized, 4 submodules `buildroot`, `HiFive_U-boot`,
 `linux` and `opensbi` need checkout to corresponding branches manually, seeing `.gitmodule`
 
-	$ cd buildroot && git checkout starlight_multimedia && cd ..
-	$ cd HiFive_U-Boot && git checkout JH7100_Multimedia_V0.1.0 && cd ..
-	$ cd linux && git checkout beaglev-5.13.y_multimedia && cd ..
-	$ cd opensbi && git checkout master && cd ..
+	$ cd buildroot && git checkout --track origin/starlight_multimedia && cd ..
+	$ cd HiFive_U-Boot && git checkout --track origin/JH7100_Multimedia_V0.1.0 && cd ..
+	$ cd linux && git checkout --track origin/beaglev-5.13.y_multimedia && cd ..
+	$ cd opensbi && git checkout --track origin/master && cd ..
 
 ## Build Instructions ##
 
@@ -49,10 +49,10 @@ After update submodules, run `make` or `make -jx` and the complete toolchain and
 fw_payload.bin.out & image.fit will be built. The completed build tree will consume about 18G of
 disk space.
 
-By default, the above generated image does not contain VPU module(wave511, the video hard decode driver and openmax-il framework library).  The following instructions will add VPU module according to your requirement:
+By default, the above generated image does not contain VPU driver module(wave511, the video hard decode driver and wave521, the video hard encode driver).  The following instructions will add VPU driver module according to your requirement:
 
 	$ make -jx
-	$ make vpubuild
+	$ make vpudriver-build
 	$ rm -rf work/buildroot_initramfs/images/rootfs.tar
 	$ make -jx
 
@@ -73,6 +73,96 @@ make buildroot_initramfs-menuconfig   # initramfs menuconfig
 make buildroot_rootfs-menuconfig      # rootfs menuconfig
 ```
 
+## How to Switch Display Framework Between DRM and Framebuffer
+
+The default display framework is `DRM` now.  Use `make linux-menuconfig`  follow below could change between `DRM` and `Framebuffer` framework
+
+If switch from `DRM`to `Framebuffer` display framework (`hdmi` display device), 
+
+```
+1. Disable the DRM feature:
+   CONFIG_DRM_I2C_NXP_TDA998X
+   CONFIG_DRM_I2C_NXP_TDA9950
+   CONFIG_DRM_STARFIVE
+
+2. Enable the Framebuffer feature:
+   CONFIG_FB_STARFIVE
+   CONFIG_FB_STARFIVE_HDMI_TDA998X
+   CONFIG_FB_STARFIVE_VIDEO
+
+Note: Recommend Disable the below for usdk:
+   CONFIG_NVDLA
+   CONFIG_FRAMEBUFFER_CONSOLE
+```
+
+If switch from `Framebuffer` to `DRM` display framework ( `hdmi` display device):
+
+```
+1. Disable the below kernel config
+   CONFIG_FB_STARFIVE
+   CONFIG_FB_STARFIVE_HDMI_TDA998X
+   CONFIG_FB_STARFIVE_VIDEO
+   CONFIG_NVDLA
+   CONFIG_FRAMEBUFFER_CONSOLE
+
+2. Enable the below kernel config:
+   CONFIG_DRM_I2C_NXP_TDA998X
+   CONFIG_DRM_I2C_NXP_TDA9950
+   CONFIG_DRM_STARFIVE
+
+Note: when use DRM to hdmi pipeline, please make sure CONFIG_DRM_STARFIVE_MIPI_DSI is disable, or will cause color abnormal.
+```
+
+If switch  from `Framebuffer`  to `DRM` display framework (`mipi dsi` display device):
+
+```
+based on the above drm to hdmi pipeline config, enable the below kernel config:
+CONFIG_PHY_M31_DPHY_RX0
+CONFIG_DRM_STARFIVE_MIPI_DSI
+```
+
+## How to Support WM8960 and AC108 Audio Board 
+
+The starlight board natively always support PWMDAC  to audio out, also support WM8960 board to audio in and audio out, also support AC108 board to audio in. Note that the WM8960 and AC108 could not be both supported.
+
+ If support WM8960 board, need to modify the follow:
+
+> HiFive_U-Boot/board/starfive/jh7100/jh7100.c:
+>
+> > #define STARFIVE_AUDIO_AC108    0
+> > #define STARFIVE_AUDIO_WM8960    1
+> > #define STARFIVE_AUDIO_VAD        0
+> > #define STARFIVE_AUDIO_PWMDAC    1
+> > #define STARFIVE_AUDIO_SPDIF    0
+> > #define STARFIVE_AUDIO_PDM        0
+>
+> HiFive_U-Boot/arch/riscv/dts/jh7100-beaglev-starlight.dts:
+>
+> > /* #include "codecs/sf_pdm.dtsi" \*/
+> > /\* #include "codecs/sf_spdif.dtsi" \*/
+> > /\* #include "codecs/sf_ac108.dtsi" \*/
+> > #include "codecs/sf_wm8960.dtsi"
+> > /\* #include "codecs/sf_vad.dtsi" \*/
+
+ If support AC108 board, need to modify the follow:
+
+> HiFive_U-Boot/board/starfive/jh7100/jh7100.c:
+>
+> > #define STARFIVE_AUDIO_AC108    1
+> > #define STARFIVE_AUDIO_WM8960    0
+> > #define STARFIVE_AUDIO_VAD        0
+> > #define STARFIVE_AUDIO_PWMDAC    1
+> > #define STARFIVE_AUDIO_SPDIF    0
+> > #define STARFIVE_AUDIO_PDM        0
+>
+> HiFive_U-Boot/arch/riscv/dts/jh7100-beaglev-starlight.dts:
+>
+> > /* #include "codecs/sf_pdm.dtsi" \*/
+> > /\* #include "codecs/sf_spdif.dtsi" \*/
+> > #include "codecs/sf_ac108.dtsi"
+> > /\*#include "codecs/sf_wm8960.dtsi" \*/
+> > /\* #include "codecs/sf_vad.dtsi" \*/
+
 ## Build TF Card Booting Image
 
 If you don't already use a local tftp server, then you probably want to make the sdcard target; the default size is 16 GBs. NOTE THIS WILL DESTROY ALL EXISTING DATA on the target sdcard; please modify the following file.

+ 1 - 1
build.sh

@@ -14,7 +14,7 @@ make MKFS_VFAT="/sbin/mkfs.vfat" \
     PARTPROBE="/sbin/partprobe" \
     SGDISK="/sbin/sgdisk" \
     -j${CORES}
-make vpubuild
+make vpudriver-build
 rm -rf work/buildroot_initramfs/images/rootfs.tar
 make MKFS_VFAT="/sbin/mkfs.vfat" \
     MKFS_EXT4="/sbin/mkfs.ext4" \

+ 5 - 3
conf/beaglev_defconfig_513

@@ -151,9 +151,9 @@ CONFIG_V4L_PLATFORM_DRIVERS=y
 CONFIG_VIDEO_STARFIVE_VIN=y
 CONFIG_VIN_SENSOR_IMX219=y
 CONFIG_DRM=y
-CONFIG_FB_STARFIVE=y
-CONFIG_FB_STARFIVE_HDMI_TDA998X=y
-CONFIG_FB_STARFIVE_VIDEO=y
+CONFIG_DRM_I2C_NXP_TDA998X=y
+CONFIG_DRM_I2C_NXP_TDA9950=y
+CONFIG_DRM_STARFIVE=y
 CONFIG_LOGO=y
 CONFIG_SOUND=y
 CONFIG_SND=y
@@ -200,6 +200,8 @@ CONFIG_BTRFS_FS_POSIX_ACL=y
 # CONFIG_DNOTIFY is not set
 CONFIG_FANOTIFY=y
 CONFIG_AUTOFS_FS=y
+CONFIG_FUSE_FS=y
+CONFIG_CUSE=y
 CONFIG_VFAT_FS=y
 CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-15"
 CONFIG_FAT_DEFAULT_UTF8=y

+ 18 - 3
conf/buildroot_initramfs_config

@@ -20,10 +20,13 @@ BR2_PACKAGE_ALSA_UTILS_AMIXER=y
 BR2_PACKAGE_ALSA_UTILS_APLAY=y
 BR2_PACKAGE_ALSA_UTILS_ASEQDUMP=y
 BR2_PACKAGE_ALSA_UTILS_SPEAKER_TEST=y
+BR2_PACKAGE_FFMPEG_GPL=y
+BR2_PACKAGE_FFMPEG_FFPROBE=y
+BR2_PACKAGE_FFMPEG_AVRESAMPLE=y
+BR2_PACKAGE_FFMPEG_POSTPROC=y
 BR2_PACKAGE_GSTREAMER1=y
 BR2_PACKAGE_GSTREAMER1_CHECK=y
 BR2_PACKAGE_GST1_PLUGINS_BASE_INSTALL_TOOLS=y
-BR2_PACKAGE_GST1_PLUGINS_BASE_PLUGIN_APP=y
 BR2_PACKAGE_GST1_PLUGINS_BASE_PLUGIN_AUDIOMIXER=y
 BR2_PACKAGE_GST1_PLUGINS_BASE_PLUGIN_AUDIORATE=y
 BR2_PACKAGE_GST1_PLUGINS_BASE_PLUGIN_AUDIOTESTSRC=y
@@ -34,7 +37,6 @@ BR2_PACKAGE_GST1_PLUGINS_BASE_PLUGIN_VIDEORATE=y
 BR2_PACKAGE_GST1_PLUGINS_BASE_PLUGIN_ALSA=y
 BR2_PACKAGE_GST1_PLUGINS_BASE_PLUGIN_OGG=y
 BR2_PACKAGE_GST1_PLUGINS_BASE_PLUGIN_VORBIS=y
-BR2_PACKAGE_GST1_PLUGINS_GOOD=y
 BR2_PACKAGE_GST1_PLUGINS_GOOD_JPEG=y
 BR2_PACKAGE_GST1_PLUGINS_GOOD_PNG=y
 BR2_PACKAGE_GST1_PLUGINS_GOOD_PLUGIN_AUDIOPARSERS=y
@@ -50,12 +52,12 @@ BR2_PACKAGE_GST1_PLUGINS_GOOD_PLUGIN_LEVEL=y
 BR2_PACKAGE_GST1_PLUGINS_GOOD_PLUGIN_MATROSKA=y
 BR2_PACKAGE_GST1_PLUGINS_GOOD_PLUGIN_MULTIFILE=y
 BR2_PACKAGE_GST1_PLUGINS_GOOD_PLUGIN_MULTIPART=y
-BR2_PACKAGE_GST1_P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