RK3588 OCR 相机稳定性分析

OCR Camera

Posted by LXG on May 30, 2024

CPU

APP 线程


nanopi3:/ $ ps -AT | grep 3718                                                                                                                                                                                                  
u0_a55        3718  3718   420 3215920 736744 0                   0 S ip.gpadc.common
u0_a55        3718  3724   420 3215920 737008 0                   0 S Signal Catcher
u0_a55        3718  3725   420 3215920 737008 0                   0 S perfetto_hprof_
u0_a55        3718  3726   420 3215920 737008 0                   0 S ADB-JDWP Connec
u0_a55        3718  3727   420 3215920 737008 0                   0 S Jit thread pool
u0_a55        3718  3728   420 3215920 737272 0                   0 S HeapTaskDaemon
u0_a55        3718  3729   420 3215920 737272 0                   0 S ReferenceQueueD
u0_a55        3718  3730   420 3215920 737272 0                   0 S FinalizerDaemon
u0_a55        3718  3731   420 3215920 737536 0                   0 S FinalizerWatchd
u0_a55        3718  3732   420 3215920 737536 0                   0 S Binder:3718_1
u0_a55        3718  3733   420 3215920 737536 0                   0 S Binder:3718_2
u0_a55        3718  3735   420 3215920 737536 0                   0 S Profile Saver
u0_a55        3718  3736   420 3215920 737800 0                   0 S Timer-0
u0_a55        3718  3738   420 3215920 737800 0                   0 S xcrash_crash_cb
u0_a55        3718  3739   420 3215920 737800 0                   0 S xcrash_trace_dp
u0_a55        3718  3741   420 3215920 738064 0                   0 S RenderThread
u0_a55        3718  3746   420 3215920 738064 0                   0 S Binder:3718_3
u0_a55        3718  3755   420 3215920 738064 0                   0 S ip.gpadc.common
u0_a55        3718  3757   420 3215920 738324 0                   0 S FileObserver
u0_a55        3718  3758   420 3215920 738324 0                   0 S Thread-4
u0_a55        3718  3759   420 3215920 738324 0                   0 S queued-work-loo
u0_a55        3718  3762   420 3215920 738324 0                   0 S mali-event-hand
u0_a55        3718  3763   420 3215920 738588 0                   0 S mali-mem-purge
u0_a55        3718  3764   420 3215920 738588 0                   0 S mali-cpu-comman
u0_a55        3718  3766   420 3215920 738588 0                   0 S hwuiTask0
u0_a55        3718  3767   420 3215920 738852 0                   0 S hwuiTask1
u0_a55        3718  3769   420 3215920 738852 0                   0 S mali-compiler
u0_a55        3718  3770   420 3215920 738852 0                   0 S OkHttp Connecti
u0_a55        3718  3771   420 3215920 738852 0                   0 S Okio Watchdog
u0_a55        3718  3773   420 3215920 739116 0                   0 S InsetsAnimation
u0_a55        3718  3802   420 3215920 739116 0                   0 S Binder:3718_3
u0_a55        3718  3803   420 3215920 739116 0                   0 S fixed(6)-pool-2
u0_a55        3718  3804   420 3215920 739380 0                   0 S fixed(6)-pool-2
u0_a55        3718  3805   420 3215920 739380 0                   0 S fixed(6)-pool-2
u0_a55        3718  3806   420 3215920 739380 0                   0 S fixed(6)-pool-2
u0_a55        3718  3807   420 3215920 739644 0                   0 R fixed(2)-pool-4
u0_a55        3718  3808   420 3215920 739644 0                   0 S fixed(2)-pool-4
u0_a55        3718  3812   420 3215920 739644 0                   0 S MQTT Rec: R6CKF
u0_a55        3718  3813   420 3215920 739644 0                   0 S MQTT Snd: R6CKF
u0_a55        3718  3814   420 3215920 739908 0                   0 S MQTT Call: R6CK
u0_a55        3718  3815   420 3215920 739908 0                   0 S fixed(4)-pool-3
u0_a55        3718  3816   420 3215920 739908 0                   0 S fixed(4)-pool-3
u0_a55        3718  3817   420 3215920 740172 0                   0 S fixed(4)-pool-3
u0_a55        3718  3818   420 3215920 740172 0                   0 S fixed(4)-pool-3
u0_a55        3718  3820   420 3215920 740172 0                   0 S hk-camera-00J73
u0_a55        3718  3822   420 3215920 740172 0                   0 S hk-camera-00J73
u0_a55        3718  3824   420 3215920 740432 0                   0 S hk-camera-00J73
u0_a55        3718  3825   420 3215920 740432 0                   0 S hk-camera-00J73
u0_a55        3718  3826   420 3215920 740432 0                   0 S hk-camera-00J73
u0_a55        3718  3827   420 3215920 740696 0                   0 S hk-camera-00J73
u0_a55        3718  3828   420 3215920 740696 0                   0 S hk-camera-00J73
u0_a55        3718  3829   420 3215920 740696 0                   0 S hk-camera-00J73
u0_a55        3718  3830   420 3215920 740696 0                   0 S Thread-3583
u0_a55        3718  3831   420 3215920 740960 0                   0 S hk-camera-00J73
u0_a55        3718  3832   420 3215920 740960 0                   0 S fixed(6)-pool-2
u0_a55        3718  3833   420 3215920 740960 0                   0 S fixed(6)-pool-2
u0_a55        3718  3834   420 3215920 741224 0                   0 S fixed(6)-pool-2
u0_a55        3718  3835   420 3215920 741224 0                   0 S fixed(6)-pool-2
u0_a55        3718  3836   420 3215920 741224 0                   0 S fixed(6)-pool-2
u0_a55        3718  3837   420 3215920 741224 0                   0 S fixed(6)-pool-2
u0_a55        3718  3838   420 3215920 741488 0                   0 S fixed(6)-pool-2
u0_a55        3718  3839   420 3215920 741488 0                   0 S fixed(2)-pool-4
u0_a55        3718  3840   420 3215920 741488 0                   0 S fixed(2)-pool-4
u0_a55        3718  3841   420 3215920 741752 0                   0 S fixed(2)-pool-4
u0_a55        3718  3842   420 3215920 741752 0                   0 S fixed(2)-pool-4
u0_a55        3718  3843   420 3215920 741752 0                   0 S fixed(2)-pool-4
u0_a55        3718  3844   420 3215920 742016 0                   0 S fixed(2)-pool-4
u0_a55        3718  3845   420 3215920 742016 0                   0 S fixed(2)-pool-4
u0_a55        3718  3861   420 3215920 742016 0                   0 S Binder:3718_4
u0_a55        3718  4153   420 3215920 742016 0                   0 S Thread-2928
u0_a55        3718  4154   420 3215920 742280 0                   0 S Studio:Socket
u0_a55        3718  4158   420 3215920 742280 0                   0 S Studio:Socket
u0_a55        3718  4159   420 3215920 742280 0                   0 S Studio:Socket
u0_a55        3718  4160   420 3215920 742540 0                   0 S Studio:Socket
u0_a55        3718  4161   420 3215920 742540 0                   0 S Studio:CmdHdler
u0_a55        3718  4163   420 3215920 742540 0                   0 S Studio:MemoryAg
u0_a55        3718  4165   420 3215920 742540 0                   0 S Thread-2929
u0_a55        3718  4166   420 3215920 742804 0                   0 S Thread-2930
u0_a55        3718  4169   420 3215920 742804 0                   0 S Studio:Socket
u0_a55        3718  4191   420 3215920 742804 0                   0 S Studio:Heartbea
u0_a55        3718  4200   420 3215920 743068 0                   0 S OkHttp Dispatch

