debian init

This commit is contained in:
itlhd 2024-04-20 11:23:43 +08:00
parent f9c5cc627e
commit 980c68de1f
736 changed files with 13776 additions and 0 deletions

44
debian/mk-base-debian.sh vendored Executable file
View File

@ -0,0 +1,44 @@
#!/bin/bash -e
if [ "$RELEASE" == "stretch" ]; then
RELEASE='stretch'
elif [ "$RELEASE" == "buster" ]; then
RELEASE='buster'
elif [ "$RELEASE" == "bullseye" ]; then
RELEASE='bullseye'
else
echo -e "\033[36m please input the os type,stretch, buster or bullseye...... \033[0m"
fi
if [ "$ARCH" == "armhf" ]; then
ARCH='armhf'
elif [ "$ARCH" == "arm64" ]; then
ARCH='arm64'
else
echo -e "\033[36m please input the os type,armhf or arm64...... \033[0m"
fi
if [ ! $TARGET ]; then
TARGET='desktop'
fi
if [ -e linaro-$RELEASE-alip-*.tar.gz ]; then
rm linaro-$RELEASE-alip-*.tar.gz
fi
cd ubuntu-build-service/$RELEASE-$TARGET-$ARCH
echo -e "\033[36m Staring Download...... \033[0m"
make clean
./configure
make
if [ -e linaro-$RELEASE-alip-*.tar.gz ]; then
sudo chmod 0666 linaro-$RELEASE-alip-*.tar.gz
mv linaro-$RELEASE-alip-*.tar.gz ../../
else
echo -e "\e[31m Failed to run livebuild, please check your network connection. \e[0m"
fi

22
debian/mk-image.sh vendored Executable file
View File

@ -0,0 +1,22 @@
#!/bin/bash -e
TARGET_ROOTFS_DIR=./binary
ROOTFSIMAGE=linaro-rootfs.img
EXTRA_SIZE_MB=300
IMAGE_SIZE_MB=$(( $(sudo du -sh -m ${TARGET_ROOTFS_DIR} | cut -f1) + ${EXTRA_SIZE_MB} ))
echo Making rootfs!
if [ -e ${ROOTFSIMAGE} ]; then
sudo rm ${ROOTFSIMAGE}
fi
for script in ./post-build.sh ../device/rockchip/common/post-build.sh; do
[ -x $script ] || continue
sudo $script "$(realpath "$TARGET_ROOTFS_DIR")"
done
sudo mkfs.ext4 -d ${TARGET_ROOTFS_DIR} ${ROOTFSIMAGE} ${IMAGE_SIZE_MB}M
echo Rootfs Image: ${ROOTFSIMAGE}

170
debian/mk-iso-debian.sh vendored Executable file
View File

