RZ-G/RZ-G2 BSP Porting Ubuntu: Difference between revisions
Line 284: | Line 284: | ||
{| class="wikitable" | {| class="wikitable" | ||
|+ | |+ | ||
![[File:glmark1.png|thumb|glmark2 version]] | ![[File:glmark1.png|thumb|glmark2 version|336x336px]] | ||
![[File:glmark2.png|thumb|glmark2 result]] | ![[File:glmark2.png|thumb|glmark2 result|390x390px]] | ||
|- | |||
! colspan="2" |[[File:glmark2 image.png|thumb|829x829px]] | |||
|} | |} | ||
==Port codec Librasries== | |||
In this section, we will copy codec related files from original VLP Yocto build. | |||
i.e. core-image-qt-smarc-rzg2l.tar.bz2 or core-image-weston-smarc-rzg2l.tar.bz2 | |||
Pleaes copy this .bz2 file to Ubuntu SD card and run below instruction on reference board | |||
unzip core-image-qt-smarc-rzg2l.tar.bz2 or core-image-weston-smarc-rzg2l.tar.bz2 to folder "yocto" | |||
{| class="mw-collapsible mw-collapsed wikitable" width="50%" | |||
|copy codec drivers | |||
|- | |||
| | |||
* cd ./yocto | |||
* mkdir /root/modules | |||
* cp lib/modules/5.10.83-cip1-yocto-standard/extra/* /root/modules/ | |||
|} | |||
{| class="mw-collapsible mw-collapsed wikitable" width="50%" | |||
|copy gstreamer related lib | |||
|- | |||
| | |||
* cp -rd usr/bin/gst-* /usr/bin/ | |||
* cp -rd usr/lib64/libgst* /usr/lib/aarch64-linux-gnu/ | |||
* cp -rd usr/lib64/gstreamer-1.0/ /usr/lib/aarch64-linux-gnu/ | |||
* cp -rd usr/lib64/girepository-1.0/ /usr/lib/aarch64-linux-gnu/ | |||
* cp -rd usr/lib64/libmmngr* /usr/lib/aarch64-linux-gnu/ | |||
* cp -rd usr/lib64/libvspm.so.1* /usr/lib/aarch64-linux-gnu/ | |||
* cp -rd usr/libexec/gstreamer-1.0/ /usr/lib/aarch64-linux-gnu/ | |||
* cp -rd usr/share/gstreamer-1.0/ /usr/share/ | |||
* cp -rd usr/share/gst-plugins-base/ /usr/share/ | |||
* cp -rd usr/share/locale/en_GB/LC_MESSAGES/gst* /usr/share/locale/en_GB/LC_MESSAGES/ | |||
* cp -rd usr/lib64/gstreamer-1.0/libgstomx.so /usr/lib/aarch64-linux-gnu/gstreamer-1.0/ | |||
* cp -rd usr/lib64/gstreamer-1.0/libgstvspmfilter.so /usr/lib/aarch64-linux-gnu/gstreamer-1.0/ | |||
* cp -rd usr/lib64/libomxr_* /usr/lib/aarch64-linux-gnu/ | |||
* cp -rd usr/lib64/libuvcs_* /usr/lib/aarch64-linux-gnu/ | |||
* mkdir /lib64 | |||
* cp -rd /usr/lib/aarch64-linux-gnu/ld-* /lib64/ | |||
* cp etc/xdg/gstomx.conf /etc/xdg/ | |||
== | * cp etc/gstpbfilter.conf /etc/ | ||
ย | |||
* cp -r etc/omxr/ /etc/ | |||
|} | |||
{| class="mw-collapsible mw-collapsed wikitable" width="50%" | |||
|modify omx plugin configuration | |||
|- | |||
|vi /etc/xdg/gstomx.conf | |||
ย | |||
replace "lib64" as "lib/aarch64-linux-gnu" | |||
[omxh264dec] | |||
type-name=GstOMXH264Dec | |||
core-name=/usr/lib/aarch64-linux-gnu/libomxr_core.so | |||
component-name=OMX.RENESAS.VIDEO.DECODER.H264 | |||
ยทยทยทยทยท | |||
[omxh264enc] | |||
type-name=GstOMXH264Enc | |||
core-name=/usr/lib/aarch64-linux-gnu/libomxr_core.so | |||
component-name=OMX.RENESAS.VIDEO.ENCODER.H264 | |||
ยทยทยทยท | |||
|} | |||
{| class="mw-collapsible mw-collapsed wikitable" width="50%" | |||
|install gstreamer dependency | |||
|- | |||
|apt install gstreamer1.0-libav gstreamer1.0-plugins-bad | |||
|} | |||
ย | |||
=== Test gstreamer === | |||
{| class="mw-collapsible mw-collapsed wikitable" width="50%" | |||
|login as root and insmod drivers | |||
|- | |||
|insmod /root/modules/mali_kbase.ko | |||
insmod /root/modules/mmngr.ko | |||
ย | |||
insmod /root/modules/mmngrbuf.ko | |||
ย | |||
insmod /root/modules/uvcs_drv.ko | |||
ย | |||
insmod /root/modules/vspm.ko | |||
ย | |||
insmod /root/modules/vspm_if.ko | |||
|} | |||
{| class="mw-collapsible mw-collapsed wikitable" width="50%" | |||
|Specify gstreamer location | |||
|- | |||
|export GST_PLUGIN_SCANNER=/usr/lib/aarch64-linux-gnu/gstreamer-1.0/gst-plugin-scanner | |||
export GST_PLUGIN_PATH=/usr/lib/aarch64-linux-gnu/gstreamer-1.0 | |||
|} | |||
{| class="mw-collapsible mw-collapsed wikitable" width="50%" | |||
|Launch weston | |||
|- | |||
|weston โtty 1 & | |||
|} | |||
{| class="mw-collapsible mw-collapsed wikitable" width="50%" | |||
|Play Video | |||
|- | |||
| | |||
* Play video only:gst-launch-1.0 filesrc location=/root/video/sintel_trailer-720p.mp4 ! qtdemux ! queue ! h264parse ! omxh264dec ! waylandsink | |||
ย | |||
* Play video & audiogst-launch-1.0 filesrc location=/root/video/sintel_trailer-720p.mp4 ! qtdemux name=d d. ! queue ! h264parse ! omxh264dec ! waylandsink d. ! queue ! faad ! alsasink device=plughw:0,0 | |||
|} | |||
==Port Qt== | ==Port Qt== |
Revision as of 01:58, 23 May 2023
โ Back to RZ-G/RZ-G2_BSP_Porting
SoC: All
Specification
Target Ubuntu OS Version: 20.04, 18.04
Target reference board: RZ/G2L,/G2LC,/G2UL SMARC
Host PC Environment: Ubuntu20.04
Ubuntu Filesystem Building
Install QEMU
Run below command on Host Ubuntu PC
sudo apt-get install qemu-user-static
Download Required Files
Select the package to download based on the desired file system |
wget https://cdimage.ubuntu.com/ubuntubase/releases/20.04/release/ubuntu-base-20.04.4-base-arm64.tar.gz
wget http://cdimage.ubuntu.com/ubuntubase/releases/18.04.5/release/ubuntu-base-18.04.5-basearm64.tar.gz |
Prepare Files
In the following example, please replace "version" as below name as you need
ubuntu-base-20.04.4-base-arm64๏ผ 20.04.4
ubuntu-base-18.04.5-base-arm64๏ผ 18.04.5
Initial preparation |
mkdir root
tar -xpf ubuntu-base-<version>-base-arm64.tar.gz -C root cp /usr/bin/qemu-aarch64-static ./root/usr/bin/ cp -b /etc/resolv.conf root/etc/resolv.conf |
Create a new script file |
vim ch-mount.sh
#!/bin/bash function mnt() { echo "MOUNTING" sudo mount -t proc /proc ${2}proc sudo mount -t sysfs /sys ${2}sys sudo mount -o bind /dev ${2}dev sudo chroot ${2} } function umnt() { echo "UNMOUNTING" sudo umount ${2}proc sudo umount ${2}sys sudo umount ${2}dev } if [ "$1" == "-m" ] && [ -n "$2" ] ; then mnt $1 $2 elif [ "$1" == "-u" ] && [ -n "$2" ]; then umnt $1 $2 else echo "" echo "Either 1'st, 2'nd or both parameters were missing" echo "" echo "1'st parameter can be one of these: -m(mount) OR -u(umount)" echo "2'nd parameter is the full path of rootfs directory(with trailing '/')" echo "" echo "For example: ch-mount -m /media/sdcard/" echo "" echo 1st parameter : ${1} echo 2nd parameter : ${2} fi |
Configure Filesystem
Enter Filesystem
chmod +x ch-mount.sh ./ch-mount.sh -m root/ chmod -R 777 /tmp
Install required software
apt-get install \ language-pack-en-base \ sudo \ ssh \ net-tools \ network-manager \ iputils-ping \ rsyslog \ bash-completion \ htop \ resolvconf \ dialog \ vim
Add users
Plesae replace the <name> with your user name |
useradd -s '/bin/bash' -m -G adm,sudo <name>
passwd <name> passwd root chown -R root:root /bin/su chmod u+s /bin/su |
Configure UART
vim /etc/init.d/ttyS0.conf |
start on stopped rc or RUNLEVEL=[12345]
stop on RUNLEVEL [!12345] respawn exec /sbin/getty -L 115200 ttyLP0 vt102 |
Exit FileSystem
exit ./ch-mount.sh -u
packaged FileSystem
cd root tar -cjf rootfs.tar.bz2 ./*
Deploy FileSystem to SD Card
Prepare a SD card with ext4 partition: Learning/Linux#Partitioning and Formatting an SD Card
extract ubuntu .bz2 package to SD card
Sudo tar -xvf rootfs.tar.gz -C /media/xxx/rootfs
Install Wayland, Wayland-Protocols and Weston
Environment Setup
network setup |
|
install required packages |
|
Compile and install Wayland
Copy the Wayland 1.18.0 source code from VLP Yocto build folder to SD card.
i.e. build/tmp/work/aarch64-poky-linux/wayland/1.18.0-r0/wayland-1.18.0/
Enter the wayland-1.18.0 folder on SD card
Run below command on Reference Board |
|
Compile and install Wayland-protocol
Copy the wayland-protocol1.20.0 source code from VLP Yocto build folder to SD card.
i.e. build/tmp/work/aarch64-poky-linux/wayland-protocols/1.20-r0/wayland-protocols-1.20/
Enter the wayland-protocols-1.20 folder on SD card
Run below command on Reference Board |
|
Compile and install Weston
Copy the weston8.0.0 source code from VLP Yocto build folder to SD card.
i.e. build/tmp/work/aarch64-poky-linux/weston/8.0.0-r0/weston-8.0.0/
Enter the weston-8.0.0 folder on SD card
Run below command on Reference Board |
|
If the configuration is correct, it will display below messages
User defined options libdir : /usr/lib/aarch64-linux-gnu prefix : /usr sysconfdir : /etc backend-drm-screencast-vaapi : false color-management-colord : false remoting : false xwayland : false
compile and install |
|
Port GPU Libraries
Please refer to the StartupGuide.txt document in meta-rz-features/recipes-graphics/mali/files/mali_pkg_eval_vx.x.tar.gz
Migrate GPU drivers
Copy the driver mali_kbase..ko from VLP Yocto build folder to SD card.
i.e. build/tmp/work/smarc_rzg2l-poky-linux/kernel-modulemali/r35-p0/image/lib/modules/5.10.83-cip1-yocto-standard/extra
install gpu .ko on reference board |
|
Migrate GPU Libraries
Copy the library files to SD card.
i.e. meta-rz-features/recipesgraphics/mali/files/mali_pkg_eval_vx.x.tar.gz
install library to reference board |
/usr/lib/aarch64-linux-gnu/
|
Testing
Install testing tool
sudo apt install glmark2-es2-wayland
Start Weston desktop
Only root user can launch weston service, please switch to root user in advance
insmod mali_kbase.ko weston --tty 1 &
Run glmark2 test
glmark2-es2-wayland --fullscreen
Port codec Librasries
In this section, we will copy codec related files from original VLP Yocto build.
i.e. core-image-qt-smarc-rzg2l.tar.bz2 or core-image-weston-smarc-rzg2l.tar.bz2
Pleaes copy this .bz2 file to Ubuntu SD card and run below instruction on reference board
unzip core-image-qt-smarc-rzg2l.tar.bz2 or core-image-weston-smarc-rzg2l.tar.bz2 to folder "yocto"
copy codec drivers |
|
copy gstreamer related lib |
|
modify omx plugin configuration |
vi /etc/xdg/gstomx.conf
replace "lib64" as "lib/aarch64-linux-gnu" [omxh264dec] type-name=GstOMXH264Dec core-name=/usr/lib/aarch64-linux-gnu/libomxr_core.so component-name=OMX.RENESAS.VIDEO.DECODER.H264 ยทยทยทยทยท [omxh264enc] type-name=GstOMXH264Enc core-name=/usr/lib/aarch64-linux-gnu/libomxr_core.so component-name=OMX.RENESAS.VIDEO.ENCODER.H264 ยทยทยทยท |
install gstreamer dependency |
apt install gstreamer1.0-libav gstreamer1.0-plugins-bad |
Test gstreamer
login as root and insmod drivers |
insmod /root/modules/mali_kbase.ko
insmod /root/modules/mmngr.ko insmod /root/modules/mmngrbuf.ko insmod /root/modules/uvcs_drv.ko insmod /root/modules/vspm.ko insmod /root/modules/vspm_if.ko |
Specify gstreamer location |
export GST_PLUGIN_SCANNER=/usr/lib/aarch64-linux-gnu/gstreamer-1.0/gst-plugin-scanner
export GST_PLUGIN_PATH=/usr/lib/aarch64-linux-gnu/gstreamer-1.0 |
Launch weston |
weston โtty 1 & |
Play Video |
|