General » History » Revision 1
Revision 1/2
| Next »
Alex Seferidis, 07/21/2025 12:50 PM
General¶
The first rootfs image from Yocto, is not the final image.
You can use final_rootfs (already deployed to Laptops where the image is flashed to devices)
On Alex Windows PC is located at (D:\ROCKCHIP - FlashTool\RKDevTool\RKDevTool\rockdev\ImageSTB\rootfs.img)
OR if someone wants to start from clean rootfs image, must follow this guide.
And then create the final image, by running on device:
umount /dev/mmcblk0p3
dd if=/dev/mmcblk0p3 of=/data/new_rootfs.img bs=1M
Then copy this image to PC using WinSCP software
Clean setup - prepare rootfs¶
-
copy rtl_bt as described in bluetooth notes
-
change /etc/fstab to auto load /data (Flash device notes)
-
link /data/settings/10-eth0.network to /etc/systemd/network (+ chage mode to 666)
-
disable and mask rngd and rng-tools services
-
execute:
systemctl disable dnsmasq
(this service is only used when WiFi is access point, it is enebled from init_py script) -
mv /etc/dnsmasq.conf /etc/dnsmasq.conf.orig
-
change /etc/apache2/httpd.conf
-
write permissions to httpd.conf:
chmod 666 /etc/apache2/httpd.conf -
allow php to do system restart:
chmod u+s /sbin/reboot -
allow php to execute dd command:
chmod u+s /bin/dd -
chmod u+s /usr/bin/timedatectl
-
copy /home/root/extra.qmap from PC to device
-
pip3 install python-uinput
pip3 install evdev
pip3 install wget
pip3 install tqdm
pip3 install gpiod==1.5.4 -
change /etc/pulse/client.conf
autospawn = yes
allow-autospawn-for-root = yes -
for USB disk
mkdir /media/disk
mount /dev/sda1 /media/disk -
vi /etc/hostname
change to "FBX-3566" -
create startup systemctl services as described at System setup notes
-
create links
ln -s /data/firmware/htdocs /usr/share/apache2/default-site/htdocs
ln -s /data/firmware/eglfs.conf /home/root/eglfs.conf
ln -s /data/settings/10-eth0.network /etc/systemd/network/10-eth0.network
Useful commands¶
In case ethernet module has output clock 125Mhz:
phytool write eth0/0/0x1e 0xa012
phytool write eth0/0/0x1f 0x0070
phytool write eth0/0/0x00 0x9140
to read MAC address directly from EMMC:
dd if=/dev/mmcblk0 skip=7170 of=tmp.img bs=512 count=1
then open this file, first 6 bytes is MAC address
copy /home/root/extra.qmap from PC to device
gst-play-1.0 srt://ns1.vermantiagaming.com:47003
gst-play-1.0 https://cph-p2p-msl.akamaized.net/hls/live/2000341/test/master.m3u8
gst-play-1.0 https://dash.akamaized.net/dash264/TestCasesIOP33/adapatationSetSwitching/5/manifest.mpd
gst-play-1.0 srt://165.22.201.45:6316?passphrase=fQCUN6g5pGjsc3c6AmQS+TtSNuyHafaNy9IyyzTNcR8tic4Y1asNAxndZXxLY0Hu
modetest -M rockchip -P 57@71:640x480+0+0@BG24
modetest -M rockchip -P 73@71:640x480+0+0@BG24
modetest -M rockchip -P 54@82:640x480+0+0@BG24
modetest -M rockchip -w 57:zpos:1
modetest -M rockchip -w 73:zpos:0
modetest -M rockchip -w 57:zpos:0
modetest -M rockchip -w 73:zpos:1
modetest -M rockchip -w 54:zpos:1
modetest -M rockchip -w 88:zpos:0
???
export GST_MPP_DEC_DEFAULT_FAST_MODE=1
???
export GST_MPP_DEC_DEFAULT_FAST_MODE=0
export GST_MPP_VIDEODEC_DEFAULT_FORMAT=NV12
export GST_MPP_DEC_YUV420=1
export GST_MPP_DEC_DISABLE_NV12_10=1
export QTWEBENGINE_DISABLE_SANDBOX=1
???
export GST_MPP_DEC_DEFAULT_IGNORE_ERROR=0
export QT_QPA_PLATFORM=eglfs
export QT_QPA_EGLFS_KMS_CONFIG=/home/root/eglfs.conf
export QTWEBENGINE_REMOTE_DEBUGGING=192.168.1.210:2345
export QML_XHR_ALLOW_FILE_READ=1
export GST_VIDEO_FLIP_USE_RGA=1
export GST_VIDEO_CONVERT_USE_RGA=1
export QT_QPA_EVDEV_KEYBOARD_PARAMETERS=keymap=/home/root/extra.qmap
export QT_LOGGING_RULES=qt.qpa.input=true
/data/firmware/lemcoplayer /data/firmware/browser.conf --no-sandbox --enable-gpu-rasterization --ignore-gpu-blocklist --enable-accelerated-video-decode --disable-web-security --allow-running-insecure-content
without conf:
/data/firmware/lemcoplayer --no-sandbox --enable-gpu-rasterization --ignore-gpu-blocklist --enable-accelerated-video-decode --disable-web-security --autoplay-policy=no-user-gesture-required --allow-running-insecure-content
for widevine add: --widevine-path="/data/libwidevinecdm.so"
--use-gl=egl
--ignore-gpu-blacklist
--enable-gpu-rasterization
--enable-zero-copy
--enable-features=VaapiVideoDecodeLinuxGL
--disable-features=UseChromeOSDirectVideoDecoder
--enable-zero-copy
--enable-features=VaapiVideoDecoder,VaapiVideoEncoder
//for future use
QTWEBENGINE_CHROMIUM_FLAGS=--widevine-path="C:\Users\FRANC\OneDrive\Desktop\Programacion\Proyectos\C++\widevinecdm.dll"
Test remote control:
dumpkeys > backup.kmap
loadkeys(1), dumpkeys(1), showkey(1),
export GST_MPP_DEC_DEFAULT_IGNORE_ERROR=0
gst-play-1.0 udp://192.168.1.210:1260
gst-play-1.0 udp://230.0.0.1:1260
gst-launch-1.0 playbin uri="https://cph-p2p-msl.akamaized.net/hls/live/2000341/test/master.m3u8" video-sink="kmssink"
gst-launch-1.0 playbin flags=1 uri="udp://192.168.1.210:1260" video-sink="kmssink"
gst-launch-1.0 playbin buffer-size=100000000 uri="udp://230.0.0.1:1260" video-sink="kmssink"
for USB disk
mkdir /media/disk
mount /dev/sda1 /media/disk
vi /etc/hostname
change to "FBX-3566"
create startup systemctl services as described at folder : System setup/readme
ln -s /data/firmware/htdocs /usr/share/apache2/default-site/htdocs
ln -s /data/firmware/eglfs.conf /home/root/eglfs.conf
On our system we have got some conflict between python2 � python3, so the following commands worked for us:
ssh -vT git@www.rockchip.com.cn
python3 repo init -u ssh://git@www.rockchip.com.cn/linux/rockchip/platform/manifests -b linux -m rk356x_linux5.10_release.xml
python3 .repo/repo/repo init -u ssh://git@www.rockchip.com.cn/linux/rockchip/platform/manifests -b linux -m rk356x_linux5.10_release.xml
python3 .repo/repo/repo sync -c
//-----just for reference-----------
$ sysctl net.core.rmem_max
net.core.rmem_max = 212992
$ sysctl net.core.rmem_default
net.core.rmem_default = 212992
/etc/sysctl.conf file:
net.core.rmem_max=100000000
net.core.rmem_default=100000000
//----------------------------------
power configuration
/etc/systemd/logind.conf.d
https://wiki.archlinux.org/title/Power_management
check memory
ps -e -o pid,user,%mem,cmd --sort=-%mem
echo userspace > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo userspace > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
echo userspace > /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor
echo userspace > /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor
echo 500000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed
echo 500000 > /sys/devices/system/cpu/cpu1/cpufreq/scaling_setspeed
echo 500000 > /sys/devices/system/cpu/cpu2/cpufreq/scaling_setspeed
echo 500000 > /sys/devices/system/cpu/cpu3/cpufreq/scaling_setspeed
/sys/devices/platform/dmc/devfreq/dmc
for hdmi:
cd /sys/devices/platform/fe0a0000.hdmi
cd /sys/class/drm/card0-HDMI-A-1
cd /sys/kernel/debug/dri/0
cd /sys/kernel/debug/dw-hdmi
echo off > /sys/class/drm/card0-HDMI-A-1/status
echo on > /sys/class/drm/card0-HDMI-A-1/status
echo 0 >/sys/class/graphics/fb0/blank
echo 3 >/sys/class/graphics/fb0/blank
root@lemco-stb:/sys/class/drm/card0/device/driver# echo display-subsystem > unbind
root@lemco-stb:/sys/class/drm/card0/device/driver#
root@lemco-stb:/sys/class/drm/card0/device/driver# echo display-subsystem > bind
/sys/devices/platform/dmc/devfreq/dmc
cec-ctl -d/dev/cec0 --playback -S
cec-ctl -d /dev/cec0 --to 0 --standby -tv
cec-ctl -d/dev/cec0 --to 0 --image-view-on
cec-ctl -d/dev/cec0 --give-device-power-status --to 0
export GST_TRACE=mem-live
export GST_DEBUG=9
export GST_DEBUG=GST_REFCOUNTING:9
/data/firmware/externalplayer &> /var/volatile/gst.txt
MMC card statistics
https://www.kernel.org/doc/Documentation/block/stat.txt
cat /sys/block/mmcblk0/stat¶
network statistics
ip -s -s link show dev eth0
ip -s -s link show dev wlan0
echo 0x904 > /sys/module/rk_vcodec/parameters/mpp_dev_debug
https://www.nuevodevel.com/nuevo/showcase/drm
QOS: from element /GstPlayBin:playbin/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstMppVideoDec:mppvideodec0
processed = 457, dropped = 192
QOS: from element /GstPlayBin:playbin/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstMppVideoDec:mppvideodec0
export GST_DEBUG=2,videoconvert*:6
export GST_MPP_VIDEODEC_DEFAULT_ARM_AFBC=1
gst-play-1.0 nasa.mp4 --videosink="kmssink plane-id=87 render-rectangle=<0,0,3836,2156>"
check if mpp is running:
echo 0x04 > /sys/module/rk_vcodec/parameters/mpp_dev_debug
gst-launch-1.0 -v filesrc location=73_1920x1080-12.yuv blocksize=3110400 ! video/x-raw,format=NV12,width=1920,height=1080,framerate=1/1 ! videoconvert ! video/x-raw,format=RGB,framerate=1/1 ! jpegenc ! filesink location=out.jpg
gst-launch-1.0 -v filesrc location=image.rgb blocksize=1555200 ! video/x-raw,format=RGB,width=960,height=540,framerate=1/1 ! videoconvert ! video/x-raw,format=RGB,framerate=1/1 ! jpegenc ! filesink location=out.jpg
/sys/devices/platform/fdf80200.rkvdec/devfreq/fdf80200.rkvdec# cat trans_stat
memory leak???
export QMLSCENE_DEVICE=software
export QT_QUICK_BACKEND=software
https://opapmmd.mmdlive.lldns.net/opapmmd/516d2444298f46cbbb97da8d2ff3227a/manifest.m3u8?forcelive=1
https://opapmmd.mmdlive.lldns.net/opapmmd/f9aa5b076371477ead23fd53b2f6e4d2/manifest.m3u8?forcelive=1
https://mtoczko.github.io/hls-test-streams/test-program-time-gap/playlist.m3u8
audio only
https://streams.radiomast.io/ref-128k-mp3-stereo/hls.m3u8
https://mediaserviceslive.akamaized.net/hls/live/2038319/abcjazz/index.m3u8
https://mediaserviceslive.akamaized.net/hls/live/2038317/classic2/index.m3u8
Updated by Alex Seferidis 5 months ago · 1 revisions