@ -0,0 +1,170 @@
#! /bin/bash
ISO_FILE=debian-11.4.0-arm64-DVD-1.iso
DIR="$( cd "$( dirname "$0" )" && pwd )"
SDK_PATH=$DIR/..
INITRD=$DIR/rd
DEBIAN_DIR=$DIR/iso
KERNEL_NAME=kernel
if [ ! -f "$DIR/$ISO_FILE" ]; then
echo "Download Debian ISO"
wget https://cdimage.debian.org/debian-cd/current/arm64/iso-dvd/$ISO_FILE -P $DIR/
if [ $? -ne 0 ]
then
echo "please check link: https://cdimage.debian.org/debian-cd/current/arm64/iso-dvd/$ISO_FILE"
exit
else
echo "Download sucess"
fi
fi
if [ ! -d "$DEBIAN_DIR" ]; then
echo “decompress ISO”
xorriso -osirrox on -indev $DIR/$ISO_FILE -extract / $DEBIAN_DIR
fi
echo "unpack initrd.gz"
mkdir -p $INITRD
cp $DEBIAN_DIR/install.a64/initrd.gz $INITRD/
cd $INITRD
gunzip initrd.gz --quiet
cpio -di < initrd
rm initrd
echo "install modules into initrd"
cd $SDK_PATH/$KERNEL_NAME
make modules_install INSTALL_MOD_PATH=$INITRD --quiet
echo "pack initrd.gz"
cd $INITRD
cp $SDK_PATH/debian/overlay-debug/usr/local/bin/io $INITRD/bin/
find . | cpio --quiet -o -H newc --owner 0:0 | gzip > $DEBIAN_DIR/install.a64/initrd.gz
cd $SDK_PATH
rm -r $INITRD
if [ ! -d $SDK_PATH/$KERNEL_NAME/debian ]; then
echo -e "\033[36m Please compile the kernel deb before: ./build.sh kernel \033[0m"
exit
fi
echo "update kernel deb"
rm -f $DEBIAN_DIR/pool/main/l/linux-signed-arm64/linux-image-5*
rm -f $DEBIAN_DIR/pool/main/l/linux/linux-headers-*
rm -f $DEBIAN_DIR/pool/main/l/linux/linux-libc-*
rm -f $SDK_PATH/$KERNEL_NAME/linux-image-*dbg*.deb
cp $SDK_PATH/$KERNEL_NAME/linux-image-*.deb $DEBIAN_DIR/pool/main/l/linux-signed-arm64/
cp $SDK_PATH/$KERNEL_NAME/linux-headers-*.deb $DEBIAN_DIR/pool/main/l/linux/
cp $SDK_PATH/$KERNEL_NAME/linux-libc-*.deb $DEBIAN_DIR/pool/main/l/linux/
cp $SDK_PATH/$KERNEL_NAME/arch/arm64/boot/Image $DEBIAN_DIR/install.a64/vmlinuz
KERNEL_VERSION=$(cat $SDK_PATH/$KERNEL_NAME/include/config/kernel.release)
if [ "$KERNEL_VERSION" == "5.4.18" ]; then
echo "insert cmdline into grub.cfg"
sed -i 's/vmlinuz/vmlinuz earlycon=uart8250,mmio32,0xfeb50000 console=ttyS2,1500000n8/g' $DEBIAN_DIR/boot/grub/grub.cfg
fi
echo "modify package Depends $KERNEL_VERSION kernel"
for file in $( find $DEBIAN_DIR/pool/main/l/linux-signed-arm64/ -type f -name '*deb' | sort )
do
rm -rf tmp
dpkg-deb -I $file | grep "Kernel-Version: " &&
dpkg-deb -R $file tmp &&
sed -i '/^Kernel-Version: /c\Kernel-Version: '"$KERNEL_VERSION"'' tmp/DEBIAN/control &&
dpkg-deb -b tmp $file &&
rm -rf tmp
dpkg-deb -I $file | grep "Depends: linux-image-" &&
dpkg-deb -R $file tmp &&
sed -i '/^Depends: linux-image-/c\Depends: linux-image-'"$KERNEL_VERSION"'' tmp/DEBIAN/control &&
dpkg-deb -b tmp $file &&
rm -rf tmp
done
rm -rf tmp
# ------------------rkwifibt------------
echo -e "\033[36m Install rkwifibt.................... \033[0m"
mkdir -p $DEBIAN_DIR/pool/main/rockchip/
cp $SDK_PATH/debian/packages/arm64/rkwifibt/*.deb $DEBIAN_DIR/pool/main/rockchip/
echo "update Release info"
cd $DEBIAN_DIR/
cat << EOF >> deb.conf
Dir {
ArchiveDir ".";
OverrideDir ".";
CacheDir ".";
};
TreeDefault {
Directory "pool/";
};
BinDirectory "pool/main" {
Packages "dists/bullseye/main/binary-arm64/Packages";
};
Default {
Packages {
Extensions ".deb";
Compress ". gzip";
};
};
Contents {
Compress "gzip";
};
EOF
apt-ftparchive generate deb.conf
rm deb.conf
cat << EOF >> udeb.conf
Dir {
ArchiveDir ".";
OverrideDir ".";
CacheDir ".";
};
TreeDefault {
Directory "pool/";
};
BinDirectory "pool/main" {
Packages "dists/bullseye/main/debian-installer/binary-arm64/Packages";
};
Default {
Packages {
Extensions ".udeb";
Compress ". gzip";
};
};
Contents {
Compress "gzip";
};
EOF
apt-ftparchive generate udeb.conf
rm udeb.conf
cat << EOF >> release.conf
APT::FTPArchive::Release::Codename "bullseye";
APT::FTPArchive::Release::Origin "Debian";
APT::FTPArchive::Release::Components "main";
APT::FTPArchive::Release::Label "Debian";
APT::FTPArchive::Release::Architectures "arm64";
APT::FTPArchive::Release::Suite "bullseye";
EOF
apt-ftparchive -c release.conf release dists/bullseye > ../Release
rm release.conf
mv ../Release dists/bullseye/Release
rm dists/bullseye/main/binary-arm64/Packages
rm dists/bullseye/main/debian-installer/binary-arm64/Packages
find -follow -type f ! -name md5sum.txt -print0 | xargs -0 md5sum > md5sum.txt
echo "repack ISO"
xorriso -as mkisofs -r -V 'Debian 11 ARM64' -o $SDK_PATH/rockdev/rk3588-$ISO_FILE -J -joliet-long -cache-inodes -e /boot/grub/efi.img -no-emul-boot -append_partition 2 0xef $DEBIAN_DIR/boot/grub/efi.img -partition_cyl_align all $DEBIAN_DIR

232
debian/mk-rootfs-bullseye.sh vendored Executable file
View File

@ -0,0 +1,232 @@
#!/bin/bash -e
# Directory contains the target rootfs
TARGET_ROOTFS_DIR="binary"
case "${ARCH:-$1}" in
arm|arm32|armhf)
ARCH=armhf
;;
*)
ARCH=arm64
;;
esac
echo -e "\033[36m Building for $ARCH \033[0m"
if [ ! $VERSION ]; then
VERSION="release"
fi
echo -e "\033[36m Building for $VERSION \033[0m"
if [ ! -e linaro-bullseye-alip-*.tar.gz ]; then
echo "\033[36m Run mk-base-debian.sh first \033[0m"
exit -1
fi
echo -e "\033[36m Extract image \033[0m"
sudo tar -xpf linaro-bullseye-alip-*.tar.gz
# packages folder
sudo mkdir -p $TARGET_ROOTFS_DIR/packages
sudo cp -rpf packages/$ARCH/* $TARGET_ROOTFS_DIR/packages
# overlay folder
sudo cp -rpf overlay/* $TARGET_ROOTFS_DIR/
# overlay-firmware folder
sudo cp -rpf overlay-firmware/* $TARGET_ROOTFS_DIR/
# overlay-debug folder
# adb, video, camera test file
if [ "$VERSION" == "debug" ]; then
sudo cp -rpf overlay-debug/* $TARGET_ROOTFS_DIR/
fi
echo -e "\033[36m Change root.....................\033[0m"
sudo cp -f /etc/resolv.conf $TARGET_ROOTFS_DIR/etc/
ID=$(stat --format %u $TARGET_ROOTFS_DIR)
cat << EOF | sudo chroot $TARGET_ROOTFS_DIR
# Fixup owners
if [ "$ID" -ne 0 ]; then
find / -user $ID -exec chown -h 0:0 {} \;
fi
for u in \$(ls /home/); do
chown -h -R \$u:\$u /home/\$u
done
echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian bullseye-backports main contrib" >> /etc/apt/sources.list
echo "deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib" >> /etc/apt/sources.list
apt-get update
apt-get upgrade -y
export APT_INSTALL="apt-get install -fy --allow-downgrades"
# enter root username without password
sed -i "s~\(^ExecStart=.*\)~# \1\nExecStart=-/bin/sh -c '/bin/bash -l </dev/%I >/dev/%I 2>\&1'~" /usr/lib/systemd/system/serial-getty@.service
#---------------power management --------------
\${APT_INSTALL} pm-utils triggerhappy bsdmainutils
cp /etc/Powermanager/triggerhappy.service /lib/systemd/system/triggerhappy.service
sed -i "s/#HandlePowerKey=.*/HandlePowerKey=ignore/" /etc/systemd/logind.conf
#---------------Rga--------------
\${APT_INSTALL} /packages/rga2/*.deb
echo -e "\033[36m Setup Video.................... \033[0m"
\${APT_INSTALL} gstreamer1.0-plugins-bad gstreamer1.0-plugins-base gstreamer1.0-plugins-ugly gstreamer1.0-tools gstreamer1.0-alsa \
gstreamer1.0-plugins-base-apps qtmultimedia5-examples
\${APT_INSTALL} /packages/mpp/*
\${APT_INSTALL} /packages/gst-rkmpp/*.deb
\${APT_INSTALL} /packages/gstreamer/*.deb
\${APT_INSTALL} /packages/gst-plugins-base1.0/*.deb
\${APT_INSTALL} /packages/gst-plugins-bad1.0/*.deb
\${APT_INSTALL} /packages/gst-plugins-good1.0/*.deb
\${APT_INSTALL} /packages/gst-plugins-ugly1.0/*.deb
#---------Camera---------
echo -e "\033[36m Install camera.................... \033[0m"
\${APT_INSTALL} cheese v4l-utils
\${APT_INSTALL} /packages/libv4l/*.deb
\${APT_INSTALL} /packages/cheese/*.deb
#---------Xserver---------
echo -e "\033[36m Install Xserver.................... \033[0m"
\${APT_INSTALL} /packages/xserver/*.deb
apt-mark hold xserver-common xserver-xorg-core xserver-xorg-legacy
#---------------Openbox--------------
echo -e "\033[36m Install openbox.................... \033[0m"
\${APT_INSTALL} /packages/openbox/*.deb
#---------update chromium-----
\${APT_INSTALL} /packages/chromium/*.deb
#------------------libdrm------------
echo -e "\033[36m Install libdrm.................... \033[0m"
\${APT_INSTALL} /packages/libdrm/*.deb
#------------------libdrm-cursor------------
echo -e "\033[36m Install libdrm-cursor.................... \033[0m"
\${APT_INSTALL} /packages/libdrm-cursor/*.deb
#------------------blueman------------
echo -e "\033[36m Install blueman.................... \033[0m"
\${APT_INSTALL} blueman
echo exit 101 > /usr/sbin/policy-rc.d
chmod +x /usr/sbin/policy-rc.d
\${APT_INSTALL} blueman
rm -f /usr/sbin/policy-rc.d
#------------------blueman------------
echo -e "\033[36m Install blueman.................... \033[0m"
\${APT_INSTALL} /packages/blueman/*.deb
#------------------rkwifibt------------
echo -e "\033[36m Install rkwifibt.................... \033[0m"
\${APT_INSTALL} /packages/rkwifibt/*.deb
ln -s /system/etc/firmware /vendor/etc/
if [ "$VERSION" == "debug" ]; then
#------------------glmark2------------
echo -e "\033[36m Install glmark2.................... \033[0m"
\${APT_INSTALL} /packages/glmark2/*.deb
fi
if [ -e "/usr/lib/aarch64-linux-gnu" ] ;
then
#------------------rknpu2------------
echo -e "\033[36m move rknpu2.................... \033[0m"
mv /packages/rknpu2/*.tar /
fi
#------------------rktoolkit------------
echo -e "\033[36m Install rktoolkit.................... \033[0m"
\${APT_INSTALL} /packages/rktoolkit/*.deb
#------------------gl4es------------
# echo -e "\033[36m Install gl4es.................... \033[0m"
# \${APT_INSTALL} /packages/gl4es/*.deb
echo -e "\033[36m Install Chinese fonts.................... \033[0m"
# Uncomment zh_CN.UTF-8 for inclusion in generation
sed -i 's/^# *\(zh_CN.UTF-8\)/\1/' /etc/locale.gen
echo "LANG=zh_CN.UTF-8" >> /etc/default/locale
# Generate locale
locale-gen
# Export env vars
echo "export LC_ALL=zh_CN.UTF-8" >> ~/.bashrc
echo "export LANG=zh_CN.UTF-8" >> ~/.bashrc
echo "export LANGUAGE=zh_CN.UTF-8" >> ~/.bashrc
source ~/.bashrc
\${APT_INSTALL} ttf-wqy-zenhei fonts-aenigma
\${APT_INSTALL} xfonts-intl-chinese
# HACK debian11.3 to fix bug
\${APT_INSTALL} fontconfig --reinstall
#\${APT_INSTALL} xfce4
#ln -sf /usr/bin/startxfce4 /etc/alternatives/x-session-manager
# HACK to disable the kernel logo on bootup
#sed -i "/exit 0/i \ echo 3 > /sys/class/graphics/fb0/blank" /etc/rc.local
cp /packages/libmali/libmali-*-x11*.deb /
cp -rf /packages/rkisp/*.deb /
cp -rf /packages/rkaiq/*.deb /
cp -rf /usr/lib/firmware/rockchip/ /
# reduce 500M size for rootfs
rm -rf /usr/lib/firmware
mkdir -p /usr/lib/firmware/
mv /rockchip /usr/lib/firmware/
# mark package to hold
apt list --installed | grep -v oldstable | cut -d/ -f1 | xargs apt-mark hold
#---------------Custom Script--------------
systemctl mask systemd-networkd-wait-online.service
systemctl mask NetworkManager-wait-online.service
rm /lib/systemd/system/wpa_supplicant@.service
#------remove unused packages------------
apt remove --purge -fy linux-firmware*
#---------------Clean--------------
if [ -e "/usr/lib/arm-linux-gnueabihf/dri" ] ;
then
# Only preload libdrm-cursor for X
#sed -i "1aexport LD_PRELOAD=/usr/lib/arm-linux-gnueabihf/libdrm-cursor.so.1" /usr/bin/X
cd /usr/lib/arm-linux-gnueabihf/dri/
cp kms_swrast_dri.so swrast_dri.so rockchip_dri.so /
rm /usr/lib/arm-linux-gnueabihf/dri/*.so
mv /*.so /usr/lib/arm-linux-gnueabihf/dri/
elif [ -e "/usr/lib/aarch64-linux-gnu/dri" ];
then
# Only preload libdrm-cursor for X
#sed -i "1aexport LD_PRELOAD=/usr/lib/aarch64-linux-gnu/libdrm-cursor.so.1" /usr/bin/X
cd /usr/lib/aarch64-linux-gnu/dri/
cp kms_swrast_dri.so swrast_dri.so rockchip_dri.so /
rm /usr/lib/aarch64-linux-gnu/dri/*.so
mv /*.so /usr/lib/aarch64-linux-gnu/dri/
rm /etc/profile.d/qt.sh
fi
cd -
rm -rf /var/lib/apt/lists/*
rm -rf /var/cache/
rm -rf /packages/
EOF

7
debian/mk-rootfs.sh vendored Executable file
View File

@ -0,0 +1,7 @@
#!/bin/bash -e
if [ ! $RELEASE ]; then
RELEASE='stretch'
fi
./mk-rootfs-$RELEASE.sh

View File

@ -0,0 +1,28 @@
// Copyright 2022 Rockchip Electronics Co.,Ltd.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// 3. Neither the name of the copyright holder nor the names of its contributors
// may be used to endorse or promote products derived from this software without
// specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.

View File

@ -0,0 +1,11 @@
#!/bin/bash
echo "Loop playback $1"
while [ true ]
do
aplay $1 -r 44100 &
sleep 2
/data/stop_aplay.sh
sleep 2
done;

View File

@ -0,0 +1,12 @@
#!/bin/bash
v=$1
echo "Set ALC capture volume, volume range 0->15"
if [ ! -n "$v" ] ; then
echo "ERR: please enter a volume"
else
amixer set "ALC Capture Target" $v
amixer get "ALC Capture Target"
fi

View File

@ -0,0 +1,40 @@
#!/bin/bash
adc=$1
v=$2
gain_type=digital
if [ -n "$3" ] ; then
gain_type=$3
fi
echo "Set ADC MIC volume, Digital range 0-192, PGA range 0-8"
case $adc in
0)
ch="Left"
;;
*)
ch="Right"
;;
esac
if [ "$gain_type" == "digital" ] ; then
ch="All"
fi
echo "Will set $ch $gain_type"
if [ ! -n "$v" ] ; then
echo "ERR: please enter a volume"
echo "$0 0 192 digital"
else
if [ "$gain_type" == "digital" ] ; then
amixer set "Capture Digital" $v
amixer get "Capture Digital"
else
content="$ch Channel"
amixer set "$content" $v
amixer get "$content"
fi
fi

View File

@ -0,0 +1,13 @@
#!/bin/bash
v=$1
echo "Set HPOUT volume, range 0->33"
if [ ! -n "$v" ] ; then
echo "please enter a volume"
else
echo "set volume: $v"
amixer set "Output 1" $v
amixer get "Output 1"
fi

View File

@ -0,0 +1,13 @@
#!/bin/bash
v=$1
echo "Set HPOUT volume, range 0->33"
if [ ! -n "$v" ] ; then
echo "please enter a volume"
else
echo "set volume: $v"
amixer set "Output 2" $v
amixer get "Output 2"
fi

View File

@ -0,0 +1,15 @@
#!/bin/bash
v=$1
echo "Set Mixer volume, range 0->7"
if [ ! -n "$v" ] ; then
echo "please enter a volume"
else
echo "set volume: $v"
amixer set "Left Mixer Left Bypass" $v
amixer set "Right Mixer Left Bypass" $v
amixer get "Left Mixer Left Bypass"
amixer get "Right Mixer Left Bypass"
fi

View File

@ -0,0 +1,24 @@
#!/bin/bash
#echo "Input process name first"
#read pname
echo "Stop aplay process"
pname=aplay
PID=$(ps -e|grep $pname|head -1|awk '{printf $1}')
if [ $? -eq 0 ]; then
echo "process id:$PID"
else
echo "process $pname not exit"
exit
fi
kill -9 ${PID}
if [ $? -eq 0 ];then
echo "kill $pname success"
else
echo "kill $pname fail"
fi

View File

@ -0,0 +1,24 @@
#!/bin/bash
#echo "Input process name first"
#read pname
echo "Stop arecord process"
pname=arecord
PID=$(ps -e|grep $pname|head -1|awk '{printf $1}')
if [ $? -eq 0 ]; then
echo "process id:$PID"
else
echo "process $pname not exit"
exit
fi
kill -2 ${PID}
if [ $? -eq 0 ];then
echo "kill $pname success"
else
echo "kill $pname fail"
fi

View File

@ -0,0 +1,11 @@
#!/bin/bash
io -4 0xff560054 0x40
io -4 0xff560094 0x40
io -4 0xff560114 0x40
io -4 0xff560154 0x40
io -4 0xff5601d4 0x40
io -4 0xff560214 0x40
io -4 0xff560294 0x40
io -4 0xff5602d4 0x40
io -4 -l 0x480 0xff560000

View File

@ -0,0 +1,119 @@
#!/bin/bash
device_1=$1
device_2=$2
echo ""
echo "*****************************************************"
echo "* Rockchip Platform Audio Functions Test *"
echo "*****************************************************"
echo "* Loop playback: [0] *"
echo "* Loop capture: [1] *"
echo "* Test loopback: [2] *"
echo "* Exit audio test: [q] *"
echo "*****************************************************"
echo ""
echo -n "Please select a test case: "
read TEST_CASE
echo ""
PATH_AUDIO=/tmp/audio_test
mkdir -p $PATH_AUDIO
prepare_mic_capture()
{
amixer set "Capture Digital" 192
amixer set "Capture Mute" 0
amixer set "Right PGA Mux" "DifferentialR"
amixer set "Left PGA Mux" "DifferentialL"
amixer set "Differential Mux" "Line 2"
amixer set "Left Channel" 0
amixer set "Right Channel" 0
}
loop_playback()
{
echo "******** Loop playback start ********"
fs_tbl="8000 11025 16000 22050 32000 44100 48000 64000 88200 96000 176400 192000"
bits_tbl="16 24 32"
ch=2
seconds=2
gain=-30
play_device="default"
if [ -n "$1" ]; then
play_device=$1
fi
while [ $ch -ge 1 ]
do
for fs in $fs_tbl
do
for bits in $bits_tbl
do
echo "play_device=$play_device, ch="$ch", rate="$fs", bit=$bits, $seconds sec, gain=$gain"
sox -b $bits -r $fs -c $ch -n -t alsa $play_device synth $seconds sine 440 gain $gain
done
done
done
echo "******** Loop playback end ********"
}
loop_capture()
{
PATH_CAPTURE=$PATH_AUDIO/cap_files
mkdir $PATH_CAPTURE
fs_tbl="8000 11025 16000 22050 32000 44100 48000 64000 88200 96000 176400 192000"
bits_tbl="S16_LE S24_LE S32_LE"
ch_tbl="2"
seconds=3
capt_device="default"
if [ -n "$1" ]; then
capt_device=$1
fi
echo "******** Loop capture start ********"
for fs in $fs_tbl
do
for bits in $bits_tbl
do
for ch in $ch_tbl
do
DUMP_FILE=$(printf 'cap_fs%d_format_%s_ch%d.wav' $fs $bits $ch)
echo "capt_device: $capt_device capture $DUMP_FILE $seconds sec"
arecord -D $capt_device -r $fs -f $bits -c $ch -d $seconds $PATH_CAPTURE/$DUMP_FILE
done
done
done
echo "******** Loop capture end ********"
echo "!! Please using 'adb pull /tmp/audio_test/cap_files/ .' dump all capture files !!"
}
case $TEST_CASE in
"0")
loop_playback $device_1
;;
"1")
prepare_mic_capture
loop_capture $device_1
;;
"2")
source ./test_loopback.sh $device_1 $device_2
;;
"q")
echo "Exit audio test"
;;
*)
echo "Invalid case $TEST_CASE"
;;
esac
exit

View File

@ -0,0 +1,122 @@
#!/bin/bash
WAVS_PATH=$1
ERR_CNT=0
PREFIX_LOG="/tmp/check_logs"
TMP_STAT_LOG="tmp_stat.log"
TMP_STATS_LOG="tmp_stats.log"
STAT_LOG="stat.log"
STATS_LOG="stats.log"
RESULT_LOG="result.log"
echo "WAVS_PATH: $WAVS_PATH"
check_prepare()
{
if [ -n "$PREFIX_LOG" ]; then
TMP_STAT_LOG="$PREFIX_LOG/$TMP_STAT_LOG"
TMP_STATS_LOG="$PREFIX_LOG/$TMP_STATS_LOG"
STAT_LOG="$PREFIX_LOG/$STAT_LOG"
STATS_LOG="$PREFIX_LOG/$STATS_LOG"
RESULT_LOG="$PREFIX_LOG/$RESULT_LOG"
mkdir -p $PREFIX_LOG
else
echo "PREFIX_LOG is empty"
fi
rm $TMP_STAT_LOG -f
rm $TMP_STATS_LOG -f
rm $STAT_LOG -f
rm $STATS_LOG -f
echo "there is no error on test loopback" > $RESULT_LOG
}
# There is don't need to add function keyword on busybox shell
check_wav()
{
wav=$1
threshold_db=-15
echo "will check wav: $wav with threshold_db: $threshold_db"
sox $wav -n stat 2> $TMP_STAT_LOG
sox $wav -n stats 2> $TMP_STATS_LOG
echo "======== $wav stat info: ========" >> $STAT_LOG
cat $TMP_STAT_LOG >> $STAT_LOG
echo >> $STAT_LOG
echo "======== $wav stats info: ========" >> $STATS_LOG
cat $TMP_STATS_LOG >> $STATS_LOG
echo >> $STATS_LOG
l_pk=`awk 'NR==5{ printf "%.2f", $5 }' $TMP_STATS_LOG`
r_pk=`awk 'NR==5{ printf "%.2f", $6 }' $TMP_STATS_LOG`
echo "l_pk: $l_pk, r_pk: $r_pk"
last_err=$ERR_CNT
ERR_CNT=$(echo $l_pk $threshold_db $ERR_CNT | awk '{
if ($1 > $2) {
$3+=1;
}
} END {
printf "%d", $3;
}')
if [ $last_err != $ERR_CNT ]; then
echo "ERROR! $wav Left Pk lev dB: $l_pk > $threshold_db" >> $RESULT_LOG
else
echo "OK! $wav Left Pk lev dB: $l_pk < $threshold_db" >> $RESULT_LOG
fi
last_err=$ERR_CNT
ERR_CNT=$(echo $r_pk $threshold_db $ERR_CNT | awk '{
if ($1 > $2) {
$3+=1;
}
} END {
printf "%d", $3;
}')
if [ $last_err != $ERR_CNT ]; then
echo "ERROR! $wav Right Pk lev dB: $r_pk > $threshold_db" >> $RESULT_LOG
else
echo "OK! $wav Right Pk lev dB: $r_pk < $threshold_db" >> $RESULT_LOG
fi
echo "total ERR_CNT: $ERR_CNT"
#cat $TMP_STATS_LOG | while read line
#do
# echo "line: $line"
# label=`echo $line | awk '{ print $1 }'`
# echo "label: $label"
#done
}
check_start()
{
cd $WAVS_PATH
check_prepare
for file in `ls $WAVS_PATH`
do
if [ -f $file ]; then
# echo "found file: $file"
suffix=$(echo "$file" | cut -d . -f2)
# echo "found suffix: $suffix"
if [ $suffix == "wav" ]; then
# echo "found wav file: $file"
check_wav $file
fi
fi
done
}
check_start

View File

@ -0,0 +1,115 @@
#!/bin/bash
device_1=$1
device_2=$2
prepare_mic_capture()
{
amixer set "Capture Digital" 192
amixer set "Capture Mute" 0
amixer set "Right PGA Mux" "DifferentialR"
amixer set "Left PGA Mux" "DifferentialL"
amixer set "Differential Mux" "Line 2"
}
prepare_adc_gains()
{
adc_mic_gain=$1
echo "Prepare ADC MIC GAINs with $adc_mic_gain dB"
# PGA gain
amixer set "Left Channel" $adc_mic_gain
amixer set "Right Channel" $adc_mic_gain
}
test_loopback()
{
# PATH_CAPTURE=/mnt/sdcard/cap_files
# PATH_CAPTURE=/media/usb0/cap_files
PATH_CAPTURE=/tmp/cap_files
play_device="default"
capt_device="default"
fs=16000
capt_bits="S16_LE"
capt_ch=2
capt_seconds=60 # capture once per 1min
capt_minutes=60 # capture minutes
switch_gain_count=8
play_seconds=2
play_start_doze=0.3
play_stop_doze=1
play_bits=16
play_ch=2
if [ -n "$1" ]; then
play_device=$1
fi
if [ -n "$2" ]; then
capt_device=$2
fi
# play_gain_tbl="-30 -25 -20 -15 -10 -5 0 5 10 15 20 25 30"
play_gain_tbl="-30"
set -- $play_gain_tbl
play_gain_num=$#
test_hours=5
let "capt_count=$capt_minutes*$test_hours" # capture 120 hours
let "play_count=$capt_seconds/($play_seconds+$play_stop_doze)"
mkdir -p $PATH_CAPTURE
echo "play_device: $play_device, capt_device: $capt_device, capt_count: $capt_count, play_count: $play_count, test $test_hours hours on PATH_CAPTURE: $PATH_CAPTURE"
echo "******** Test loopback start ********"
prepare_mic_capture
for capt_cnt in `seq 1 $capt_count`; do
capt_gain=0
# playback -> capture -> playback
sox -b $play_bits -r $fs -c $play_ch -n -t alsa $play_device synth $play_seconds sine 1000 gain -30 & # do playback
# start doze
sleep $play_start_doze
let "temp=($capt_cnt-1)/($capt_count/$switch_gain_count)"
let "capt_gain=$temp%(switch_gain_count+1)*3" # step 3dB
DUMP_FILE=$(printf 'loopback_fs%d_format_%s_ch%d_mic%ddb_%04d.wav' $fs $capt_bits $capt_ch $capt_gain $capt_cnt)
echo "temp: $temp, capt_gain: $capt_gain DUMP_FILE: $DUMP_FILE"
prepare_adc_gains $capt_gain
# echo "capt_cnt: $capt_cnt"
# echo "play_count: $play_count, play_seconds: $play_seconds"
echo "arecord -D $capt_device -r $fs -f $capt_bits -c $capt_ch -d $capt_seconds $PATH_CAPTURE/$DUMP_FILE"
arecord -D $capt_device -r $fs -f $capt_bits -c $capt_ch -d $capt_seconds $PATH_CAPTURE/$DUMP_FILE & # do capture
# wait the first playback stop
sleep $play_seconds
set -- $play_gain_tbl
for play_cnt in `seq 1 $play_count`; do
play_gain=$1
shift
let play_gain_index+=1
# echo "play_gain_index: $play_gain_index, play_gain_num: $play_gain_num"
echo "sox -b $play_bits -r $fs -c $play_ch -n -t alsa $play_device synth $play_seconds sine 1000 gain $play_gain"
if [ $play_gain_index -ge $play_gain_num ]; then
set -- $play_gain_tbl
play_gain_index=0
fi
# echo "play_cnt: $play_cnt"
sox -b $play_bits -r $fs -c $play_ch -n -t alsa $play_device synth $play_seconds sine 1000 gain $play_gain # do playback
# stop doze
sleep $play_stop_doze
done;
done;
echo "******** Test loopback end ********"
}
echo "******** Test loopback v0.1.0 ********"
test_loopback $device_1 $device_2

View File

@ -0,0 +1,87 @@
#!/bin/bash
delay=8
total=${1:-10000}
fudev=/dev/sda
CNT=/data/rockchip-test/reboot_cnt
if [ ! -e "/data/rockchip-test" ]; then
echo "no /data/rockchip-test"
mkdir -p /data/rockchip-test
fi
if [ ! -e "/data/rockchip-test/auto_reboot.sh" ]; then
cp -f /rockchip-test/auto_reboot/auto_reboot.sh /data/rockchip-test/
cp -f /rockchip-test/auto_reboot/auto_reboot_test.sh /etc/init.d/
cp -f /rockchip-test/auto_reboot/rockchip_reboot.service /lib/systemd/system/
ln -sf /lib/systemd/system/rockchip_reboot.service /etc/systemd/system/multi-user.target.wants/
echo $total > /data/rockchip-test/reboot_total_cnt
sync
fi
while true
do
#if [ ! -e "$fudev" ]; then
# echo "Please insert a U disk to start test!"
# exit 0
#fi
if [ -e $CNT ]
then
cnt=`cat $CNT`
else
echo reset Reboot count.
echo 0 > $CNT
fi
echo Reboot after $delay seconds.
let "cnt=$cnt+1"
if [ $cnt -ge $total ]
then
echo AutoReboot Finisned.
echo "off" > $CNT
echo "do cleaning ..."
rm -rf /data/rockchip-test/auto_reboot.sh
rm -rf /data/rockchip-test/reboot_total_cnt
rm -f $CNT
sync
exit 0
fi
echo $cnt > $CNT
echo "current cnt = $cnt, total cnt = $total"
echo "You can stop reboot by: echo off > /data/rockchip-test/reboot_cnt"
sleep $delay
cnt=`cat $CNT`
if [ $cnt != "off" ]; then
sync
if [ -e /var/lib/systemd/pstore/console-ramoops-0 ]; then
echo "check console-ramoops-o message"
grep -q "Restarting system" /var/lib/systemd/pstore/console-ramoops-0
if [ $? -ne 0 -a $cnt -ge 2 ]; then
echo "no found 'Restarting system' log in last time kernel message"
echo "consider kernel crash in last time reboot test"
echo "quit reboot test"
rm -rf /data/rockchip-test/auto_reboot.sh
rm -rf /data/rockchip-test/reboot_total_cnt
sync
exit 1
else
reboot
fi
else
reboot
fi
else
echo "Auto reboot is off"
rm -rf /data/rockchip-test/auto_reboot.sh
rm -rf /data/rockchip-test/reboot_total_cnt
rm -f $CNT
sync
fi
exit 0
done

View File

@ -0,0 +1,33 @@
#!/bin/bash
case "$1" in
start)
if [ -e "/data/rockchip-test/auto_reboot.sh" ]; then
echo "start recovery auto-reboot"
mkdir -p /data/rockchip-test
cp /rockchip-test/auto_reboot/auto_reboot.sh /data/rockchip-test/
fi
if [ -e "/data/rockchip-test/power_lost_test.sh" ]; then
echo "start test flash power lost"
source /data/rockchip-test/power_lost_test.sh &
fi
if [ -e "/data/rockchip-test/auto_reboot.sh" ]; then
echo "start auto-reboot"
source /data/rockchip-test/auto_reboot.sh `cat /data/rockchip-test/reboot_total_cnt`&
fi
;;
stop)
echo "stop auto-reboot finished"
;;
restart|reload)
$0 stop
$0 start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
exit 0

View File

@ -0,0 +1,13 @@
#start
[Unit]
Description=Setup reboot platform
After=adbd.service
[Service]
Type=forking
ExecStart=/etc/init.d/auto_reboot_test.sh start
[Install]
WantedBy=multi-user.target
#end

View File

@ -0,0 +1,18 @@
#!/bin/bash
#export GST_DEBUG=*:5
#export GST_DEBUG=ispsrc:5
#export GST_DEBUG_FILE=/tmp/2.txt
export DISPLAY=:0.0
if [ -e "/usr/lib/arm-linux-gnueabihf" ] ;
then
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/arm-linux-gnueabihf/gstreamer-1.0
else
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/aarch64-linux-gnu/gstreamer-1.0
fi
echo "Start RKISP Camera Preview!"
gst-launch-1.0 v4l2src device=/dev/video-camera0 ! video/x-raw,format=NV12,width=640,height=480, framerate=30/1 ! xvimagesink
#gst-launch-1.0 v4l2src device=/dev/video1 ! video/x-raw, format=NV12, width=640, height=480, framerate=30/1 ! kmssink
#grep '' /sys/class/video4linux/video*/name

