Project

General

Profile

General » History » Version 1

Alex Seferidis, 07/21/2025 12:50 PM

1 1 Alex Seferidis
# General
2
3
The first rootfs image from Yocto, is not the final image.
4
You can use final_rootfs (already deployed to Laptops where the image is flashed to devices)
5
On Alex Windows PC is located at (D:\ROCKCHIP - FlashTool\RKDevTool\RKDevTool\rockdev\ImageSTB\rootfs.img)
6
7
OR if someone wants to start from clean rootfs image, must follow this guide.
8
And then create the final image, by running on device:
9
10
```
11
umount /dev/mmcblk0p3
12
dd if=/dev/mmcblk0p3 of=/data/new_rootfs.img bs=1M
13
```
14
Then copy this image to PC using WinSCP software
15
16
## Clean setup - prepare rootfs
17
18
1. copy rtl_bt as described in bluetooth notes
19
20
2. change /etc/fstab to auto load /data (Flash device notes)
21
22
3. link /data/settings/10-eth0.network to /etc/systemd/network (+ chage mode to 666)
23
24
4. disable and mask rngd and rng-tools services
25
26
5. execute:
27
systemctl disable dnsmasq
28
(this service is only used when WiFi is access point, it is enebled from init_py script)
29
30
6. mv /etc/dnsmasq.conf /etc/dnsmasq.conf.orig
31
32
33
7. change /etc/apache2/httpd.conf
34
<IfModule dir_module>
35
    DirectoryIndex index.html index.php