systrace

ocr_thread_4

ocr_thread_3

ocr_thread_2

ocr_thread

内存

ocr_memory

能源

ocr_energy

ethtool

ethtool eth1


nanopi3:/ $ ethtool eth1
Settings for eth1:
        // 网卡支持使用双绞线连接
	Supported ports: [ TP ]
	// 支持的链路模式
	Supported link modes:   10baseT/Half 10baseT/Full 
	                        100baseT/Half 100baseT/Full 
	                        1000baseT/Full 
	                        2500baseT/Full 
	// 支持的暂停帧使用: 对称接收模式,意味着网卡可以在接收数据时暂停传输,以避免拥塞
	Supported pause frame use: Symmetric Receive-only
	// 支持自动协商
	Supports auto-negotiation: Yes
	// 支持的FEC模式: 未报告,FEC(Forward Error Correction,前向纠错)用于提高数据传输的可靠性
	Supported FEC modes: Not reported
	Advertised link modes:  10baseT/Half 10baseT/Full 
	                        100baseT/Half 100baseT/Full 
	                        1000baseT/Full 
	                        2500baseT/Full 
	Advertised pause frame use: Symmetric Receive-only
	Advertised auto-negotiation: Yes
	Advertised FEC modes: Not reported
	Link partner advertised link modes:  10baseT/Half 10baseT/Full 
	                                     100baseT/Half 100baseT/Full 
	                                     1000baseT/Full 
	Link partner advertised pause frame use: Symmetric Receive-only
	Link partner advertised auto-negotiation: Yes
	Link partner advertised FEC modes: Not reported
	// 速度与双工模式: 实际工作速度为1000Mbps(千兆),双工模式为全双工,意味着可以同时进行数据的发送和接收
	Speed: 1000Mb/s
	Duplex: Full
	Port: Twisted Pair
	PHYAD: 0
	Transceiver: internal
	Auto-negotiation: on
	MDI-X: Unknown