View File

@ -0,0 +1,67 @@
#!/bin/bash
echo "======================================================="
echo " Test all Cameras (By rkisp_demo) "
echo "======================================================="
#num is test times
COUNT=1
#cam link num
CAM_NUM=0;
#media node max
MEDIA_MAX=20;
#cif path node name
CIF_PATH="stream_cif"
#isp path node name
ISP_PATH="rkisp_mainpath"
for i in $(seq 0 $MEDIA_MAX); do
MEDIA_DEV=/dev/media$i
ISP_NODE=$(media-ctl -d $MEDIA_DEV -e $ISP_PATH)
CIF_NODE=$(media-ctl -d $MEDIA_DEV -e $CIF_PATH)
Link=$(media-ctl -d $MEDIA_DEV -p | grep "0 link")
if echo $ISP_NODE | grep -q "^/dev/video"
then
CAM_NUM=$(($CAM_NUM + 1));
eval VIDEO_NODE$i=$ISP_NODE;
echo " Check /dev/media$i is ISP-camera($(eval echo \$VIDEO_NODE$i))"
elif echo $CIF_NODE | grep -q "^/dev/video"
then
CAM_NUM=$(($CAM_NUM + 1));
if echo $Link | grep -q "0 link"
then
CAM_NUM=$(($CAM_NUM - 1));
eval VIDEO_NODE$i="";
echo " Check /dev/media$i didn't link anycamera($(eval echo \$VIDEO_NODE$i)) "
else
eval VIDEO_NODE$i=$CIF_NODE;
echo " Check /dev/media$i is CIF-camera($(eval echo \$VIDEO_NODE$i))"
fi
else
VID_NUM=$i;
echo ""
echo " Test camera(Cam_num=$CAM_NUM) times"
echo "======================================================="
# break;
fi
done
VID_NUM=$(($VID_NUM -1));
while true;do
NOW=`date`
TIME_LABEL="====== Count:$COUNT Time: $NOW ======"
echo $TIME_LABEL
COUNT=$(expr $COUNT + 1 )
i=0;
for i in $(seq 0 $CAM_NUM); do
VIDEO_DEV=$(eval echo \$VIDEO_NODE$i);
if echo $VIDEO_DEV | grep -q "^/dev/video"
then
rkisp_demo --device=$VIDEO_DEV --stream-to=/tmp/video$i.yuv --count=100;
echo "======================================================="
echo " camera $(eval echo \$VIDEO_NODE$i) No.($TEST_NUM) out /tmp/video$i.yuv is ok!";
echo "======================================================="
sleep 1;
fi
done;
done
echo END $TIME_LABEL

View File

@ -0,0 +1,54 @@
#!/bin/bash
COUNT=1
v4l2-ctl --list-devices > /tmp/.v4l2_list
ISP_VIDEO=($(awk '/rkisp_mainpath/{getline a;print a}' /tmp/.v4l2_list))
CIF_VIDEO=($(awk '/stream_cif/{getline a;print a}' /tmp/.v4l2_list))
USB_VIDEO=($(awk '/usb/{getline a;print a}' /tmp/.v4l2_list))
echo "======================================================="
echo " Test all Cameras (By v4l2) "
echo "======================================================="
echo "Found ${#ISP_VIDEO[@]} isp cameras, ${#CIF_VIDEO[@]} cif cameras, ${#USB_VIDEO[@]} usb cameras"
while true;do
NOW=`date`
TIME_LABEL="====== Count:$COUNT Time: $NOW ======"
echo $TIME_LABEL
COUNT=$(expr $COUNT + 1 )
for j in ${USB_VIDEO[*]}
do
echo "====== Capture USB Camera Path $j By v4l2 ======"
v4l2-ctl -d "$j" --set-fmt-video=width=640,height=480,pixelformat=YUYV --stream-mmap=3 --stream-count=5 --stream-poll --stream-to=/tmp/camera.yuyv
size=`ls -l /tmp/camera.yuyv | awk '{print $5}'`
if [ $size -eq 3072000 ] ;then
rm -rf /tmp/camera.yuyv
else
echo "Exit Capture USB Camera: Capture Wrong Size$size"
exit 1
fi
done
for i in ISP_VIDEO CIF_VIDEO
do
eval value=\${${i}[@]}
for j in $value
do
echo "====== Capture ISP or CIF Camera Path $j By ======"
v4l2-ctl -d "$j" --set-fmt-video=width=640,height=480,pixelformat=NV12 --stream-mmap=3 --stream-count=5 --stream-poll --stream-to=/tmp/camera.nv12
size=`ls -l /tmp/camera.nv12 | awk '{print $5}'`
if [ $size -eq 2304000 ] ;then
rm -rf /tmp/camera.nv12
else
echo "Exit Capture ISP or CIF Camera: Capture Wrong Size$size"
exit 1
fi
done
done
done
echo END $TIME_LABEL

View File

@ -0,0 +1,60 @@
#!/bin/bash
DIR_CAMERA=`dirname $0`
info_view()
{
echo "*****************************************************"
echo "*** ***"
echo "*** CAMERA TEST ***"
echo "*** ***"
echo "*****************************************************"
}
info_view
echo "*****************************************************"
echo "camera rkisp test: 1"
echo "camera usb test: 2"
echo "camera stresstest by v4l2: 3"
echo "camera stresstest by rkisp_demo: 4"
echo "*****************************************************"
read -t 30 CAMERA_CHOICE
camera_rkisp_test()
{
bash ${DIR_CAMERA}/camera_rkisp_test.sh
}
camera_usb_test()
{
bash ${DIR_CAMERA}/camera_usb_test.sh
}
camera_stresstest_v4l2()
{
bash ${DIR_CAMERA}/camera_stresstest_v4l2.sh
}
camera_stresstest_rkisp_demo()
{
bash ${DIR_CAMERA}/camera_stresstest_rkisp_demo.sh
}
case ${CAMERA_CHOICE} in
1)
camera_rkisp_test
;;
2)
camera_usb_test
;;
3)
camera_stresstest_v4l2
;;
4)
camera_stresstest_rkisp_demo
;;
*)
echo "not found your input."
;;
esac

View File

@ -0,0 +1,31 @@
#!/bin/bash
#export GST_DEBUG=*:5
export DISPLAY=:0.0
#test_camera-uvc.sh > /tmp/1.txt 2>&1
#export GST_DEBUG_FILE=/tmp/2.txt
#echo 600000000 > /sys/kernel/debug/clk/aclk_vcodec/clk_rate
#export GST_MPP_JPEGDEC_DEFAULT_FORMAT=NV12
echo "Start UVC Camera M-JPEG Preview!"
if [ -e "/usr/lib/arm-linux-gnueabihf" ] ;
then
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/arm-linux-gnueabihf/gstreamer-1.0
else
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/aarch64-linux-gnu/gstreamer-1.0
fi
v4l2-ctl --list-devices > /tmp/.v4l2_list
USB_VIDEO=($(awk '/usb/{getline a;print a}' /tmp/.v4l2_list))
echo "Found ${#USB_VIDEO[@]} USB Cameras"
rm /tmp/.v4l2_list
for i in USB_VIDEO
do
eval value=\${${i}[@]}
for j in $value
do
echo "Start Preview USB Camera Video Path $j By GStreamer"
gst-launch-1.0 v4l2src device="$j" ! image/jpeg! jpegparse ! mppjpegdec ! xvimagesink sync=false
done
done

View File

@ -0,0 +1,42 @@
#!/bin/bash
DIR_CHROMIUM=`dirname $0`
info_view()
{
echo "*****************************************************"
echo "*** ***"
echo "*** CHROMIUM TEST ***"
echo "*** ***"
echo "*****************************************************"
}
info_view
echo "***********************************************************"
echo "Chromium test: 1"
echo "SimpleBrowser test: 2"
echo "***********************************************************"
read -t 30 CHROMIUM_CHOICE
chromium_test()
{
sh ${DIR_CHROMIUM}/test_chromium_with_video.sh
}
simplebrowser_test()
{
sh ${DIR_CHROMIUM}/test_simplebrowser.sh
}
case ${CHROMIUM_CHOICE} in
1)
chromium_test
;;
2)
simplebrowser_test
;;
*)
echo "not found your input."
;;
esac

View File

@ -0,0 +1,22 @@
#!/bin/bash -e
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
export mpp_syslog_perror=1
KERNEL_VERSION=$(cat /proc/version)
if [[ $KERNEL_VERSION =~ "4.4" ]]; then
echo 0x100 > /sys/module/rk_vcodec/parameters/debug
else
echo 0x100 > /sys/module/rk_vcodec/parameters/mpp_dev_debug
fi
echo performance | tee $(find /sys/ -name *governor) /dev/null || true
if [ -e "/usr/bin/chromium" ] ;
then
chromium --no-sandbox file:///usr/local/test.mp4
else
echo "Please sure the config/rockchip_xxxx_defconfig include "chromium.config"........"
fi
echo "the governor is performance for now, please restart it........"

View File

@ -0,0 +1,19 @@
#!/bin/bash -e
#apt update
#apt install -y libqt5webengine5 qtwebengine5-examples
export mpp_syslog_perror=1
echo performance | tee $(find /sys/ -name *governor)
echo 0x100 > /sys/module/rk_vcodec/parameters/mpp_dev_debug
if [ -e "/usr/lib/aarch64-linux-gnu/qt5/examples/webenginewidgets/simplebrowser" ] ;
then
cd /usr/lib/aarch64-linux-gnu/qt5/examples/webenginewidgets/simplebrowser
./simplebrowser
#./simplebrowser https://www.baidu.com
#./simplebrowser "file:///oem/SampleVideo_1280x720_5mb.mp4"
else
echo "Please sure install the qtwebengine5-examples....."
fi
echo "the governor is performance for now, please restart it........"

View File