36
</IfModule>
37
38
39
8. write permissions to httpd.conf:
40
chmod 666 /etc/apache2/httpd.conf
41
42
43
9. allow php to do system restart:
44
chmod u+s /sbin/reboot
45
46
10. allow php to execute dd command:
47
chmod u+s /bin/dd
48
49
11. chmod u+s /usr/bin/timedatectl
50
51
12. copy /home/root/extra.qmap from PC to device
52
53
13. pip3 install python-uinput
54
pip3 install evdev
55
pip3 install wget
56
pip3 install tqdm
57
pip3 install gpiod==1.5.4
58
59
60
14. change /etc/pulse/client.conf
61
autospawn = yes
62
allow-autospawn-for-root = yes
63
64
65
15. for USB disk
66
mkdir /media/disk
67
mount /dev/sda1 /media/disk
68
69
16. vi /etc/hostname
70
change to "FBX-3566"
71
72
73
17. create startup systemctl services as described at System setup notes
74
75
18. create links
76
ln -s /data/firmware/htdocs /usr/share/apache2/default-site/htdocs
77
ln -s /data/firmware/eglfs.conf /home/root/eglfs.conf
78
ln -s /data/settings/10-eth0.network /etc/systemd/network/10-eth0.network
79
80
81
## Useful commands
82
In case ethernet module has output clock 125Mhz:
83
phytool write eth0/0/0x1e 0xa012
84
phytool write eth0/0/0x1f 0x0070
85
phytool write eth0/0/0x00 0x9140
86
87
88
to read MAC address directly from EMMC:
89
dd if=/dev/mmcblk0 skip=7170 of=tmp.img bs=512 count=1
90
91
then open this file, first 6 bytes is MAC address
92
93
94
copy /home/root/extra.qmap from PC to device
95
96
97
98
gst-play-1.0 srt://ns1.vermantiagaming.com:47003
99
gst-play-1.0 https://cph-p2p-msl.akamaized.net/hls/live/2000341/test/master.m3u8
100
gst-play-1.0 https://dash.akamaized.net/dash264/TestCasesIOP33/adapatationSetSwitching/5/manifest.mpd
101
gst-play-1.0 srt://165.22.201.45:6316?passphrase=fQCUN6g5pGjsc3c6AmQS+TtSNuyHafaNy9IyyzTNcR8tic4Y1asNAxndZXxLY0Hu
102
103
104
modetest -M rockchip -P 57@71:640x480+0+0@BG24
105
modetest -M rockchip -P 73@71:640x480+0+0@BG24
106
107
modetest -M rockchip -P 54@82:640x480+0+0@BG24
108
109
modetest -M rockchip -w 57:zpos:1
110
modetest -M rockchip -w 73:zpos:0
111
112
modetest -M rockchip -w 57:zpos:0
113
modetest -M rockchip -w 73:zpos:1
114
115
modetest -M rockchip -w 54:zpos:1
116
modetest -M rockchip -w 88:zpos:0
117
118
???
119
export GST_MPP_DEC_DEFAULT_FAST_MODE=1
120
???
121
export GST_MPP_DEC_DEFAULT_FAST_MODE=0
122
export GST_MPP_VIDEODEC_DEFAULT_FORMAT=NV12
123
export GST_MPP_DEC_YUV420=1
124
export GST_MPP_DEC_DISABLE_NV12_10=1
125
export QTWEBENGINE_DISABLE_SANDBOX=1
126
???
127
128
export GST_MPP_DEC_DEFAULT_IGNORE_ERROR=0
129
export QT_QPA_PLATFORM=eglfs
130
export QT_QPA_EGLFS_KMS_CONFIG=/home/root/eglfs.conf
131
export QTWEBENGINE_REMOTE_DEBUGGING=192.168.1.210:2345
132
export QML_XHR_ALLOW_FILE_READ=1
133
export GST_VIDEO_FLIP_USE_RGA=1
134
export GST_VIDEO_CONVERT_USE_RGA=1
135
export QT_QPA_EVDEV_KEYBOARD_PARAMETERS=keymap=/home/root/extra.qmap
136
137
export QT_LOGGING_RULES=qt.qpa.input=true
138
139
/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
140
141
without conf:
142
/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
143
144
for widevine add: --widevine-path="/data/libwidevinecdm.so"
145
146
--use-gl=egl
147
--ignore-gpu-blacklist
148
--enable-gpu-rasterization
149
--enable-zero-copy
150
--enable-features=VaapiVideoDecodeLinuxGL
151
--disable-features=UseChromeOSDirectVideoDecoder
152
--enable-zero-copy
153
--enable-features=VaapiVideoDecoder,VaapiVideoEncoder
154
155
//for future use
156
QTWEBENGINE_CHROMIUM_FLAGS=--widevine-path="C:\Users\FRANC\OneDrive\Desktop\Programacion\Proyectos\C++\widevinecdm.dll" 
157
158
Test remote control:
159
dumpkeys > backup.kmap
160
loadkeys(1), dumpkeys(1), showkey(1), 
161
162
export GST_MPP_DEC_DEFAULT_IGNORE_ERROR=0
163
gst-play-1.0 udp://192.168.1.210:1260
164
gst-play-1.0 udp://230.0.0.1:1260
165
166
gst-launch-1.0 playbin uri="https://cph-p2p-msl.akamaized.net/hls/live/2000341/test/master.m3u8" video-sink="kmssink"
167
gst-launch-1.0 playbin flags=1 uri="udp://192.168.1.210:1260" video-sink="kmssink"
168
gst-launch-1.0 playbin buffer-size=100000000 uri="udp://230.0.0.1:1260" video-sink="kmssink"
169
170
171
172
for USB disk
173
mkdir /media/disk
174
mount /dev/sda1 /media/disk
175
176
vi /etc/hostname
177
change to "FBX-3566"
178
179
180
create startup systemctl services as described at folder : System setup/readme
181
182
183
ln -s /data/firmware/htdocs /usr/share/apache2/default-site/htdocs
184
ln -s /data/firmware/eglfs.conf /home/root/eglfs.conf
185
186
187
188
189
On our system we have got some conflict between python2 � python3, so the following commands worked for us:
190
191
ssh -vT git@www.rockchip.com.cn
192
python3 repo init -u ssh://git@www.rockchip.com.cn/linux/rockchip/platform/manifests -b linux -m rk356x_linux5.10_release.xml
193
python3 .repo/repo/repo init -u ssh://git@www.rockchip.com.cn/linux/rockchip/platform/manifests -b linux -m rk356x_linux5.10_release.xml
194
python3 .repo/repo/repo sync -c
195
196
//-----just for reference-----------
197
$ sysctl net.core.rmem_max
198
net.core.rmem_max = 212992
199
$ sysctl net.core.rmem_default
200
net.core.rmem_default = 212992
201
/etc/sysctl.conf file:
202
net.core.rmem_max=100000000
203
net.core.rmem_default=100000000
204
//----------------------------------
205
206
207
power configuration
208
/etc/systemd/logind.conf.d
209
https://wiki.archlinux.org/title/Power_management
210
211
212
check memory
213
ps -e -o pid,user,%mem,cmd --sort=-%mem
214
215
216
217
echo userspace > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
218
echo userspace > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
219
echo userspace > /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor
220
echo userspace > /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor
221
222
echo 500000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed
223
echo 500000 > /sys/devices/system/cpu/cpu1/cpufreq/scaling_setspeed
224
echo 500000 > /sys/devices/system/cpu/cpu2/cpufreq/scaling_setspeed
225
echo 500000 > /sys/devices/system/cpu/cpu3/cpufreq/scaling_setspeed
226
227
228
/sys/devices/platform/dmc/devfreq/dmc
229
230
231
for hdmi:
232
cd /sys/devices/platform/fe0a0000.hdmi
233
cd /sys/class/drm/card0-HDMI-A-1
234
cd /sys/kernel/debug/dri/0
235
cd /sys/kernel/debug/dw-hdmi
236
237
echo off > /sys/class/drm/card0-HDMI-A-1/status
238
echo on > /sys/class/drm/card0-HDMI-A-1/status
239
240
echo 0 >/sys/class/graphics/fb0/blank
241
echo 3 >/sys/class/graphics/fb0/blank
242
243
root@lemco-stb:/sys/class/drm/card0/device/driver# echo display-subsystem > unbind
244
root@lemco-stb:/sys/class/drm/card0/device/driver#
245
root@lemco-stb:/sys/class/drm/card0/device/driver# echo display-subsystem > bind
246
247
/sys/devices/platform/dmc/devfreq/dmc
248
249
cec-ctl -d/dev/cec0 --playback -S
250
cec-ctl -d /dev/cec0 --to 0 --standby -tv
251
cec-ctl -d/dev/cec0 --to 0 --image-view-on
252
cec-ctl -d/dev/cec0 --give-device-power-status --to 0
253
254
255
export GST_TRACE=mem-live
256
export GST_DEBUG=9
257
export GST_DEBUG=GST_REFCOUNTING:9
258
/data/firmware/externalplayer &> /var/volatile/gst.txt
259
260
261
----------------------
262
MMC card statistics
263
https://www.kernel.org/doc/Documentation/block/stat.txt
264
265
cat /sys/block/mmcblk0/stat
266
-------------------------
267
268
network statistics
269
ip -s -s link show dev eth0
270
ip -s -s link show dev wlan0
271
------------------------
272
273
274
echo 0x904 > /sys/module/rk_vcodec/parameters/mpp_dev_debug
275
https://www.nuevodevel.com/nuevo/showcase/drm
276
277
QOS: from element /GstPlayBin:playbin/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstMppVideoDec:mppvideodec0
278
processed = 457, dropped = 192
279
QOS: from element /GstPlayBin:playbin/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstMppVideoDec:mppvideodec0
280
281
export GST_DEBUG=2,videoconvert*:6
282
283
284
------------------------------
285
export GST_MPP_VIDEODEC_DEFAULT_ARM_AFBC=1
286
gst-play-1.0 nasa.mp4 --videosink="kmssink plane-id=87 render-rectangle=<0,0,3836,2156>"
287
288
289
check if mpp is running:
290
echo 0x04 > /sys/module/rk_vcodec/parameters/mpp_dev_debug
291
292
293
294
295
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
296
297
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
298
299
300
301
/sys/devices/platform/fdf80200.rkvdec/devfreq/fdf80200.rkvdec# cat trans_stat
302
303
304
305
memory leak???
306
export QMLSCENE_DEVICE=software
307
export QT_QUICK_BACKEND=software
308
309
310
https://opapmmd.mmdlive.lldns.net/opapmmd/516d2444298f46cbbb97da8d2ff3227a/manifest.m3u8?forcelive=1
311
https://opapmmd.mmdlive.lldns.net/opapmmd/f9aa5b076371477ead23fd53b2f6e4d2/manifest.m3u8?forcelive=1
312
https://mtoczko.github.io/hls-test-streams/test-program-time-gap/playlist.m3u8
313
314
audio only
315
https://streams.radiomast.io/ref-128k-mp3-stereo/hls.m3u8
316
https://mediaserviceslive.akamaized.net/hls/live/2038319/abcjazz/index.m3u8
317
https://mediaserviceslive.akamaized.net/hls/live/2038317/classic2/index.m3u8