Cannot get wake-on-lan settings: Operation not permitted
	Current message level: 0x00000033 (51)
			       drv probe ifdown ifup
	Link detected: yes

ethtool -i eth1

检查驱动程序版本、固件版本和总线的详细信息


nanopi3:/ $ ethtool -i eth1
driver: r8125
version: 9.010.01-NAPI
firmware-version: 
expansion-rom-version: 
bus-info: 0003:31:00.0
supports-statistics: yes
supports-test: no
supports-eeprom-access: no
supports-register-dump: yes
supports-priv-flags: no

ethtool -S eth1

查看网络使用情况统计。它可以显示传输的字节数、接收的字节数、错误数等


nanopi3:/ $ ethtool -S eth1
NIC statistics:
     tx_packets: 486458
     rx_packets: 126697252
     tx_errors: 0
     rx_errors: 0
     rx_missed: 0
     align_errors: 0
     tx_single_collisions: 0
     tx_multi_collisions: 0
     unicast: 126696104
     broadcast: 1087
     multicast: 61
     tx_aborted: 0
     tx_underrun: 0
     tx_octets: 570388772
     rx_octets: 192055888071
     rx_multicast64: 0
     tx_unicast64: 486391
     tx_broadcast64: 39
     tx_multicast64: 28
     tx_pause_on: 0
     tx_pause_off: 0
     tx_pause_all: 0
     tx_deferred: 0
     tx_late_collision: 0
     tx_all_collision: 0
     tx_aborted32: 0
     align_errors32: 0
     rx_frame_too_long: 0
     rx_runt: 0
     rx_pause_on: 0
     rx_pause_off: 0
     rx_pause_all: 0
     rx_unknown_opcode: 0
     rx_mac_error: 0
     tx_underrun32: 0
     rx_mac_missed: 5916
     rx_tcam_dropped: 0
     tdu: 0
     rdu: 0

CPU 性能模式

device/rockchip/rk3588/nanopi6/init.rk3588.rc


    # gpu performance
    write sys/class/devfreq/fb000000.gpu/governor performance

    # cpu performance
    write /sys/devices/system/cpu/cpufreq/policy0/scaling_governor performance
    write /sys/devices/system/cpu/cpufreq/policy4/scaling_governor performance
    write /sys/devices/system/cpu/cpufreq/policy6/scaling_governor performance

    # ddr performance
    write /sys/class/devfreq/dmc/governor performance

    # npu
    write /sys/class/devfreq/fdab0000.npu/governor performance

CPU 绑定大核

device/rockchip/rk3588/nanopi6/init.rk3588.rc

 
    write /dev/cpuset/foreground/cpus 4-7
    write /dev/cpuset/foreground/boost/cpus 4-7
    write /dev/cpuset/background/cpus 0-7
    write /dev/cpuset/system-background/cpus 0-7
    write /dev/cpuset/top-app/cpus 0-7
    write /dev/cpuset/top-app/cpus 4-7