@ -0,0 +1,40 @@
#!/bin/bash
set_cpu_freq() {
echo userspace > $1/scaling_governor
echo $2 > $1/scaling_setspeed
cur=`cat $1/scaling_cur_freq`
if [ "$cur" -eq "$2" ];then
echo "cpu freq policy:${d##*policy} success change to $cur KHz"
else
echo "cpu freq: failed change to $2 KHz, now $cur KHz"
exit
fi
}
if [ "$#" -eq "1" ];then
for d in /sys/devices/system/cpu/cpufreq/*; do
read -a array < $d/scaling_available_frequencies
let j=${#array[@]}-1
for i in `seq 0 $j`; do
if [ "$1" -eq "${array[$i]}" ];then
set_cpu_freq $d $1
exit
fi
done
echo "cpu freq: $1 is not in available frequencies: "${array[*]}""
echo "cpu freq: now $(cat $d/scaling_cur_freq) Hz"
done
else
cnt=0
RANDOM=$$$(date +%s)
while true; do
for d in /sys/devices/system/cpu/cpufreq/*; do
read -a FREQS < $d/scaling_available_frequencies
FREQ=${FREQS[$RANDOM % ${#FREQS[@]} ]}
echo -n "cnt: $cnt, "
set_cpu_freq $d ${FREQ}
let "cnt=$cnt+1"
done
done
fi

View File

@ -0,0 +1,48 @@
#!/bin/bash
CURRENT_DIR=`dirname $0`
info_view()
{
echo $CURRENT_DIR
echo "*****************************************************"
echo "*** ***"
echo "*** CPU TEST ***"
echo "*** ***"
echo "*****************************************************"
}
info_view
echo "*****************************************************"
echo "stressapptest test: 1"
echo "cpu auto scaling: 2"
echo "stressapptest + cpu auto scaling: 3"
echo "*****************************************************"
read -t 30 CPUFREQ_CHOICE
cpu_stress_test()
{
bash ${CURRENT_DIR}/../ddr/stressapptest_test.sh &
}
cpu_freq_scaling_test()
{
bash ${CURRENT_DIR}/cpu_freq_scaling.sh &
}
case ${CPUFREQ_CHOICE} in
1)
cpu_stress_test
;;
2)
cpu_freq_scaling_test
;;
3)
cpu_stress_test
cpu_freq_scaling_test
;;
*)
echo "not found your input."
;;
esac

View File

@ -0,0 +1,45 @@
#!/bin/bash
DMC_PATH=/sys/class/devfreq/dmc
if [ ! -e "$DMC_PATH" ];then
echo "non-existent dmc path, please check if dmc enabled"
exit
fi
set_ddr_freq() {
echo userspace > $DMC_PATH/governor
echo $1 > $DMC_PATH/userspace/set_freq
cur=$(cat $DMC_PATH/cur_freq)
if [ "$cur" -eq "$1" ];then
echo "ddr freq: success change to $cur Hz"
else
echo "ddr freq: failed change to $1 HZ, now $cur Hz"
exit
fi
}
if [ "$#" -eq "1" ];then
read -a array < $DMC_PATH/available_frequencies
let j=${#array[@]}-1
for i in `seq 0 $j`; do
if [ "$1" -eq "${array[$i]}" ];then
set_ddr_freq $1
exit
fi
done
echo "ddr freq: $1 is not in available frequencies: "${array[*]}""
echo "ddr freq: now $(cat $DMC_PATH/cur_freq) Hz"
else
cnt=0
read -a FREQS < $DMC_PATH/available_frequencies
RANDOM=$$$(date +%s)
while true; do
echo userspace > $DMC_PATH/governor
FREQ=${FREQS[$RANDOM % ${#FREQS[@]} ]}
echo -n "cnt: $cnt, "
set_ddr_freq ${FREQ}
let "cnt=$cnt+1"
done
fi

View File

@ -0,0 +1,62 @@
#!/bin/bash
CURRENT_DIR=`dirname $0`
export DDR_CHOICE
info_view()
{
echo "*****************************************************"
echo "*** ***"
echo "*** DDR TEST ***"
echo "*** ***"
echo "*****************************************************"
echo "*****************************************************"
echo "memtester: 1"
echo "stressapptest: 2"
echo "ddr auto scaling: 3"
echo "stressapptest + memtester: 4"
echo "stressapptest + memtester + ddr auto scaling: 5"
echo "*****************************************************"
read -t 30 -p "please input test moudle: " DDR_CHOICE
}
info_view
memtester_test()
{
bash ${CURRENT_DIR}/memtester_test.sh &
}
stressapptest_test()
{
bash ${CURRENT_DIR}/stressapptest_test.sh &
}
ddr_freq_scaling_test()
{
bash ${CURRENT_DIR}/ddr_freq_scaling.sh &
}
case ${DDR_CHOICE} in
1)
memtester_test
;;
2)
stressapptest_test
;;
3)
ddr_freq_scaling_test
;;
4)
stressapptest_test
memtester_test
;;
5)
stressapptest_test
memtester_test
ddr_freq_scaling_test
;;
*)
echo "not found your input. $DDR_CHOICE"
;;
esac

View File

@ -0,0 +1,17 @@
#!/bin/bash
RESULT_DIR=/data/rockchip-test
RESULT_LOG=${RESULT_DIR}/memtester.log
mkdir -p ${RESULT_DIR}
#get free memory size
mem_avail_size=$(cat /proc/meminfo | grep MemAvailable | awk '{print $2}')
mem_test_size=$(((mem_avail_size/1024/2)-10))M
#run memtester test
echo "******************* DDR MEMTESTER TEST ******************************"
echo "**************** run: memtester $mem_test_size **********************"
memtester $mem_test_size 2>&1 | tee $RESULT_LOG &
echo "*********** DDR MEMTESTER TEST START, LOG AT $RESULT_LOG ************"

View File

@ -0,0 +1,18 @@
#!/bin/bash
RESULT_DIR=/data/rockchip-test
RESULT_LOG=${RESULT_DIR}/stressapptest.log
mkdir -p ${RESULT_DIR}
#get free memory size
mem_avail_size=$(cat /proc/meminfo | grep MemAvailable | awk '{print $2}')
mem_test_size=$(((mem_avail_size/1024/2)-10))
#run stressapptest_test
echo "*************************** DDR STRESSAPPTEST TEST 24H ***************************************"
echo "**run: stressapptest -s 86400 -i 4 -C 4 -W --stop_on_errors -M $mem_test_size -l $RESULT_LOG**"
stressapptest -s 86400 -i 4 -C 4 -W --stop_on_errors -M $mem_test_size -l $RESULT_LOG &
echo "************************** DDR STRESSAPPTEST START, LOG AT $RESULT_LOG ************************"

View File

@ -0,0 +1,185 @@
#!/bin/bash
#/******************************************************************/
#/* Copyright (C) ROCK-CHIPS . All Rights Reserved. */
#/*******************************************************************
#File : flash_stress_test.sh
#Desc : flash write and read stress test tools
#Author : ZYF
#Date : 2020-07-16
#Notes :
# Revision Data Author Note.
# 1.00 2017/05/05 Zhaoyifeng 1.First version
# 1.10 2020/06/28 Dingqiang Lin(jon.lin@rock-chips.com) 1.Simplify test_log 2.Add more introduction
# 1.20 2020/07/16 Hans Yang 1.use /dev/urandom to generate test data
#Introduction.
#********************************************************************/
# usage£º
# sudo flash_stress_test.sh dirnum testcount
# example £º
# count for script command:
# SLC Nand 128MB, 100K P/E cycles, normaly we test 5K P/E ¡ª¡ª 128MB * 5000
# src file size 5MB, totle test data 128MB * 5000, testcount = 128MB * 5000 / 5MB * 5(dirnum) = 20600
# command:
# sudo flash_stress_test.sh 5 20000
# available space need:
# src file size: 5MB
# des file size: 5MB * dirnum = 25MB
# log file size: 189B(log item size) * 20000 = 3691KB
# total: about 34MB
# result analyze:
# success:
# 1. shell progress stop;
# 2. print "-------copy and check success------------"
# fail:
# 1. shell progress stop;
# 2. any printing with "error" tag
#
#********************************************************************/
test_dir=/data/rockchip-test/flash_test
source_dir=$test_dir/src_test_data
dest_dir=$test_dir/des_test_data
md5_dir=$test_dir/md5_data
usage()
{
echo "Usage: flash_stress_test.sh [dirnum] [looptime]"
echo "flash_stress_test.sh 5 20000"
}
test_max_count=200
test_max_dir=5
if [ $1 -ne 0 ] ;then
test_max_dir=$1
fi
if [ $2 -ne 0 ] ;then
test_max_count=$2
fi
echo "Test Max dir Num = ${test_max_dir}"
echo "Test Max count = ${test_max_count}"
count=0
dir_loop=0
rm -rf $test_dir/test_log.txt
mkdir -p $dest_dir
mkdir -p $md5_dir
mkdir -p $source_dir
#generate 5MB random file
rm -rf $source_dir/*
file_path=$source_dir
file_size=(512 1024 3456 512 1024 3456)
file_radio=(5 5 5 5 5 5)
function random()
{
min=$1
max=$2
num=`date +%s`
((value=$num%($max-$min)+$min+1))
echo $value
}
file_size_count=${#file_size[*]}
file_radio_count=${#file_radio[*]}
if [ $file_size_count=$file_radio_count ]
then
for ((i=0;i <$file_size_count;i++))
do
for ((n=0;n <${file_radio[$i]};n++))
do
if [ $i==0 ]
then
rand=$(random 0 ${file_size[$i]})
else
rand=$(random ${file_size[$i-1]} ${file_size[$i]})
fi
dd if=/dev/urandom of=$file_path/test.$i.$rand.bin bs=$rand count=1024
done
echo ===========
done
fi
cd $source_dir
#find ./ -type f -print0 | xargs -0 md5sum | sort > $md5_dir/source.md5
md5sum ./* > $md5_dir/source.md5
cd /
while [ $count -lt $test_max_count ]; do
echo $count
echo $count >> $test_dir/test_log.txt
dir_loop=0
while [ $dir_loop -lt $test_max_dir ]; do
echo "$count test $source_dir to $dest_dir/${dir_loop}"
rm -rf $dest_dir/$dir_loop
if [ $? == 0 ]; then
echo "$count clean $dest_dir/${dir_loop} success"
echo "$count clean ${dir_loop}" >> $test_dir/test_log.txt
else
echo "$count clean $dest_dir/${dir_loop} error"
echo "$count clean $dest_dir/${dir_loop} error" >> $test_dir/test_log.txt
exit 0
fi
#sync
#sleep 1
#start copy data
echo "$count $dir_loop start copy data"
cp -rf $source_dir $dest_dir/$dir_loop
if [ $? == 0 ]; then
echo "$count cp $source_dir to $dest_dir/${dir_loop} success"
echo "$count cp ${dir_loop}" >> $test_dir/test_log.txt
else
echo "$count cp $source_dir to $dest_dir/${dir_loop} error"
echo "$count cp $source_dir to $dest_dir/${dir_loop} error" >> $test_dir/test_log.txt
fi
#sync
#sleep 1
dir_loop=$(($dir_loop+1))
done
dir_loop=0
sync && echo 3 > /proc/sys/vm/drop_caches
sleep 5
sync
echo 3 > /proc/sys/vm/drop_caches
sleep 5
while [ $dir_loop -lt $test_max_dir ]; do
#calc dir md5
echo "$count calc $dest_dir/${dir_loop} md5 start"
echo "$count calc $dest_dir/${dir_loop} md5 start" >> $test_dir/test_log.txt
cd $dest_dir/${dir_loop}
#find ./ -type f -print0 | xargs -0 md5sum | sort > $md5_dir/dest${dir_loop}.md5
md5sum ./* > $md5_dir/dest${dir_loop}.md5
cd /
#cmp with src md5
diff $md5_dir/source.md5 $md5_dir/dest${dir_loop}.md5
if [ $? == 0 ]; then
echo "$count check source to $dest_dir/${dir_loop} success"
echo "$count check ${dir_loop}" >> $test_dir/test_log.txt
rm $md5_dir/dest${dir_loop}.md5
rm -rf $dest_dir/$dir_loop
else
echo "$count check source to $dest_dir/${dir_loop} error"
echo "$count check source to $dest_dir/${dir_loop} error" >> $test_dir/test_log.txt
exit 0
fi
dir_loop=$(($dir_loop+1))
done
count=$(($count+1))
#if test fail, we can save file for debug
#rm -rf $test_dir/$dest_dir/*
echo -----------------------------------------
echo "-------========You can see the result at and $test_dir/test_log.txt file=======------------"
echo ----------------------------------------- >> $test_dir/test_log.txt
done
echo "-------copy and check success------------"
echo "-------copy and check success------------" >> $test_dir/test_log.txt
echo "-------========You can see the result at and $test_dir/test_log.txt file=======------------"

View File

@ -0,0 +1,77 @@
#!/bin/bash
cat /data/rockchip/reboot_cnt
test_dir=/data/rockchip/power_lost
CNT=/data/rockchip/reboot_cnt
total=5000
delay=3
no=0
if [ ! -e "/data/rockchip" ]; then
echo "no /data/rockchip"
mkdir -p /data/rockchip
fi
if [ ! -e "/data/rockchip/power_lost_test.sh" ]; then
cp /rockchip/flash_test/power_lost_test.sh /data/rockchip/
fi
if [ -e $CNT ]
then
cnt=`cat $CNT`
echo -e $(date)_power_up_$cnt >> /data/rockchip/power_lost_test.log
else
echo reset power lost count.
cnt=0
echo 0 > $CNT
rm /data/rockchip/power_lost_test.log
echo "$(date) power lost test begin" >> /data/rockchip/power_lost_test.log
mkdir -p $test_dir
fi
if [ $cnt -ge $total ]
then
echo power loat test finished!!!!!!!.
echo "off" > $CNT
echo "do cleaning ..."
rm /data/rockchip/power_lost_test.sh
rm -rf /data/rockchip/power_lost
rm -f $CNT
exit 0
fi
echo "current cnt = $cnt, total cnt = $total"
echo "You can stop reboot by: echo off > /data/rockchip/reboot_cnt"
echo "power lost test loop $cnt" >> /data/rockchip/power_lost_test.log
sleep $delay
if [ $cnt != "off" ]; then
echo "$cnt begin dd"
else
echo "power lost test is off"
rm /data/rockchip/power_lost_test.sh
rm -rf /data/rockchip/power_lost
rm -f $CNT
exit 0
fi
let "cnt=$cnt+1"
echo $cnt > $CNT
rm -rf $test_dir/*
sync
time dd if=/dev/random of=$test_dir/test_src bs=1M count=2
while true; do
echo "power lost test, loop $cnt"
time dd if=$test_dir/test_src of=$test_dir/test_dst
sync
busybox diff $test_dir/test_src $test_dir/test_dst
echo $?
if [ $? -eq 0 ];then
echo "compare equally"
rm $test_dir/test_dst
sync
else
echo "compare not equally" >> /data/rockchip/power_lost_test.log
exit
fi
sleep 0.1
done

View File

@ -0,0 +1,60 @@
#!/bin/bash
DIR_GPU=`dirname $0`
info_view()
{
echo "*****************************************************"
echo "*** ***"
echo "*** GPU TEST ***"
echo "*** ***"
echo "*****************************************************"
}
info_view
echo "***********************************************************"
echo "glmark2 fullscreen test: 1"
echo "glmark2 normal test (800x600): 2"
echo "glmark2 offscreen test: 3"
echo "glmark2 stress test: 4"
echo "***********************************************************"
read -t 30 GPU_CHOICE
glmark2_fullscreen_test()
{
bash ${DIR_GPU}/test_fullscreen_glmark2.sh
}
glmark2_normal_test()
{
bash ${DIR_GPU}/test_normal_glmark2.sh
}
glmark2_offscreen_test()
{
bash ${DIR_GPU}/test_offscreen_glmark2.sh
}
glmark2_stress_test()
{
bash ${DIR_GPU}/test_stress_glmark2.sh
}
case ${GPU_CHOICE} in
1)
glmark2_fullscreen_test
;;
2)
glmark2_normal_test
;;
3)
glmark2_offscreen_test
;;
4)
glmark2_stress_test
;;
*)
echo "not found your input."
;;
esac

View File

@ -0,0 +1,98 @@
#!/bin/bash -e
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
function run_glmark2() {
if [ "$1" == "rk3288" ]; then
glmark2-es2 --fullscreen --annotate
elif [[ "$1" == "rk3036" ]]; then
glmark2-es2 --fullscreen --annotate
elif [[ "$1" == "rk3328" ]]; then
glmark2-es2 --fullscreen --annotate
elif [[ "$1" == "rk3399" ]]; then
taskset -c 4-5 glmark2-es2 --fullscreen --annotate
elif [[ "$1" == "rk3399pro" ]]; then
taskset -c 4-5 glmark2-es2 --fullscreen --annotate
elif [[ "$1" == "rk3358" ]]; then
glmark2-es2 --fullscreen --annotate
elif [[ "$1" == "rk3528" ]]; then
glmark2-es2 --fullscreen --annotate
elif [[ "$1" == "rk3562" ]]; then
glmark2-es2 --fullscreen --annotate
elif [[ "$1" == "rk3566" || "$1" == "rk3568" ]]; then
glmark2-es2 --fullscreen --annotate
elif [[ "$1" == "rk3588" || "$1" == "rk3588s" ]]; then
taskset -c 4-8 glmark2-es2 --fullscreen --annotate
elif [[ "$1" == "px30" || "$1" == "rk3326" ]]; then
glmark2-es2 --fullscreen --annotate
elif [[ "$1" == "rk1808" || "$1" == "rk3308" ]]; then
echo "the chips didn't support gpu"
elif [[ "$1" == "px3se" || "$1" == "rk312x" ]]; then
glmark2-es2 --fullscreen --annotate
else
echo "please check if the linux support it!!!!!!!"
fi
}
COMPATIBLE=$(cat /proc/device-tree/compatible)
if [[ $(expr $COMPATIBLE : ".*rk3288") -ne 0 ]]; then
CHIPNAME="rk3288"
elif [[ $(expr $COMPATIBLE : ".*rk3036") -ne 0 ]]; then
CHIPNAME="rk3036"
elif [[ $(expr $COMPATIBLE : ".*rk3308") -ne 0 ]]; then
CHIPNAME="rk3308"
elif [[ $(expr $COMPATIBLE : ".*rk3328") -ne 0 ]]; then
CHIPNAME="rk3328"
elif [[ $(expr $COMPATIBLE : ".*rk3399") -ne 0 ]]; then
CHIPNAME="rk3399"
elif [[ $(expr $COMPATIBLE : ".*rk3326") -ne 0 ]]; then
CHIPNAME="rk3326"
elif [[ $(expr $COMPATIBLE : ".*rk3358") -ne 0 ]]; then
CHIPNAME="rk3358"
elif [[ $(expr $COMPATIBLE : ".*rk3399") -ne 0 ]]; then
CHIPNAME="rk3399"
elif [[ $(expr $COMPATIBLE : ".*rk3399pro") -ne 0 ]]; then
CHIPNAME="rk3399pro"
elif [[ $(expr $COMPATIBLE : ".*rk3528") -ne 0 ]]; then
CHIPNAME="rk3528"
elif [[ $(expr $COMPATIBLE : ".*rk3562") -ne 0 ]]; then
CHIPNAME="rk3562"
elif [[ $(expr $COMPATIBLE : ".*rk3566") -ne 0 ]]; then
CHIPNAME="rk3566"
elif [[ $(expr $COMPATIBLE : ".*rk3568") -ne 0 ]]; then
CHIPNAME="rk3568"
elif [[ $(expr $COMPATIBLE : ".*rk3588") -ne 0 ]]; then
CHIPNAME="rk3588"
elif [[ $(expr $COMPATIBLE : ".*rk1808") -ne 0 ]]; then
CHIPNAME="rk1808"
elif [[ $(expr $COMPATIBLE : ".*px3se") -ne 0 ]]; then
CHIPNAME="px3se"
elif [[ $(expr $COMPATIBLE : ".*px30") -ne 0 ]]; then
CHIPNAME="px30"
elif [[ $(expr $COMPATIBLE : ".*rk3128") -ne 0 ]]; then
CHIPNAME="rk312x"
elif [[ $(expr $COMPATIBLE : ".*rk3126") -ne 0 ]]; then
CHIPNAME="rk312x"
else
CHIPNAME="rk3399"
fi
COMPATIBLE=${COMPATIBLE#rockchip,}
echo performance | tee $(find /sys/ -name *governor) /dev/null || true
echo "run glmark2 x11 with fullscreen......"
run_glmark2 ${CHIPNAME}
echo "the governor is performance for now, please restart it........"

View File

@ -0,0 +1,98 @@
#!/bin/bash -e
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
function run_glmark2() {
if [ "$1" == "rk312x" ]; then
glmark2-es2 --annotate
elif [ "$1" == "rk3288" ]; then
glmark2-es2 --annotate
elif [[ "$1" == "rk3036" ]]; then
glmark2-es2 --annotate
elif [[ "$1" == "rk3328" ]]; then
glmark2-es2 --annotate
elif [[ "$1" == "rk3399" ]]; then
taskset -c 4-5 glmark2-es2 --annotate
elif [[ "$1" == "rk3399pro" ]]; then
taskset -c 4-5 glmark2-es2 --annotate
elif [[ "$1" == "rk3528" ]]; then
glmark2-es2 --annotate
elif [[ "$1" == "rk3562" ]]; then
glmark2-es2 --annotate
elif [[ "$1" == "rk3566" || "$1" == "rk3568" ]]; then
glmark2-es2 --annotate
elif [[ "$1" == "rk3588" || "$1" == "rk3588s" ]]; then
taskset -c 4-8 glmark2-es2 --annotate
elif [[ "$1" == "px30" || "$1" == "rk3326" ]]; then
glmark2-es2 --annotate
elif [[ "$1" == "rk1808" || "$1" == "rk3308" ]]; then
echo "the chips didn't support gpu"
elif [[ "$1" == "px3se" || "$1" == "rk312x" ]]; then
glmark2-es2 --annotate
else
echo "please check if the linux support it!!!!!!!"
fi
}
COMPATIBLE=$(cat /proc/device-tree/compatible)
if [[ $(expr $COMPATIBLE : ".*rk3128") -ne 0 ]]; then
CHIPNAME="rk312x"
elif [[ $(expr $COMPATIBLE : ".*rk3126") -ne 0 ]]; then
CHIPNAME="rk312x"
elif [[ $(expr $COMPATIBLE : ".*rk3288") -ne 0 ]]; then
CHIPNAME="rk3288"
elif [[ $(expr $COMPATIBLE : ".*rk3308") -ne 0 ]]; then
CHIPNAME="rk3308"
elif [[ $(expr $COMPATIBLE : ".*rk3326") -ne 0 ]]; then
CHIPNAME="rk3326"
elif [[ $(expr $COMPATIBLE : ".*rk3328") -ne 0 ]]; then
CHIPNAME="rk3328"
elif [[ $(expr $COMPATIBLE : ".*rk3358") -ne 0 ]]; then
CHIPNAME="rk3358"
elif [[ $(expr $COMPATIBLE : ".*rk3399") -ne 0 ]]; then
CHIPNAME="rk3399"
elif [[ $(expr $COMPATIBLE : ".*rk3399") -ne 0 ]]; then
CHIPNAME="rk3399"
elif [[ $(expr $COMPATIBLE : ".*rk3399pro") -ne 0 ]]; then
CHIPNAME="rk3399pro"
elif [[ $(expr $COMPATIBLE : ".*rk3528") -ne 0 ]]; then
CHIPNAME="rk3528"
elif [[ $(expr $COMPATIBLE : ".*rk3562") -ne 0 ]]; then
CHIPNAME="rk3562"
elif [[ $(expr $COMPATIBLE : ".*rk3566") -ne 0 ]]; then
CHIPNAME="rk3566"
elif [[ $(expr $COMPATIBLE : ".*rk3568") -ne 0 ]]; then
CHIPNAME="rk3568"
elif [[ $(expr $COMPATIBLE : ".*rk3588") -ne 0 ]]; then
CHIPNAME="rk3588"
elif [[ $(expr $COMPATIBLE : ".*rk3036") -ne 0 ]]; then
CHIPNAME="rk3036"
elif [[ $(expr $COMPATIBLE : ".*rk1808") -ne 0 ]]; then
CHIPNAME="rk1808"
elif [[ $(expr $COMPATIBLE : ".*px3se") -ne 0 ]]; then
CHIPNAME="px3se"
elif [[ $(expr $COMPATIBLE : ".*px30") -ne 0 ]]; then
CHIPNAME="px30"
else
CHIPNAME="rk3399"
fi
COMPATIBLE=${COMPATIBLE#rockchip,}
echo performance | tee $(find /sys/ -name *governor) /dev/null || true
echo "run glmark2 x11 with fullscreen......"
run_glmark2 ${CHIPNAME}
echo "the governor is performance for now, please restart it........"

View File

@ -0,0 +1,98 @@
#!/bin/bash -e
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
function run_glmark2() {
if [ "$1" == "rk3288" ]; then
glmark2-es2 --off-screen
elif [[ "$1" == "rk3036" ]]; then
glmark2-es2 --off-screen
elif [[ "$1" == "rk3528" ]]; then
glmark2-es2 --off-screen
elif [[ "$1" == "rk3358" ]]; then
glmark2-es2 --off-screen
elif [[ "$1" == "rk3328" ]]; then
glmark2-es2 --off-screen
elif [[ "$1" == "rk3399" ]]; then
taskset -c 4-5 glmark2-es2 --off-screen
elif [[ "$1" == "rk3399pro" ]]; then
taskset -c 4-5 glmark2-es2 --off-screen
elif [[ "$1" == "px30" || "$1" == "rk3326" ]]; then
glmark2-es2 --off-screen
elif [[ "$1" == "rk3562" ]]; then
glmark2-es2 --off-screen
elif [[ "$1" == "rk3566" || "$1" == "rk3568" ]]; then
glmark2-es2 --off-screen
elif [[ "$1" == "rk3588" || "$1" == "rk3588s" ]]; then
taskset -c 4-8 glmark2-es2 --off-screen
elif [[ "$1" == "rk1808" || "$1" == "rk3308" ]]; then
echo "the chips didn't support gpu"
elif [[ "$1" == "px3se" || "$1" == "rk312x" ]]; then
glmark2-es2 --off-screen
else
echo "please check if the linux support it!!!!!!!"
fi
}
COMPATIBLE=$(cat /proc/device-tree/compatible)
if [[ $(expr $COMPATIBLE : ".*rk3288") -ne 0 ]]; then
CHIPNAME="rk3288"
elif [[ $(expr $COMPATIBLE : ".*rk3036") -ne 0 ]]; then
CHIPNAME="rk3036"
elif [[ $(expr $COMPATIBLE : ".*rk3308") -ne 0 ]]; then
CHIPNAME="rk3308"
elif [[ $(expr $COMPATIBLE : ".*rk3328") -ne 0 ]]; then
CHIPNAME="rk3328"
elif [[ $(expr $COMPATIBLE : ".*rk3399") -ne 0 ]]; then
CHIPNAME="rk3399"
elif [[ $(expr $COMPATIBLE : ".*rk3326") -ne 0 ]]; then
CHIPNAME="rk3326"
elif [[ $(expr $COMPATIBLE : ".*rk3358") -ne 0 ]]; then
CHIPNAME="rk3358"
elif [[ $(expr $COMPATIBLE : ".*rk3399") -ne 0 ]]; then
CHIPNAME="rk3399"
elif [[ $(expr $COMPATIBLE : ".*rk3528") -ne 0 ]]; then
CHIPNAME="rk3528"
elif [[ $(expr $COMPATIBLE : ".*rk3562") -ne 0 ]]; then
CHIPNAME="rk3562"
elif [[ $(expr $COMPATIBLE : ".*rk3566") -ne 0 ]]; then
CHIPNAME="rk3566"
elif [[ $(expr $COMPATIBLE : ".*rk3568") -ne 0 ]]; then
CHIPNAME="rk3568"
elif [[ $(expr $COMPATIBLE : ".*rk3588") -ne 0 ]]; then
CHIPNAME="rk3588"
elif [[ $(expr $COMPATIBLE : ".*rk3399pro") -ne 0 ]]; then
CHIPNAME="rk3399pro"
elif [[ $(expr $COMPATIBLE : ".*rk1808") -ne 0 ]]; then
CHIPNAME="rk1808"
elif [[ $(expr $COMPATIBLE : ".*px3se") -ne 0 ]]; then
CHIPNAME="px3se"
elif [[ $(expr $COMPATIBLE : ".*px30") -ne 0 ]]; then
CHIPNAME="px30"
elif [[ $(expr $COMPATIBLE : ".*rk3128") -ne 0 ]]; then
CHIPNAME="rk312x"
elif [[ $(expr $COMPATIBLE : ".*rk3126") -ne 0 ]]; then
CHIPNAME="rk312x"
else
CHIPNAME="rk3399"
fi
COMPATIBLE=${COMPATIBLE#rockchip,}
echo performance | tee $(find /sys/ -name *governor) /dev/null || true
echo "run glmark2 x11 with offscreen......"
run_glmark2 ${CHIPNAME}
echo "the governor is performance for now, please restart it........"

View File

@ -0,0 +1,83 @@
#!/bin/bash -e
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
function run_glmark2() {
if [ "$1" == "rk3288" ]; then
glmark2-es2 --run-forever --fullscreen --annotate
elif [[ "$1" == "rk3328" ]]; then
glmark2-es2 --run-forever --fullscreen --annotate
elif [[ "$1" == "rk3399" ]]; then
glmark2-es2 --run-forever --fullscreen --annotate
elif [[ "$1" == "rk3399pro" ]]; then
glmark2-es2 --run-forever --fullscreen --annotate
elif [[ "$1" == "px30" || "$1" == "rk3326" ]]; then
glmark2-es2 --run-forever --fullscreen --annotate
elif [[ "$1" == "rk3562" ]]; then
glmark2-es2 --run-forever --fullscreen --annotate
elif [[ "$1" == "rk3566" || "$1" == "rk3568" ]]; then
glmark2-es2 --run-forever --fullscreen --annotate
elif [[ "$1" == "rk3588" || "$1" == "rk3588s" ]]; then
glmark2-es2 --run-forever --fullscreen --annotate
elif [[ "$1" == "rk1808" || "$1" == "rk3308" ]]; then
echo "the chips didn't support gpu"
elif [[ "$1" == "px3se" || "$1" == "rk312x" ]]; then
glmark2-es2 --run-forever --fullscreen --annotate
else
echo "please check if the linux support it!!!!!!!"
fi
}
COMPATIBLE=$(cat /proc/device-tree/compatible)
if [[ $(expr $COMPATIBLE : ".*rk3288") -ne 0 ]]; then
CHIPNAME="rk3288"
elif [[ $(expr $COMPATIBLE : ".*rk3308") -ne 0 ]]; then
CHIPNAME="rk3308"
elif [[ $(expr $COMPATIBLE : ".*rk3328") -ne 0 ]]; then
CHIPNAME="rk3328"
elif [[ $(expr $COMPATIBLE : ".*rk3399") -ne 0 ]]; then
CHIPNAME="rk3399"
elif [[ $(expr $COMPATIBLE : ".*rk3326") -ne 0 ]]; then
CHIPNAME="rk3326"
elif [[ $(expr $COMPATIBLE : ".*rk3399") -ne 0 ]]; then
CHIPNAME="rk3399"
elif [[ $(expr $COMPATIBLE : ".*rk3399pro") -ne 0 ]]; then
CHIPNAME="rk3399pro"
elif [[ $(expr $COMPATIBLE : ".*rk3562") -ne 0 ]]; then
CHIPNAME="rk3562"
elif [[ $(expr $COMPATIBLE : ".*rk3566") -ne 0 ]]; then
CHIPNAME="rk3566"
elif [[ $(expr $COMPATIBLE : ".*rk3568") -ne 0 ]]; then
CHIPNAME="rk3568"
elif [[ $(expr $COMPATIBLE : ".*rk3588") -ne 0 ]]; then
CHIPNAME="rk3588"
elif [[ $(expr $COMPATIBLE : ".*rk1808") -ne 0 ]]; then
CHIPNAME="rk1808"
elif [[ $(expr $COMPATIBLE : ".*px3se") -ne 0 ]]; then
CHIPNAME="px3se"
elif [[ $(expr $COMPATIBLE : ".*px30") -ne 0 ]]; then
CHIPNAME="px30"
elif [[ $(expr $COMPATIBLE : ".*rk3128") -ne 0 ]]; then
CHIPNAME="rk312x"
elif [[ $(expr $COMPATIBLE : ".*rk3126") -ne 0 ]]; then
CHIPNAME="rk312x"
else
CHIPNAME="rk3399"
fi
COMPATIBLE=${COMPATIBLE#rockchip,}
echo performance | tee $(find /sys/ -name *governor) /dev/null || true
echo "run glmark2 x11 with fullscreen......"
run_glmark2 ${CHIPNAME}
echo "the governor is performance for now, please restart it........"

View File

@ -0,0 +1,34 @@
#!/bin/bash
usage()
{
echo "Usage: npu_freq_scaling.sh [test_second] [every_freq_stay_second]"
echo "example: npu_freq_test.sh 3600 30"
echo "means npu_freq_test.sh will run 1 hour and every cpu frequency stay 30s"
}
echo "test will run $1 seconds"
echo "every npu frqeucny will stay $2 seconds"
NPU_PATH=/sys/devices/platform/*.npu/devfreq/*.npu
unset FREQS
read -a FREQS < $NPU_PATH/available_frequencies
RANDOM=$$$(date +%s)
time_cnt=0
while true; do
if [ $time_cnt -ge $1 ]
then
echo "======TEST SUCCESSFUL, QUIT====="
exit 0
fi
echo userspace > $NPU_PATH/governor
FREQ=${FREQS[$RANDOM % ${#FREQS[@]} ]}
echo "set ddr frequency to $FREQ"
echo ${FREQ} > $NPU_PATH/userspace/set_freq
sleep $2
let "time_cnt=$time_cnt+$2"
done

View File

@ -0,0 +1,18 @@
#!/bin/bash
COMPATIBLE=$(cat /proc/device-tree/compatible)
while true
do
if [[ $COMPATIBLE =~ "rk3588" ]]; then
rknn_common_test /usr/share/model/RK3588/mobilenet_v1.rknn /usr/share/model/dog_224x224.jpg 10
elif [[ $COMPATIBLE =~ "rk3566" ]]; then
rknn_common_test /usr/share/model/RK3566_RK3568/mobilenet_v1.rknn /usr/share/model/dog_224x224.jpg 10
elif [[ $COMPATIBLE =~ "rk3568" ]]; then
rknn_common_test /usr/share/model/RK3566_RK3568/mobilenet_v1.rknn /usr/share/model/dog_224x224.jpg 10
elif [[ $COMPATIBLE =~ "rk3562" ]]; then
rknn_common_test /usr/share/model/RK3562/mobilenet_v1.rknn /usr/share/model/dog_224x224.jpg 10
else
echo "please check if the linux support it!!!!!!!"
fi
done

View File

@ -0,0 +1,51 @@
#!/bin/bash
DIR_NPU=`dirname $0`
info_view()
{
echo "*****************************************************"
echo "*** ***"
echo "*** NPU TEST ***"
echo "*** ***"
echo "*****************************************************"
}
info_view
echo "***********************************************************"
echo "npu stress test: 1"
echo "npu scale frequency test: 2"
echo "rknn demo test: 3"
echo "***********************************************************"
read -t 30 NPU_CHOICE
npu_stress_test()
{
bash ${DIR_NPU}/npu_stress_test.sh
}
npu_scale_frequency_test()
{
bash ${DIR_NPU}/npu_freq_scaling.sh 86400 2
}
rknn_demo_test()
{
bash ${DIR_NPU}/rknn_demo.sh
}
case ${NPU_CHOICE} in
1)
npu_stress_test
;;
2)
npu_scale_frequency_test
;;
3)
rknn_demo_test
;;
*)
echo "not found your input."
;;
esac

View File

@ -0,0 +1,14 @@
#!/bin/bash
COMPATIBLE=$(cat /proc/device-tree/compatible)
if [[ $(expr $COMPATIBLE : ".*rk3588") -ne 0 ]]; then
rknn_common_test /usr/share/model/RK3588/mobilenet_v1.rknn /usr/share/model/dog_224x224.jpg 10
elif [[ $(expr $COMPATIBLE : ".*rk3568") -ne 0 ]]; then
rknn_common_test /usr/share/model/RK3566_RK3568/mobilenet_v1.rknn /usr/share/model/dog_224x224.jpg 10
elif [[ $(expr $COMPATIBLE : ".*rk3566") -ne 0 ]]; then
rknn_common_test /usr/share/model/RK3566_RK3568/mobilenet_v1.rknn /usr/share/model/dog_224x224.jpg 10
elif [[ $(expr $COMPATIBLE : ".*rk3562") -ne 0 ]]; then
rknn_common_test /usr/share/model/RK3562/mobilenet_v1.rknn /usr/share/model/dog_224x224.jpg 10
else
echo "The RKNPU2 did't support this Socs yet..."
fi

View File

@ -0,0 +1,33 @@
#!/bin/bash
DIR_RECOVERY=/rockchip-test/recovery
info_view()
{
echo "*****************************************************"
echo "*** ***"
echo "*** RECOVERY TEST ***"
echo "*** ***"
echo "*****************************************************"
}
info_view
echo "***********************************************************"
echo "recovery function test: 1"
echo "***********************************************************"
read -t 30 RECOVERY_CHOICE
recovery_function_test()
{
bash ${DIR_RECOVERY}/test_function_recovery.sh
}
case ${RECOVERY_CHOICE} in
1)
recovery_function_test
;;
*)
echo "not found your input."
;;
esac

View File

@ -0,0 +1,16 @@
#!/bin/bash
delay=10
total=${1:-10000}
CNT=/data/rockchip-test/reboot_cnt
if [ ! -e "/usr/bin/update" ]; then
echo "Please check if have rktoolkit built\n"
fi
# check log on /userdata/recovery/last_log
/usr/bin/update
#/usr/bin/update factory
#/usr/bin/update ota xxx
sync

View File

@ -0,0 +1,195 @@
#!/bin/bash
### file: rockchip-test.sh
### function: ddr cpu gpio flash bt audio recovery s2r sdio/pcie(wifi)
### ethernet reboot ddrfreq npu camera video and so on.
CURRENT_DIR=`dirname $0`
moudle_env()
{
export MODULE_CHOICE
}
module_choice()
{
echo "******************************************************"
echo "*** ***"
echo "*** ***************************** ***"
echo "*** * ROCKCHIPS TEST TOOLS * ***"
echo "*** * V2.1 updated on 20230413 * ***"
echo "*** ***************************** ***"
echo "*** ***"
echo "*****************************************************"
echo "*****************************************************"
echo "ddr test: 1 (ddr stress test)"
echo "cpu test: 2 (cpu stress test)"
echo "gpu test: 3 (gpu stress test)"
echo "npu test: 4 (npu stress test)"
echo "suspend_resume test: 5 (suspend resume)"
echo "reboot test: 6 (auto reboot test)"
echo "power lost test: 7 (power lost test)"
echo "flash stress test: 8 (flash stress test)"
echo "recovery test: 9 (recovery wipe all test)"
echo "audio test: 10 (audio test)"
echo "camera test: 11 (camera test)"
echo "video test: 12 (video test)"
echo "bluetooth test: 13 (bluetooth on off test)"
echo "wifi test: 14 (wifi on off test)"
echo "chromium test: 15 (chromium with video test)"
echo "hardware infomation: 16 (to get the hardware infomation)"
echo "*****************************************************"
read -t 30 -p "please input test moudle: " MODULE_CHOICE
}
npu_stress_test()
{
bash ${CURRENT_DIR}/npu/npu_test.sh
}
npu2_stress_test()
{
bash ${CURRENT_DIR}/npu2/npu_test.sh
}
ddr_test()
{
bash ${CURRENT_DIR}/ddr/ddr_test.sh
}
cpu_test()
{
bash ${CURRENT_DIR}/cpu/cpu_test.sh
}
flash_stress_test()
{
bash ${CURRENT_DIR}/flash_test/flash_stress_test.sh 5 20000 &
}
recovery_test()
{
bash ${CURRENT_DIR}/recovery/recovery_test.sh
}
suspend_resume_test()
{
bash ${CURRENT_DIR}/suspend_resume/suspend_resume.sh
}
wifi_test()
{
bash ${CURRENT_DIR}/wifibt/wifi_onoff.sh &
}
bluetooth_test()
{
bash ${CURRENT_DIR}/wifibt/bt_onoff.sh &
}
audio_test()
{
bash ${CURRENT_DIR}/audio/audio_functions_test.sh
}
auto_reboot_test()
{
fcnt=/userdata/rockchip/reboot_cnt;
if [ -e "$fcnt" ]; then
rm -f $fcnt;
fi
bash ${CURRENT_DIR}/auto_reboot/auto_reboot.sh
}
camera_test()
{
bash ${CURRENT_DIR}/camera/camera_test.sh
}
video_test()
{
bash ${CURRENT_DIR}/video/video_test.sh
}
gpu_test()
{
bash ${CURRENT_DIR}/gpu/gpu_test.sh
}
chromium_test()
{
bash ${CURRENT_DIR}/chromium/chromium_test.sh
}
sys_info_get()
{
bash ${CURRENT_DIR}/system_infomation/get_sys_info.sh
}
power_lost_test()
{
fcnt=/userdata${CURRENT_DIR}/power_lost/reboot_cnt;
if [ -e "$fcnt" ]; then
rm -f $fcnt;
fi
bash ${CURRENT_DIR}/flash_test/power_lost_test.sh &
}
module_test()
{
case ${MODULE_CHOICE} in
1)
ddr_test
;;
2)
cpu_test
;;
3)
gpu_test
;;
4)
npu2_stress_test
;;
5)
suspend_resume_test
;;
6)
auto_reboot_test
;;
7)
power_lost_test
;;
8)
flash_stress_test
;;
9)
recovery_test
;;
10)
audio_test
;;
11)
camera_test
;;
12)
video_test
;;
13)
bluetooth_test
;;
14)
wifi_test
;;
15)
chromium_test
;;
16)
sys_info_get
;;
esac
}
module_choice
module_test

View File

@ -0,0 +1,53 @@
#!/bin/bash
RESULT_DIR=/userdata/rockchip-test/
RESULT_LOG=${RESULT_DIR}/suspend_resume.txt
SUSPEND_MAX=60
SUSPEND_MIN=30
SUSPEND_INTERVAL=$(($SUSPEND_MAX - $SUSPEND_MIN + 1 ))
WAKE_MAX=60
WAKE_MIN=30
WKAE_INTERVAL=$(($WAKE_MAX - $WAKE_MIN + 1 ))
MAX_CYCLES=10000
if [ ! -e "/sys/class/rtc/rtc0/wakealarm" ];then
echo "non-existent rtc, please check if rtc enabled"
exit
fi
mkdir -p ${RESULT_DIR}
random() {
hexdump -n 2 -e '/2 "%u"' /dev/urandom
}
auto_suspend_resume_rtc()
{
cnt=0
# set sys time same with rtc
hwclock --systohc
hwclock -w
echo "$(date): auto_suspend_resume_rtc start" > ${RESULT_LOG}
while true; do
echo "have done $cnt suspend/resume"
if [ $cnt -ge $MAX_CYCLES ]
then
echo "run $MAX_CYCLES cycles, finish test"
exit 0
fi
sus_time=$(( ( $(random) % $SUSPEND_INTERVAL ) + $SUSPEND_MIN ))
echo "sleep for $sus_time second"
echo 0 > /sys/class/rtc/rtc0/wakealarm
echo "+${sus_time}" > /sys/class/rtc/rtc0/wakealarm
pm-suspend
wake_time=$(( ( $(random) % $WKAE_INTERVAL ) + $WAKE_MIN ))
echo "wake for $wake_time second"
sleep $wake_time
echo "$(date): Count: $cnt - sleep: $sus_time wake: $wake_time " >> ${RESULT_LOG}
let "cnt=$cnt+1"
done
}
auto_suspend_resume_rtc

View File

@ -0,0 +1,5 @@
#!/bin/bash
export DISPLAY=:0.0
hardinfo -r -f html > hardinfo_report.html

View File

@ -0,0 +1,42 @@
#!/bin/bash
DIR_SYSINFO=/rockchip-test/system_infomation
info_view()
{
echo "*****************************************************"
echo "*** ***"
echo "*** SYSTEM INFOMATION ***"
echo "*** ***"
echo "*****************************************************"
}
info_view
echo "***********************************************************"
echo "open hardinfo software: 1"
echo "creates a report and print format: 2"
echo "***********************************************************"
read -t 30 SYSINFO_CHOICE
hardinfo_open()
{
bash ${DIR_SYSINFO}/open_hardinfo.sh
}
report_hardinfo_get()
{
bash ${DIR_SYSINFO}/get_hardinfo_report.sh
}
case ${SYSINFO_CHOICE} in
1)
hardinfo_open
;;
2)
report_hardinfo_get
;;
*)
echo "not fount your input."
;;
esac

View File

@ -0,0 +1,5 @@
#!/bin/bash
export DISPLAY=:0.0
hardinfo

View File

@ -0,0 +1,23 @@
#!/bin/sh
export DISPLAY=:0.0
#export GST_DEBUG=*:5
#export GST_DEBUG_FILE=/tmp/2.txt
export mpp_syslog_perror=1
case "$1" in
rk3036) ###TODO:Display bug, since rk3036 just two overlay.
sudo service lightdm stop
sleep 2
gst-launch-1.0 uridecodebin uri=file:///usr/local/test.mp4 ! kmssink plane-id=52
sudo service lightdm start
;;
rk) ### rkximagesink for better performance
gst-launch-1.0 uridecodebin uri=file:///usr/local/test.mp4 ! rkximagesink
;;
*)
### xvimagesink for better compatibility
gst-play-1.0 --videosink=xvimagesink /usr/local/test.mp4
;;
esac
shift

View File

@ -0,0 +1,10 @@
#!/bin/sh
export DISPLAY=:0.0
#export GST_DEBUG=*:5
#export GST_DEBUG_FILE=/tmp/2.txt
export mpp_syslog_perror=1
# xv vo
mpv --hwdec=rkmpp --vd-lavc-software-fallback=no --vo=xv /usr/local/test.mp4
# x11egl + drm overlay
mpv --hwdec=rkmpp --vo=opengl --gpu-hwdec-interop=drmprime-drm --gpu-context=x11egl /usr/local/test.mp4

View File

@ -0,0 +1,5 @@
#!/bin/sh
#export GST_DEBUG=*:5
#export GST_DEBUG_FILE=/tmp/2.txt
export mpp_syslog_perror=1
DISPLAY=:0.0 parole -i /usr/local/test.mp4

View File

@ -0,0 +1,25 @@
#!/bin/sh
export DISPLAY=:0.0
#export GST_DEBUG=*:5
#export GST_DEBUG_FILE=/tmp/2.txt
#Gstreamer Display: kmssink(qt eglfs),rkximagesink(x11), waylandsink(wayland)
export mpp_syslog_perror=1
case "$1" in
rk3036) ###default the rk3036 use kmssink.
echo "rk3036: don't support qtmultimedia with X11, please use https://github.com/rockchip-linux/meta-rockchip-extra/tree/master/demo/meta-player-qt."
;;
arm64)
# QT built without gles by default on arm64
unset QT_XCB_GL_INTEGRATION
# export QT_GSTREAMER_WIDGET_VIDEOSINK=rkximagesink
export QT_GSTREAMER_WIDGET_VIDEOSINK=xvimagesink
/usr/lib/aarch64-linux-gnu/qt5/examples/multimediawidgets/player/player /usr/local/test.mp4
;;
*)
# export QT_GSTREAMER_WIDGET_VIDEOSINK=rkximagesink
export QT_GSTREAMER_WIDGET_VIDEOSINK=xvimagesink
/usr/lib/arm-linux-gnueabihf/qt5/examples/multimediawidgets/player/player /usr/local/test.mp4
;;
esac

View File

@ -0,0 +1,14 @@
#!/bin/sh
export DISPLAY=:0.0
#export GST_DEBUG=*:5
#export GST_DEBUG_FILE=/tmp/2.txt
export mpp_syslog_perror=1
echo "message: output to /home/linaro/2k.ts!"
gst-launch-1.0 videotestsrc num-buffers=512 ! video/x-raw,format=NV12,width=1920,height= 1080,framerate=30/1 \
! queue ! mpph264enc ! queue ! h264parse ! mpegtsmux ! filesink location=/home/linaro/2k.ts
echo "message: playing encoded video!"
gst-launch-1.0 uridecodebin uri=file:///home/linaro/2k.ts ! xvimagesink

View File

@ -0,0 +1,11 @@
#!/bin/bash
export mpp_syslog_perror=1
export PREFERED_VIDEOSINK=xvimagesink
export QT_GSTREAMER_WIDGET_VIDEOSINK=${PREFERED_VIDEOSINK}
export QT_GSTREAMER_WINDOW_VIDEOSINK=${PREFERED_VIDEOSINK}
echo performance | tee $(find /sys/ -name *governor) /dev/null || true
multivideoplayer -platform xcb

View File

@ -0,0 +1,21 @@
#!/bin/bash
export mpp_syslog_perror=1
URI=/oem/SampleVideo_1280x720_5mb.mp4
if [ "$1" != "" ]
then
URI=$1
if [ "${URI:0:1}" != "/" ]
then
URI=$(readlink -f $URI)
fi
fi
if [ "${URI:0:1}" == "/" ]
then
URI=file://$URI
fi
gst-launch-1.0 uridecodebin uri=$URI ! xvimagesink

View File

@ -0,0 +1,21 @@
#!/bin/bash
export mpp_syslog_perror=1
URI=/oem/SampleVideo_1280x720_5mb.mp4
if [ "$1" != "" ]
then
URI=$1
if [ "${URI:0:1}" != "/" ]
then
URI=$(readlink -f $URI)
fi
fi
if [ "${URI:0:1}" == "/" ]
then
URI=file://$URI
fi
GST_DEBUG=fps*:7 gst-launch-1.0 uridecodebin uri=$URI ! fpsdisplaysink video-sink="xvimagesink" text-overlay=false signal-fps-measurements=true

View File

@ -0,0 +1,21 @@
#!/bin/bash
export mpp_syslog_perror=1
URI=/oem/SampleVideo_1280x720_5mb.mp4
if [ "$1" != "" ]
then
URI=$1
if [ "${URI:0:1}" != "/" ]
then
URI=$(readlink -f $URI)
fi
fi
if [ "${URI:0:1}" == "/" ]
then
URI=file://$URI
fi
GST_DEBUG=fps*:7 gst-launch-1.0 uridecodebin uri=$URI ! fpsdisplaysink video-sink=fakesink text-overlay=false signal-fps-measurements=true sync=false

View File

@ -0,0 +1,24 @@
#!/bin/bash
if [ -d "/mnt/udisk/videos" ];then
TEST_DIR=/mnt/udisk/videos
else
if [ -d "/userdata/videos" ];then
TEST_DIR=/userdata/videos
else
echo "Please put test videos in directory: /mnt/udsik/videos or /userdata/videos"
exit 1
fi
fi
COUNT=1
while true;
do
TIME_LABEL="====== Count:$COUNT Time: $NOW ======"
echo $TIME_LABEL
COUNT=$(expr $COUNT + 1 )
echo $TEST_DIR '$TEST_DIR' "$TEST_DIR" ${TEST_DIR}
gst-play-1.0 --flags=3 $TEST_DIR
sleep 1
done

View File

@ -0,0 +1,105 @@
#!/bin/bash
DIR_VIDEO=/rockchip-test/video
info_view()
{
echo "*****************************************************"
echo "*** ***"
echo "*** VIDEO TEST ***"
echo "*** ***"
echo "*****************************************************"
}
info_view
echo "***********************************************************"
echo "video test demo: 1"
echo "video test with FPS display demo: 2"
echo "video max FPS test without display demo: 3"
echo "multivideo test: 4"
echo "gstreamer decode test: 5"
echo "mpv player decode test: 6"
echo "parole player decode test: 7"
echo "qt player decode test: 8"
echo "gstreamer encode test: 9"
echo "***********************************************************"
read -t 30 VIDEO_CHOICE
video_test()
{
bash ${DIR_VIDEO}/test_gst_video.sh
}
video_test_fps()
{
bash ${DIR_VIDEO}/test_gst_video_fps.sh
}
video_test_maxfps()
{
bash ${DIR_VIDEO}/test_gst_video_maxfps.sh
}
multivideo_test()
{
bash ${DIR_VIDEO}/test_gst_multivideo.sh
}
gst_dec_test()
{
bash ${DIR_VIDEO}/test_dec-gst.sh
}
mpv_dec_test()
{
bash ${DIR_VIDEO}/test_dec-mpv.sh
}
parole_dec_test()
{
bash ${DIR_VIDEO}/test_dec-parole.sh
}
qt_dec_test()
{
bash ${DIR_VIDEO}/test_dec-qt.sh arm64
}
gst_enc_test()
{
bash ${DIR_VIDEO}/test_enc-gst.sh
}
case ${VIDEO_CHOICE} in
1)
video_test
;;
2)
video_test_fps
;;
3)
video_test_maxfps
;;
4)
multivideo_test
;;
5)
gst_dec_test
;;
6)
mpv_dec_test
;;
7)
parole_dec_test
;;
8)
qt_dec_test
;;
9)
gst_enc_test
;;
*)
echo "not fount your input."
;;
esac

View File

@ -0,0 +1,27 @@
#!/bin/bash
function test_bt() {
wifibt-init.sh
sleep 5
hciconfig hci0 up && hciconfig -a | grep UP
if [ $? -ne 0 ];then
echo "The bt test fail !!!"
dmesg > /data/bt_dmesg.txt
exit 11
fi
}
function main() {
while true; do
test_bt
sleep 1
cnt=$((cnt + 1))
echo "
#################################################
# The BT has been tuned on/off for $cnt times #
#################################################
"
done
}
main

View File

@ -0,0 +1,25 @@
#!/bin/bash
function test_wifi() {
ifconfig wlan0 down && ifconfig wlan0 up && ifconfig wlan0 | grep UP
if [ $? -ne 0 ];then
echo "The wifi test fail !!!"
dmesg > /data/wifi_dmesg.txt
exit 11
fi
}
function main() {
while true; do
test_wifi
sleep 1
cnt=$((cnt + 1))
echo "
#################################################
# The WiFi has been tuned on/off for $cnt times #
#################################################
"
done
}
main

BIN
debian/overlay-debug/usr/local/test.mp4 vendored Normal file

Binary file not shown.

27
debian/overlay-firmware/usr/bin/npu-image.sh vendored Executable file
View File

@ -0,0 +1,27 @@
#!/bin/bash
COMPATIBLE=$(cat /proc/device-tree/compatible)
if [ -e "/sys/devices/platform/f8000000.pcie/pcie_reset_ep" ] ;
then
echo "upgrading npu with pcie image......\n"
if [[ $COMPATIBLE =~ "rk3399pro-evb-v14-linux" ]];
then
cd /usr/share/npu_fw_pcie/
npu_upgrade_pcie_combine MiniLoaderAll.bin uboot.img trust.img boot.img
cd /usr/bin/
mv npu_powerctrl_combine npu_powerctrl
else
cd /usr/share/npu_fw_pcie/
npu_upgrade_pcie MiniLoaderAll.bin uboot.img trust.img boot.img
fi
else
echo "upgrading npu with usb image......\n"
cd /usr/share/npu_fw/
npu_upgrade MiniLoaderAll.bin uboot.img trust.img boot.img
fi
sleep 1
echo "update npu image ok\n"

BIN
debian/overlay-firmware/usr/bin/npu_powerctrl vendored Executable file

Binary file not shown.

Binary file not shown.

Binary file not shown.

155
debian/overlay-firmware/usr/bin/npu_upgrade vendored Executable file
View File

@ -0,0 +1,155 @@
#!/bin/bash
PROGRAM=${0##*/}
#reset npu
/usr/bin/npu_powerctrl -i
/usr/bin/npu_powerctrl -o
sleep 1
if [ $# -ne 4 ]; then
echo 'Usage: '$PROGRAM' loader uboot trust boot'
exit
fi
DIR="/usr/share/npu_fw"
UPGRADE_TOOL=/usr/bin/upgrade_tool
LOADER=$DIR/$1
UBOOT=$DIR/$2
TRUST=$DIR/$3
BOOT=$DIR/$4
UBOOT_ADDR=0x20000
TRUST_ADDR=0x20800
BOOT_ADDR=0x21000
function download_func()
{
local RET1=1
echo 'start to download loader...' >> /tmp/npu.log
$UPGRADE_TOOL db $LOADER > /dev/null
if [ $? -ne 0 ]; then
echo 'failed to download loader!' >> /tmp/npu.log
return $RET1;
fi
echo 'download loader ok' >> /tmp/npu.log
sleep 1
echo 'start to wait loader...' >> /tmp/npu.log
$UPGRADE_TOOL td > /dev/null
if [ $? -ne 0 ]; then
echo 'failed to wait loader!' >> /tmp/npu.log
return $RET1
fi
echo 'loader is ready' >> /tmp/npu.log
echo 'start to write uboot...' >> /tmp/npu.log
$UPGRADE_TOOL wl $UBOOT_ADDR $UBOOT > /dev/null
if [ $? -ne 0 ]; then
echo 'failed to write uboot!' >> /tmp/npu.log
return $RET1
fi
echo 'write uboot ok' >> /tmp/npu.log
echo 'start to write trust...'
$UPGRADE_TOOL wl $TRUST_ADDR $TRUST > /dev/null
if [ $? -ne 0 ]; then
echo 'failed to write trust!' >> /tmp/npu.log
return $RET1
fi
echo 'write trust ok' >> /tmp/npu.log
echo 'start to write boot...' >> /tmp/npu.log
$UPGRADE_TOOL wl $BOOT_ADDR $BOOT > /dev/null
if [ $? -ne 0 ]; then
echo 'failed to write boot!' >> /tmp/npu.log
return $RET1
fi
echo 'write boot ok' >> /tmp/npu.log
RET1=0
return $RET1
}
function check_device_ready_func()
{
echo 'start to wait device...' > /tmp/npu.log
local i=0
local RET=1
while [ $i -lt 10 ]; do
$UPGRADE_TOOL ld > /dev/null
if [ $? -ne 0 ]; then
i=$((i+1))
echo $i
sleep 0.1
else
sleep 0.1
break
fi
if [ $i -eq 5 ]; then
/usr/bin/npu_powerctrl -o
sleep 3
echo 'reset npu to retry!!!' >> /tmp/npu.log
fi
done
if [ $i -ge 10 ]; then
echo 'failed to wait device!' >> /tmp/npu.log
return $RET
fi
echo 'device is ready' >> /tmp/npu.log
RET=0
return $RET
}
function poweron_Npu_func()
{
/usr/bin/npu_powerctrl -i
sleep 0.1
/usr/bin/npu_powerctrl -o
sleep 1
}
if [ ! -f $UPGRADE_TOOL ]; then
echo $UPGRADE_TOOL 'is not existed!'
exit
fi
if [ ! -f $LOADER ]; then
echo $LOADER 'is not existed!'
exit
fi
if [ ! -f $UBOOT ]; then
echo $UBOOT 'is not existed!'
exit
fi
if [ ! -f $TRUST ]; then
echo $TRUST 'is not existed!'
exit
fi
if [ ! -f $BOOT ]; then
echo $BOOT 'is not existed!'
exit
fi
check_device_ready_func
if [ $? = 1 ];then
echo "check_device_ready error!!!" >> /tmp/npu.log
poweron_Npu_func
check_device_ready_func
fi
download_func
if [ $? = 1 ];then
echo "reset download_func"
poweron_Npu_func
check_device_ready_func
download_func
fi
echo 'start to run system...' >> /tmp/npu.log
$UPGRADE_TOOL rs $UBOOT_ADDR $TRUST_ADDR $BOOT_ADDR $UBOOT $TRUST $BOOT > /dev/null
if [ $? -ne 0 ]; then
echo 'failed to run system!' >> /tmp/npu.log
exit
fi
echo 'run system ok' >> /tmp/npu.log

View File

@ -0,0 +1,156 @@
#!/bin/bash
PROGRAM=${0##*/}
#reset npu
/usr/bin/npu_powerctrl -i
/usr/bin/npu_powerctrl -o
sleep 1
if [ $# -ne 4 ]; then
echo 'Usage: '$PROGRAM' loader uboot trust boot'
exit
fi
DIR="/usr/share/npu_fw_pcie"
UPGRADE_TOOL=/usr/bin/upgrade_tool
LOADER=$DIR/$1
UBOOT=$DIR/$2
TRUST=$DIR/$3
BOOT=$DIR/$4
UBOOT_ADDR=0x20000
TRUST_ADDR=0x20800
BOOT_ADDR=0x21000
function download_func()
{
local RET1=1
echo 'start to download loader...' >> /tmp/npu.log
$UPGRADE_TOOL db $LOADER > /dev/null
if [ $? -ne 0 ]; then
echo 'failed to download loader!' >> /tmp/npu.log
return $RET1;
fi
echo 'download loader ok' >> /tmp/npu.log
sleep 1
echo 'start to wait loader...' >> /tmp/npu.log
$UPGRADE_TOOL td > /dev/null
if [ $? -ne 0 ]; then
echo 'failed to wait loader!' >> /tmp/npu.log
return $RET1
fi
echo 'loader is ready' >> /tmp/npu.log
echo 'start to write uboot...' >> /tmp/npu.log
$UPGRADE_TOOL wl $UBOOT_ADDR $UBOOT > /dev/null
if [ $? -ne 0 ]; then
echo 'failed to write uboot!' >> /tmp/npu.log
return $RET1
fi
echo 'write uboot ok' >> /tmp/npu.log
echo 'start to write trust...'
$UPGRADE_TOOL wl $TRUST_ADDR $TRUST > /dev/null
if [ $? -ne 0 ]; then
echo 'failed to write trust!' >> /tmp/npu.log
return $RET1
fi
echo 'write trust ok' >> /tmp/npu.log
echo 'start to write boot...' >> /tmp/npu.log
$UPGRADE_TOOL wl $BOOT_ADDR $BOOT > /dev/null
if [ $? -ne 0 ]; then
echo 'failed to write boot!' >> /tmp/npu.log
return $RET1
fi
echo 'write boot ok' >> /tmp/npu.log
RET1=0
return $RET1
}
function check_device_ready_func()
{
echo 'start to wait device...' > /tmp/npu.log
local i=0
local RET=1
while [ $i -lt 10 ]; do
$UPGRADE_TOOL ld > /dev/null
if [ $? -ne 0 ]; then
i=$((i+1))
echo $i
sleep 0.1
else
sleep 0.1
break
fi
if [ $i -eq 5 ]; then
/usr/bin/npu_powerctrl -o
sleep 3
echo 'reset npu to retry!!!' >> /tmp/npu.log
fi
done
if [ $i -ge 10 ]; then
echo 'failed to wait device!' >> /tmp/npu.log
return $RET
fi
echo 'device is ready' >> /tmp/npu.log
RET=0
return $RET
}
function poweron_Npu_func()
{
/usr/bin/npu_powerctrl -i
sleep 0.1
/usr/bin/npu_powerctrl -o
sleep 1
}
if [ ! -f $UPGRADE_TOOL ]; then
echo $UPGRADE_TOOL 'is not existed!'
exit
fi
if [ ! -f $LOADER ]; then
echo $LOADER 'is not existed!'
exit
fi
if [ ! -f $UBOOT ]; then
echo $UBOOT 'is not existed!'
exit
fi
if [ ! -f $TRUST ]; then
echo $TRUST 'is not existed!'
exit
fi
if [ ! -f $BOOT ]; then
echo $BOOT 'is not existed!'
exit
fi
check_device_ready_func
if [ $? = 1 ];then
echo "check_device_ready error!!!" >> /tmp/npu.log
poweron_Npu_func
check_device_ready_func
fi
download_func
if [ $? = 1 ];then
echo "reset download_func"
poweron_Npu_func
check_device_ready_func
download_func
fi
echo 'start to run system...' >> /tmp/npu.log
$UPGRADE_TOOL rs $UBOOT_ADDR $TRUST_ADDR $BOOT_ADDR $UBOOT $TRUST $BOOT > /dev/null
if [ $? -ne 0 ]; then
echo 'failed to run system!' >> /tmp/npu.log
exit
fi
echo 'run system ok' >> /tmp/npu.log
echo 1 > /sys/devices/platform/f8000000.pcie/pcie_deferred

View File

@ -0,0 +1,156 @@
#!/bin/bash
PROGRAM=${0##*/}
#reset npu
/usr/bin/npu_powerctrl_combine -i
/usr/bin/npu_powerctrl_combine -o
sleep 1
if [ $# -ne 4 ]; then
echo 'Usage: '$PROGRAM' loader uboot trust boot'
exit
fi
DIR="/usr/share/npu_fw_pcie"
UPGRADE_TOOL=/usr/bin/upgrade_tool
LOADER=$DIR/$1
UBOOT=$DIR/$2
TRUST=$DIR/$3
BOOT=$DIR/$4
UBOOT_ADDR=0x20000
TRUST_ADDR=0x20800
BOOT_ADDR=0x21000
function download_func()
{
local RET1=1
echo 'start to download loader...' >> /tmp/npu.log
$UPGRADE_TOOL db $LOADER > /dev/null
if [ $? -ne 0 ]; then
echo 'failed to download loader!' >> /tmp/npu.log
return $RET1;
fi
echo 'download loader ok' >> /tmp/npu.log
sleep 1
echo 'start to wait loader...' >> /tmp/npu.log
$UPGRADE_TOOL td > /dev/null
if [ $? -ne 0 ]; then
echo 'failed to wait loader!' >> /tmp/npu.log
return $RET1
fi
echo 'loader is ready' >> /tmp/npu.log
echo 'start to write uboot...' >> /tmp/npu.log
$UPGRADE_TOOL wl $UBOOT_ADDR $UBOOT > /dev/null
if [ $? -ne 0 ]; then
echo 'failed to write uboot!' >> /tmp/npu.log
return $RET1
fi
echo 'write uboot ok' >> /tmp/npu.log
echo 'start to write trust...'
$UPGRADE_TOOL wl $TRUST_ADDR $TRUST > /dev/null
if [ $? -ne 0 ]; then
echo 'failed to write trust!' >> /tmp/npu.log
return $RET1
fi
echo 'write trust ok' >> /tmp/npu.log
echo 'start to write boot...' >> /tmp/npu.log
$UPGRADE_TOOL wl $BOOT_ADDR $BOOT > /dev/null
if [ $? -ne 0 ]; then
echo 'failed to write boot!' >> /tmp/npu.log
return $RET1
fi
echo 'write boot ok' >> /tmp/npu.log
RET1=0
return $RET1
}
function check_device_ready_func()
{
echo 'start to wait device...' > /tmp/npu.log
local i=0
local RET=1
while [ $i -lt 10 ]; do
$UPGRADE_TOOL ld > /dev/null
if [ $? -ne 0 ]; then
i=$((i+1))
echo $i
sleep 0.1
else
sleep 0.1
break
fi
if [ $i -eq 5 ]; then
/usr/bin/npu_powerctrl -o
sleep 3
echo 'reset npu to retry!!!' >> /tmp/npu.log
fi
done
if [ $i -ge 10 ]; then
echo 'failed to wait device!' >> /tmp/npu.log
return $RET
fi
echo 'device is ready' >> /tmp/npu.log
RET=0
return $RET
}
function poweron_Npu_func()
{
/usr/bin/npu_powerctrl -i
sleep 0.1
/usr/bin/npu_powerctrl -o
sleep 1
}
if [ ! -f $UPGRADE_TOOL ]; then
echo $UPGRADE_TOOL 'is not existed!'
exit
fi
if [ ! -f $LOADER ]; then
echo $LOADER 'is not existed!'
exit
fi
if [ ! -f $UBOOT ]; then
echo $UBOOT 'is not existed!'
exit
fi
if [ ! -f $TRUST ]; then
echo $TRUST 'is not existed!'
exit
fi
if [ ! -f $BOOT ]; then
echo $BOOT 'is not existed!'
exit
fi
check_device_ready_func
if [ $? = 1 ];then
echo "check_device_ready error!!!" >> /tmp/npu.log
poweron_Npu_func
check_device_ready_func
fi
download_func
if [ $? = 1 ];then
echo "reset download_func"
poweron_Npu_func
check_device_ready_func
download_func
fi
echo 'start to run system...' >> /tmp/npu.log
$UPGRADE_TOOL rs $UBOOT_ADDR $TRUST_ADDR $BOOT_ADDR $UBOOT $TRUST $BOOT > /dev/null
if [ $? -ne 0 ]; then
echo 'failed to run system!' >> /tmp/npu.log
exit
fi
echo 'run system ok' >> /tmp/npu.log
echo 1 > /sys/devices/platform/f8000000.pcie/pcie_deferred

BIN
debian/overlay-firmware/usr/bin/upgrade_tool vendored Executable file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,54 @@
# This is toplevel configuration for for 'alsactl init'.
# See 'man alsactl_init' for syntax.
# set root device directory in sysfs for soundcard for ATTR{} command
CONFIG{sysfs_device}="/class/sound/card$cardinfo{card}/device"
ACCESS!="$sysfsroot$config{sysfs_device}", \
CONFIG{sysfs_device}="/class/sound/controlC$cardinfo{card}/device"
# test for extra commands
ENV{CMD}=="help", INCLUDE="help", GOTO="00main_end"
ENV{CMD}=="info", INCLUDE="info", GOTO="00main_end"
ENV{CMD}=="default", INCLUDE="default", GOTO="00main_end"
ENV{CMD}=="test", INCLUDE="test", GOTO="00main_end"
ENV{CMD}=="*", ERROR="Unknown command '$env{CMD}'\n", GOTO="00main_end"
# include files with real configuration
#
# steps are:
# 1) look for preinit subdirectory and parse all files in it
# 2) if RESULT=="skip", skip ALSA standard configuration files
# 3) do ALSA standard configuration
# 4) look for postinit subdirectory and parse all files in it
# 5) if RESULT!="true", initialize hardware using a guess method,
# print an error message and return with exit code 99
# 6) return with exit code 0 (success)
#
RESULT="unknown"
ACCESS=="preinit", INCLUDE="preinit"
RESULT=="skip", GOTO="init_end"
# real ALSA configuration database
CARDINFO{driver}=="HDA-Intel", INCLUDE="hda", GOTO="init_end"
CARDINFO{driver}=="CA0106", INCLUDE="ca0106", GOTO="init_end"
CARDINFO{driver}=="ENS1371", INCLUDE="ens1371", GOTO="init_end"
CARDINFO{driver}=="rockchip_rt5616", INCLUDE="rt5616", GOTO="init_end"
CARDINFO{driver}=="rockchip_rt5640", INCLUDE="rt5640", GOTO="init_end"
CARDINFO{driver}=="realtek_rt5651-", INCLUDE="rt5651", GOTO="init_end"
CARDINFO{driver}=="rockchip_rk809-", INCLUDE="rk809", GOTO="init_end"
CARDINFO{driver}=="Test", INCLUDE="test", GOTO="init_end"
LABEL="init_end"
ACCESS=="postinit", INCLUDE="postinit"
RESULT=="true", GOTO="00_mainend"
ERROR="Found hardware: \"$cardinfo{driver}\" \"$cardinfo{mixername}\" \"$cardinfo{components}\" \"$attr{subsystem_vendor}\" \"$attr{subsystem_device}\"\n"
ERROR="Hardware is initialized using a generic method\n"
INCLUDE="default"
EXIT="99"
#
# label identifying end of main file
#
LABEL="00main_end"

View File

@ -0,0 +1,10 @@
# Configuration for rt809 driver
#playback
CTL{reset}="mixer"
CTL{name}="Playback Path", CTL{value}="SPK_HP"
#record
CTL{name}="Capture MIC Path", CTL{value}="Main Mic"
RESULT="true", EXIT="return"

View File

@ -0,0 +1,35 @@
# Configuration for rt5616 driver
#playback
CTL{reset}="mixer"
CTL{name}="DAI select", CTL{value}="0"
CTL{name}="DAC MIXL INF1 Switch", CTL{value}="on"
CTL{name}="DAC MIXR INF1 Switch", CTL{value}="on"
CTL{name}="Stereo DAC MIXL DAC L1 Switch", CTL{value}="on"
CTL{name}="Stereo DAC MIXR DAC R1 Switch", CTL{value}="on"
CTL{name}="SPK MIXL DAC L1 Switch", CTL{value}="on"
CTL{name}="SPK MIXR DAC R1 Switch", CTL{value}="on"
CTL{name}="SPOL MIX SPKVOL L Switch", CTL{value}="on"
CTL{name}="SPOR MIX SPKVOL R Switch", CTL{value}="on"
CTL{name}="Speaker L Playback Switch", CTL{value}="on"
CTL{name}="Speaker R Playback Switch", CTL{value}="on"
CTL{name}="Speaker Channel Switch", CTL{value}="on, on"
CTL{name}="Speaker Playback Volume", CTL{value}="18, 18"
#record
CTL{name}="Stereo DAC MIXL DAC L1 Switch", CTL{value}="on"
CTL{name}="Stereo DAC MIXR DAC R1 Switch", CTL{value}="on"
CTL{name}="OUT MIXL DAC L1 Switch", CTL{value}="on"
CTL{name}="OUT MIXR DAC R1 Switch", CTL{value}="on"
CTL{name}="HP R Playback Switch", CTL{value}="on"
CTL{name}="HP L Playback Switch", CTL{value}="on"
CTL{name}="HPO MIX HPVOL Switch", CTL{value}="on"
CTL{name}="HP Channel Switch", CTL{value}="on, on"
CTL{name}="HP Playback Volume", CTL{value}="28, 28"
RESULT="true", EXIT="return"

View File

@ -0,0 +1,28 @@
# Configuration for rt5640 driver
# playback
CTL{reset}="mixer"
CTL{name}="DAI select", CTL{value}="0"
CTL{name}="DAC MIXL INF1 Switch", CTL{value}="on"
CTL{name}="DAC MIXR INF1 Switch", CTL{value}="on"
CTL{name}="Stereo DAC MIXL DAC L1 Switch", CTL{value}="on"
CTL{name}="Stereo DAC MIXR DAC R1 Switch", CTL{value}="on"
CTL{name}="SPK MIXL DAC L1 Switch", CTL{value}="on"
CTL{name}="SPK MIXR DAC R1 Switch", CTL{value}="on"
CTL{name}="SPOL MIX SPKVOL L Switch", CTL{value}="on"
CTL{name}="SPOR MIX SPKVOL R Switch", CTL{value}="on"
CTL{name}="Speaker L Playback Switch", CTL{value}="on"
CTL{name}="Speaker R Playback Switch", CTL{value}="on"
CTL{name}="Speaker Channel Switch", CTL{value}="on, on"
CTL{name}="Speaker Playback Volume", CTL{value}="18, 18"
CTL{name}="Stereo DAC MIXL DAC L1 Switch", CTL{value}="on"
CTL{name}="Stereo DAC MIXR DAC R1 Switch", CTL{value}="on"
CTL{name}="OUT MIXL DAC L1 Switch", CTL{value}="on"
CTL{name}="OUT MIXR DAC R1 Switch", CTL{value}="on"
CTL{name}="HP R Playback Switch", CTL{value}="on"
CTL{name}="HP L Playback Switch", CTL{value}="on"
CTL{name}="HPO MIX HPVOL Switch", CTL{value}="on"
CTL{name}="HP Channel Switch", CTL{value}="on, on"
CTL{name}="HP Playback Volume", CTL{value}="28, 28"
RESULT="true", EXIT="return"

View File

@ -0,0 +1,27 @@
# Configuration for rt5640 driver
# playback
CTL{reset}="mixer"
CTL{name}="DAC MIXL INF1 Switch", CTL{value}="on"
CTL{name}="DAC MIXR INF1 Switch", CTL{value}="on"
CTL{name}="Stereo DAC MIXL DAC L1 Switch", CTL{value}="on"
CTL{name}="Stereo DAC MIXR DAC R1 Switch", CTL{value}="on"
CTL{name}="OUT MIXL DAC L1 Switch", CTL{value}="on"
CTL{name}="OUT MIXR DAC R1 Switch", CTL{value}="on"
CTL{name}="HPOVOL L Switch", CTL{value}="on"
CTL{name}="HPOVOL R Switch", CTL{value}="on"
CTL{name}="HPO MIX HPVOL Switch", CTL{value}="on"
CTL{name}="HPO L Playback Switch", CTL{value}="on"
CTL{name}="HPO R Playback Switch", CTL{value}="on, on"
#CTL{name}="Speaker Playback Volume", CTL{value}="18, 18"
CTL{name}="RECMIXL BST2 Switch", CTL{value}="on"
CTL{name}="RECMIXR BST2 Switch", CTL{value}="on"
CTL{name}="Stereo1 ADC L1 Mux", CTL{value}="ADC"
CTL{name}="Stereo1 ADC R1 Mux", CTL{value}="ADC"
CTL{name}="Stereo1 ADC MIXL ADC1 Switch", CTL{value}="on"
CTL{name}="Stereo1 ADC MIXR ADC1 Switch", CTL{value}="on"
CTL{name}="ADC Capture Switch", CTL{value}="on"
CTL{name}="IN2 Boost", CTL{value}="2"
CTL{name}="ADC Capture Volume", CTL{value}="47, 47"
RESULT="true", EXIT="return"

View File

@ -0,0 +1,143 @@
# Use case for devices on realtek,rt5651-codec card.
SectionVerb {
EnableSequence [
cdev "hw:realtekrt5651co"
]
DisableSequence [
cdev "hw:realtekrt5651co"
]
}
SectionDevice."Headphone".0 {
Comment "Headphone Playback"
EnableSequence [
cdev "hw:realtekrt5651co"
cset "name='DAC MIXL INF1 Switch' 1"
cset "name='DAC MIXR INF1 Switch' 1"
cset "name='Stereo DAC MIXL DAC L1 Switch' 1"
cset "name='Stereo DAC MIXR DAC R1 Switch' 1"
cset "name='DAC MIXL INF1 Switch' 1"
cset "name='DAC MIXR INF1 Switch' 1"
cset "name='OUT MIXL DAC L1 Switch' 1"
cset "name='OUT MIXR DAC R1 Switch' 1"
cset "name='HPOVOL L Switch'' 1"
cset "name='HPOVOL R Switch' 1"
cset "name='HPO MIX HPVOL Switch' 1"
cset "name='HPO R Playback Switch' 1"
cset "name='HPO L Playback Switch' 1"
]
DisableSequence [
cdev "hw:realtekrt5651co"
cset "name='HPO L Playback Switch' 0"
cset "name='HPO R Playback Switch' 0"
cset "name='HPO MIX HPVOL Switch' 0"
cset "name='HPOVOL R Switch' 0"
cset "name='HPOVOL L Switch'' 0"
cset "name='OUT MIXR DAC R1 Switch' 0"
cset "name='OUT MIXL DAC L1 Switch' 0"
cset "name='DAC MIXR INF1 Switch' 0"
cset "name='DAC MIXL INF1 Switch' 0"
cset "name='Stereo DAC MIXR DAC R1 Switch' 0"
cset "name='Stereo DAC MIXL DAC L1 Switch' 0"
cset "name='DAC MIXR INF1 Switch' 0"
cset "name='DAC MIXL INF1 Switch' 0"
]
Value {
PlaybackPCM "hw:realtekrt5651co"
PlaybackChannels "2"
PlaybackPriority "2"
# JackControl "Headphone Jack"
# JackHWMute "Headphone"
}
}
SectionDevice."Speaker".0 {
Comment "Speaker Playback"
EnableSequence [
cdev "hw:realtekrt5651co"
cset "name='DAC MIXL INF1 Switch' 1"
cset "name='DAC MIXR INF1 Switch' 1"
cset "name='Stereo DAC MIXL DAC L1 Switch' 1"
cset "name='Stereo DAC MIXR DAC R1 Switch' 1"
cset "name='DAC MIXL INF1 Switch' 1"
cset "name='DAC MIXR INF1 Switch' 1"
cset "name='OUT MIXL DAC L1 Switch' 1"
cset "name='OUT MIXR DAC R1 Switch' 1"
]
DisableSequence [
cdev "hw:realtekrt5651co"
cset "name='OUT MIXR DAC R1 Switch' 0"
cset "name='OUT MIXL DAC L1 Switch' 0"
cset "name='DAC MIXR INF1 Switch' 0"
cset "name='DAC MIXL INF1 Switch' 0"
cset "name='Stereo DAC MIXR DAC R1 Switch' 0"
cset "name='Stereo DAC MIXL DAC L1 Switch' 0"
cset "name='DAC MIXR INF1 Switch' 0"
cset "name='DAC MIXL INF1 Switch' 0"
]
Value {
PlaybackPCM "hw:realtekrt5651co"
PlaybackChannels "2"
PlaybackPriority "2"
# JackControl "Headphone Jack"
# JackHWMute "Headphone"
}
}
SectionDevice."Mic".0 {
Comment "Internal Microphone"
Value {
CaptureChannels "2"
CapturePriority "150"
}
EnableSequence [
cdev "hw:realtekrt5651co"
cset "name='RECMIXL BST2 Switch' 1"
cset "name='RECMIXR BST2 Switch' 1"
cset "name='Stereo1 ADC L1 Mux' 1"
cset "name='Stereo1 ADC R1 Mux' 1"
cset "name='Stereo1 ADC MIXL ADC1 Switch' 1"
cset "name='Stereo1 ADC MIXR ADC1 Switchx' 1"
cset "name='ADC Capture Switch' 1"
cset "name='IN2 Boost' 2"
cset "name='ADC Capture Volume' 47"
]
DisableSequence [
cdev "hw:realtekrt5651co"
]
}
SectionDevice."HSMic".1 {
Comment "Headset Microphone"
Value {
CaptureChannels "2"
# JackControl "Headphone Jack"
# JackHWMute "Mic"
}
EnableSequence [
cdev "hw:realtekrt5651co"
]
DisableSequence [
cdev "hw:realtekrt5651co"
]
}

View File

@ -0,0 +1,4 @@
SectionUseCase."HiFi" {
File "HiFi.conf"
Comment "Play HiFi quality Music."
}

View File

@ -0,0 +1,95 @@
# Use case for devices on rockchip,rk809-codec card.
SectionVerb {
EnableSequence [
cdev "hw:rockchiprk809co"
]
DisableSequence [
cdev "hw:rockchiprk809co"
]
}
SectionDevice."Headphone".0 {
Comment "Headphones Playback"
EnableSequence [
cdev "hw:rockchiprk809co"
cset "name='Playback Path' HP"
]
DisableSequence [
cdev "hw:rockchiprk809co"
cset "name='Playback Path' OFF"
]
Value {
PlaybackPCM "hw:rockchiprk809co"
PlaybackChannels "2"
PlaybackPriority "1"
# JackControl "Headphone Jack"
# JackHWMute "Speaker"
}
}
SectionDevice."Speaker".0 {
Comment "Speaker Playback"
EnableSequence [
cdev "hw:rockchiprk809co"
cset "name='Playback Path' SPK"
]
DisableSequence [
cdev "hw:rockchiprk809co"
cset "name='Playback Path' OFF"
]
Value {
PlaybackPCM "hw:rockchiprk809co"
PlaybackChannels "2"
PlaybackPriority "2"
# JackControl "Headphone Jack"
# JackHWMute "Headphone"
}
}
SectionDevice."Mic".0 {
Comment "Internal Microphone"
Value {
CaptureChannels "2"
CapturePriority "150"
}
EnableSequence [
cdev "hw:rockchiprk809co"
]
DisableSequence [
cdev "hw:rockchiprk809co"
]
}
SectionDevice."HSMic".1 {
Comment "Headset Microphone"
Value {
CaptureChannels "2"
# JackControl "Headphone Jack"
# JackHWMute "Mic"
}
EnableSequence [
cdev "hw:rockchiprk809co"
]
DisableSequence [
cdev "hw:rockchiprk809co"
]
}

View File

@ -0,0 +1,4 @@
SectionUseCase."HiFi" {
File "HiFi.conf"
Comment "Play HiFi quality Music."
}

View File

@ -0,0 +1,57 @@
# Use case for devices on rockchip,rt5616-codec card.
SectionVerb {
EnableSequence [
]
DisableSequence [
]
}
SectionDevice."Headphones" {
Comment "Headphones playback"
EnableSequence [
]
DisableSequence [
]
Value {
PlaybackPCM "hw:rockchiprt5616c,0"
PlaybackChannels "2"
PlaybackPriority "1"
}
}
SectionDevice."HDMI-stereo" {
Comment "HDMI Digital Stereo Output"
EnableSequence [
]
DisableSequence [
]
Value {
PlaybackPCM "hw:rockchiprt5616c,1"
PlaybackChannels "2"
PlaybackPriority "2"
}
}
SectionDevice."MIC" {
Comment "Microphone"
EnableSequence [
]
DisableSequence [
]
Value {
CapturePCM "hw:rockchiprt5616c,0"
CaptureChannels "2"
}
}

View File

@ -0,0 +1,4 @@
SectionUseCase."HiFi" {
File "HiFi"
Comment "Play HiFi quality Music."
}

View File

@ -0,0 +1,115 @@
# Use case for devices on rockchip,rt5640-codec card.
SectionVerb {
EnableSequence [
cdev "hw:rockchiprt5640c"
]
DisableSequence [
cdev "hw:rockchiprt5640c"
]
}
SectionDevice."Headphone".0 {
Comment "Headphone Playback"
EnableSequence [
cdev "hw:rockchiprt5640c"
cset "name='HPO MIX DAC2 Switch' 1"
cset "name='HP L Playback Switch' 1"
cset "name='HP R Playback Switch"' 1"
]
DisableSequence [
cdev "hw:rockchiprt5640c"
cset "name='HP R Playback Switch"' 0"
cset "name='HPO MIX DAC2 Switch' 0"
cset "name='HP L Playback Switch' 0"
]
Value {
PlaybackPCM "hw:rockchiprt5640c"
PlaybackChannels "2"
PlaybackPriority "2"
# JackControl "Headphone Jack"
# JackHWMute "Headphone"
}
}
SectionDevice."Speaker".0 {
Comment "Speaker Playback"
EnableSequence [
cdev "hw:rockchiprt5640c"
cset "name='DAI select' 1:2|2:1"
cset "name='Mono DAC Playback Volume' 175"
cset "name='DAC2 Playback Switch' 1"
cset "name='Mono DAC MIXL DAC L2 Switch' 1"
cset "name='Mono DAC MIXR DAC R2 Switch' 1"
]
DisableSequence [
cdev "hw:rockchiprt5640c"
cset "name='Mono DAC Playback Volume' 0"
cset "name='DAC2 Playback Switch' 0"
cset "name='Mono DAC MIXL DAC L2 Switch' 0"
cset "name='Mono DAC MIXR DAC R2 Switch' 0"
]
Value {
PlaybackPCM "hw:rockchiprt5640c"
PlaybackChannels "2"
PlaybackPriority "2"
# JackControl "Headphone Jack"
# JackHWMute "Headphone"
}
}
SectionDevice."Mic".0 {
Comment "Internal Microphone"
Value {
CaptureChannels "2"
CapturePriority "150"
}
EnableSequence [
cdev "hw:rockchiprt5640c"
cset "name='DAI select' 1:2|2:1"
cset "name='RECMIXR BST3 Switch' 0"
cset "name='RECMIXR BST1 Switch' 1"
cset "name='Stereo1 ADC R1 Mux' 1"
cset "name='Mono ADC R1 Mux' ADCR"
cset "name='Mono ADC MIXR ADC1 Switch' 1"
cset "name='IN1 Boost' 5"
cset "name='Mono ADC Capture Volume' 60"
]
DisableSequence [
cdev "hw:rockchiprt5640c"
]
}
SectionDevice."HSMic".1 {
Comment "Headset Microphone"
Value {
CaptureChannels "2"
# JackControl "Headphone Jack"
# JackHWMute "Mic"
}
EnableSequence [
cdev "hw:rockchiprt5640c"
]
DisableSequence [
cdev "hw:rockchiprt5640c"
]
}

View File

@ -0,0 +1,4 @@
SectionUseCase."HiFi" {
File "HiFi.conf"
Comment "Play HiFi quality Music."
}

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<project name="android/rk/u-boot" path="npu/u-boot" revision="d30345d69073dced694d4a1a1f8e6f6f6c1ac56c" upstream="next-dev"/>
<project name="linux/app/n4" path="npu/app/n4" revision="6e3fc43844746cfbf4498f63f27472023c01f0a0" upstream="master"/>
<project name="linux/buildroot/dl" path="npu/buildroot/dl" revision="cd79e8e74ad0246112627fe9815dccad52fb6763" upstream="master"/>
<project name="linux/device/rockchip" path="npu/device/rockchip" revision="cc45e08b4814060b635177ef14de462441e5c835" upstream="master">
<linkfile dest="npu/mkfirmware.sh" src="common/mkfirmware.sh"/>
<linkfile dest="npu/build.sh" src="common/build.sh"/>
<linkfile dest="npu/rkflash.sh" src="common/rkflash.sh"/>
<linkfile dest="device/rockchip/.target_product" src="rk3399pro"/>
</project>
<project name="linux/external/camera_engine_rkisp" path="npu/external/camera_engine_rkisp" revision="a79d36dac4d357ec156506c84775a4e53c501939" upstream="master"/>
<project name="linux/external/powermanager" path="npu/external/powermanager" revision="17921d6b75395df5478613973e58916a6cf7c7ad" upstream="master"/>
<project name="linux/external/rknpu" path="npu/external/rknpu" revision="b010399b7595945381ddd63853ecf1218a130427" upstream="master"/>
<project name="linux/external/rkscript" path="npu/external/rkscript" revision="324143e744f6d1a227a524c63a7ac3046d5f7915" upstream="master"/>
<project name="linux/external/rktoolkit" path="npu/external/rktoolkit" revision="fc1ddcf4f804d1dbb55e2695a32b2aabe6016e8e" upstream="master"/>
<project name="linux/linux-rga" path="npu/external/linux-rga" revision="72e7764a9fe358e6ad50eb1b21176cc95802c7fb" upstream="master"/>
<project name="linux/rkmedia" path="npu/external/rkmedia" revision="6c796505c1d327f06ec6ade0df697ff84bfe75b1" upstream="master"/>
<project name="rk/kernel-stable" path="npu/kernel" revision="5cccececf2a0bb2e0b00707137164a32e8b1bf82" upstream="stable-4.4-rk3399pro_npu-linux"/>
<project name="rk/prebuilts/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu" path="npu/prebuilts/gcc/linux-x86/aarch64/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu" revision="f96f76d6be89a6e28d4dac1f233f9aca9921f69b" upstream="master"/>
<project name="rk/rk1108/buildroot" path="npu/buildroot" revision="f2fea23c798aa069cc05cea83f2dea3e481aa2da" upstream="rockchip/2018.02-rc3">
<linkfile dest="npu/Makefile" src="build/Makefile"/>
<linkfile dest="npu/envsetup.sh" src="build/envsetup.sh"/>
</project>
<project name="rk/rkbin" path="npu/rkbin" revision="2112f458bc492e497ff5579c96b67068ba95de14" upstream="master"/>
</manifest>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<project name="android/rk/u-boot" path="npu/u-boot" revision="d30345d69073dced694d4a1a1f8e6f6f6c1ac56c" upstream="next-dev"/>
<project name="linux/app/n4" path="npu/app/n4" revision="6e3fc43844746cfbf4498f63f27472023c01f0a0" upstream="master"/>
<project name="linux/buildroot/dl" path="npu/buildroot/dl" revision="cd79e8e74ad0246112627fe9815dccad52fb6763" upstream="master"/>
<project name="linux/device/rockchip" path="npu/device/rockchip" revision="cc45e08b4814060b635177ef14de462441e5c835" upstream="master">
<linkfile dest="npu/mkfirmware.sh" src="common/mkfirmware.sh"/>
<linkfile dest="npu/build.sh" src="common/build.sh"/>
<linkfile dest="npu/rkflash.sh" src="common/rkflash.sh"/>
<linkfile dest="device/rockchip/.target_product" src="rk3399pro"/>
</project>
<project name="linux/external/camera_engine_rkisp" path="npu/external/camera_engine_rkisp" revision="a79d36dac4d357ec156506c84775a4e53c501939" upstream="master"/>
<project name="linux/external/powermanager" path="npu/external/powermanager" revision="17921d6b75395df5478613973e58916a6cf7c7ad" upstream="master"/>
<project name="linux/external/rknpu" path="npu/external/rknpu" revision="b010399b7595945381ddd63853ecf1218a130427" upstream="master"/>
<project name="linux/external/rkscript" path="npu/external/rkscript" revision="324143e744f6d1a227a524c63a7ac3046d5f7915" upstream="master"/>
<project name="linux/external/rktoolkit" path="npu/external/rktoolkit" revision="fc1ddcf4f804d1dbb55e2695a32b2aabe6016e8e" upstream="master"/>
<project name="linux/linux-rga" path="npu/external/linux-rga" revision="72e7764a9fe358e6ad50eb1b21176cc95802c7fb" upstream="master"/>
<project name="linux/rkmedia" path="npu/external/rkmedia" revision="6c796505c1d327f06ec6ade0df697ff84bfe75b1" upstream="master"/>
<project name="rk/kernel-stable" path="npu/kernel" revision="bc673f1b71315f2d76827693f74a429894557cb7" upstream="stable-4.4-rk3399pro_npu-pcie-linux"/>
<project name="rk/prebuilts/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu" path="npu/prebuilts/gcc/linux-x86/aarch64/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu" revision="f96f76d6be89a6e28d4dac1f233f9aca9921f69b" upstream="master"/>
<project name="rk/rk1108/buildroot" path="npu/buildroot" revision="f2fea23c798aa069cc05cea83f2dea3e481aa2da" upstream="rockchip/2018.02-rc3">
<linkfile dest="npu/Makefile" src="build/Makefile"/>
<linkfile dest="npu/envsetup.sh" src="build/envsetup.sh"/>
</project>
<project name="rk/rkbin" path="npu/rkbin" revision="2112f458bc492e497ff5579c96b67068ba95de14" upstream="master"/>
</manifest>

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More