Default RTSP Streaming App for Luckfox Pico Mini B on Startup

  • pdoanthuannb96 wrote: 2024-10-24 3:57 What is the default application that runs with the camera on my Luckfox Pico Mini B when it boots up, specifically for streaming video over RTSP? Any recommendations or examples would be helpful!
    Hello, it should be this one programme luckfox-pico/media/common_algorithm, if you need more examples you can refer to this section of our wiki: https://wiki.luckfox.com/zh/Luckfox-Pico/Luckfox-Pico- RV1103/Luckfox-Pico-RKNN-Test. and this one https://wiki.luckfox.com/zh/Luckfox-Pic ... PI-example
  • Alenwowo wrote: 2024-10-24 6:04
    pdoanthuannb96 wrote: 2024-10-24 3:57 What is the default application that runs with the camera on my Luckfox Pico Mini B when it boots up, specifically for streaming video over RTSP? Any recommendations or examples would be helpful!
    Hello, it should be this one programme luckfox-pico/media/common_algorithm, if you need more examples you can refer to this section of our wiki: https://wiki.luckfox.com/zh/Luckfox-Pico/Luckfox-Pico- RV1103/Luckfox-Pico-RKNN-Test. and this one https://wiki.luckfox.com/zh/Luckfox-Pic ... PI-example
    System: Luckfox Pico Mini B + SDcard (swapfile 1GB) + SC3336 camera.

    When I run the example from RKMPIhttps://wiki.luckfox.com/zh/Luckfox-Pic ... PI-example, RetinaFace + RTSP, I encounter an error:

    Code: Select all

    [root@luckfox root]# ./luckfox_pico_rtsp_retinaface
    Stop Application ...
    killall: rkipc: no process killed
    killall: udhcpc: no process killed
    rkipc exit
    ls: /oem/usr/etc/init.d/S??*: No such file or directory
    E RKNN: failed to open model: ./model/retinaface.rknn
    rknn_init fail! ret=-1
    init rknn model success!
    rkaiq log level ff0
    ID: 0, sensor_name is m00_b_sc3336 4-0030, iqfiles is /etc/iqfiles
    rk_aiq_uapi2_sysctl_init/prepare succeed
    rk_aiq_uapi2_sysctl_start succeed
    rockit log path (null), log_size = 0, can use export rt_log_path=, export rt_log_size= change
    log_file = (nil)
    RTVersion        00:17:49-615 {dump              :064} ---------------------------------------------------------
    RTVersion        00:17:49-618 {dump              :065} rockit version: git-8cb4d25b8 Tue Feb 28 11:12:39 2023 +0800
    RTVersion        00:17:49-620 {dump              :066} rockit building: built- 2023-02-28 15:23:19
    RTVersion        00:17:49-620 {dump              :067} ---------------------------------------------------------
    (null)           00:17:49-621 {log_level_init    :203}
    
     please use echo name=level > /tmp/rt_log_level set log level
    	name: all cmpi mb sys vdec venc rgn vpss vgs tde avs wbc vo vi ai ao aenc adec
    	log_level: 0 1 2 3 4 5 6
    
    rockit default level 4, can use export rt_log_level=x, x=0,1,2,3,4,5,6 change
    (null)           00:17:49-622 {read_log_level    :093} text is all=4
    (null)           00:17:49-623 {read_log_level    :095} module is all, log_level is 4
    RTIsp3x          00:17:49-626 {ispInitDevice     :208} sensor name = m00_b_sc3336 4-0030
    RTIsp3x          00:17:49-627 {ispInitDevice     :211} sensor_index = 0
    (null)           00:17:49-628 {monitor_log_level :144} #Start monitor_log_level thread, arg:(nil)
    RTIsp3x          00:17:49-634 {ispInitDevice     :208} sensor name = m00_b_sc3336 4-0030
    RTIsp3x          00:17:49-636 {ispInitDevice     :211} sensor_index = 0
    [INFO  rtsp_demo.c:280:rtsp_new_demo] rtsp server demo starting on port 554
    [DEBUG rtsp_demo.c:480:rtsp_new_session] add session path: /live/0
    rtsp streamq_alloc size is 1753484
    vi_dev_init
    RKViDev          00:17:49-645 {vi_set_dev_attr   :440} VI_DEV_ATTR_S all parameter reserved
      === VI ATTRS INFO: ===
    	devId  :      0
    	chnId  :      0
    	buffcnt:      0
    	buffSize:     0
    	width:        0
    	height:       0
    	Maxwidth:     0
    	Maxwidth:     0
    	streaming:    0
    RKViChn          00:17:49-650 {prepareRuntime    :334} ---------------------------------------------------------
    RKViChn          00:17:49-650 {prepareRuntime    :336} vi version: 1.86, name:vvi
    RKViChn          00:17:49-650 {prepareRuntime    :337} rockit-ko version: vmpi:fb2eed2be49e
    RKViChn          00:17:49-651 {prepareRuntime    :338} rockit-ko building: -2023-02-09-11:04:49
    RKViChn          00:17:49-651 {prepareRuntime    :339} ---------------------------------------------------------
    RKViChn          00:17:49-651 {prepareRuntime    :358} mb pool create success, MBCnt= 2
    cmpi             00:17:49-652 {createRuntime     :546} [non-WRAP MODE]: buff size = 518400
    RTIsp3x          00:17:49-655 {ispInitDevice     :208} sensor name = m00_b_sc3336 4-0030
    RTIsp3x          00:17:49-656 {ispInitDevice     :211} sensor_index = 0
    RTDeviceV4L2     00:17:49-660 {open              :138} open video name(/dev/video11)
    RKViChn          00:17:49-661 {setFrameRate      :1153} [vi] dev(0) ch(0) illegal param s32SrcFrameRate(0) s32DstFrameRate(0)
    RTDeviceV4L2     00:17:49-662 {ispCameraInfo     :549} current device:/dev/video11 isn't compatible(cap:0x84201000) device,memoryType:4, retry:0
    RTDeviceV4L2     00:17:49-663 {ispInitFormat     :726} ioctl VIDIOC_S_FMT OK
    RKViChn          00:17:49-664 {start             :813} =========== vi Start startRuntime ===========
    RTDeviceV4L2     00:17:49-665 {ispStreamOn       :440} do ispStreamOn start
    RTDeviceV4L2     00:17:49-686 {ispStreamOn       :493} do ispStreamOn done
    test_vpss_init
    === 0 ===
    rga_api version 1.9.1_[0]
    ====RK_MPI_SYS_Bind vi0 to vpss0====
    test_venc_init
    MpiAdapterEncode 00:17:49-708 {ma_encode_create  :1653} ringbuf buf_size 520192
    === 1 ===
    cmpi             00:17:49-768 {mb_get_buffer_by_i:422} allocated buffer(this=0x325630, data=(nil), size=0, id=-1)
    Segmentation fault (core dumped)
    [root@luckfox root]# free -h
                  total        used        free      shared  buff/cache   available
    Mem:          33.1M       11.6M        5.9M      216.0K       15.6M       18.4M
    Swap:       1024.0M        1.8M     1022.2M
    [root@luckfox root]#

    dmesg log:

    Code: Select all

    [ 1421.972154] stream_cif_mipi_id0: s_power 1, entity use_count 1
    [ 1421.973914] stream_cif_mipi_id0: s_power 0, entity use_count 0
    [ 1422.153442] stream_cif_mipi_id0: s_power 1, entity use_count 1
    [ 1422.154136] stream_cif_mipi_id0: open video, entity use_countt 2
    [ 1422.154263] stream_cif_mipi_id1: open video, entity use_countt 1
    [ 1422.169342] rkisp rkisp-vir0: first params buf queue
    [ 1422.182479] vsys dev open 26
    [ 1422.222203] rkisp queue buf done
    [ 1422.225122] rkisp_hw ffa00000.rkisp: set isp clk = 198000000Hz
    [ 1422.225175] rkcif-mipi-lvds: sditf_reinit_mode, mode->rdbk_mode 0, mode->name rkisp-vir0, link_mode 1
    [ 1422.226979] rkcif-mipi-lvds: stream[0] start streaming
    [ 1422.227160] rockchip-mipi-csi2 ffa20000.mipi-csi2: stream on, src_sd: 9b3bdcc7, sd_name:rockchip-csi2-dphy0
    [ 1422.227174] rockchip-mipi-csi2 ffa20000.mipi-csi2: stream ON
    [ 1422.227227] rockchip-csi2-dphy0: dphy0, data_rate_mbps 506
    [ 1422.227257] rockchip-csi2-dphy csi2-dphy0: csi2_dphy_s_stream stream on:1, dphy0
    [ 1422.227267] rockchip-csi2-dphy csi2-dphy0: csi2_dphy_s_stream stream on:1, dphy0
    [ 1422.261119] create vpss node = 1036800
    [ 1422.268121] mpp_vcodec: 44: num_chan = 0
    [ 1422.268266] mpp_vcodec: 368: attr->max_width = 720, attr->max_height = 480
    [ 1422.270259] mpp_vcodec: 103: chan_entry->handle 715e3e2c, enc 715e3e2c
    [ 1422.271589] 755: MPP_ENC_SET_CFG in
    [ 1422.271625] 524: MPP_ENC_SET_RC_CFG bps 3888000 [3645000 : 4131000] fps [30:30] gop 60
    [ 1422.271640] 329: MPP_ENC_SET_PREP_CFG w:h [720:480] stride [2160:480]
    [ 1422.271654] 271: send header for set cfg change input/format
    [ 1422.271870] 755: MPP_ENC_SET_CFG in
    [ 1422.271889] 524: MPP_ENC_SET_RC_CFG bps 10240000 [9600000 : 10880000] fps [30:30] gop 1
    [ 1422.271902] 271: send header for set cfg change rc_mode/fps/gop
    [ 1422.272024] 755: MPP_ENC_SET_CFG in
    [ 1422.272041] 524: MPP_ENC_SET_RC_CFG bps 10240000 [9600000 : 10880000] fps [30:30] gop 1
    [ 1422.272052] 271: send header for set cfg change rc_mode/fps/gop
    [ 1424.565136] rga_job: [tgid:1005 pid:1013] destroy request[4544] when the user exits
    [ 1424.565150] rga_job: [tgid:1005 pid:1013] destroy request[4545] when the user exits
    [ 1424.565176] rga_job: [tgid:1005 pid:1013] destroy request[4546] when the user exits
    [ 1424.565188] rga_job: [tgid:1005 pid:1013] destroy request[4547] when the user exits
    [ 1424.565198] rga_job: [tgid:1005 pid:1013] destroy request[4548] when the user exits
    [ 1424.603142] rkcif-mipi-lvds: stream[0] start stopping, total mode 0x2, cur 0x2
    [ 1424.642488] rockchip-mipi-csi2 ffa20000.mipi-csi2: stream off, src_sd: 9b3bdcc7, sd_name:rockchip-csi2-dphy0
    [ 1424.642555] rockchip-mipi-csi2 ffa20000.mipi-csi2: stream OFF
    [ 1424.643713] rockchip-csi2-dphy csi2-dphy0: csi2_dphy_s_stream_stop stream stop, dphy0
    [ 1424.643762] rockchip-csi2-dphy csi2-dphy0: csi2_dphy_s_stream stream on:0, dphy0
    [ 1424.643825] rockchip-csi2-dphy csi2-dphy0: csi2_dphy_s_stream stream on:0, dphy0
    [ 1424.644058] rkcif-mipi-lvds: stream[0] stopping finished, dma_en 0x0
    [ 1424.645033] rockit isp stream off
    [ 1424.647378] stream_cif_mipi_id1: close video, entity use_count 0
    [ 1424.647544] stream_cif_mipi_id0: close video, entity use_count 1
    [ 1424.648209] stream_cif_mipi_id0: s_power 0, entity use_count 0
    And system memory:

    Code: Select all

    [root@luckfox root]# free -h
                  total        used        free      shared  buff/cache   available
    Mem:          33.1M       11.6M        5.9M      204.0K       15.6M       18.5M
    Swap:       1024.0M        1.8M     1022.2M
    [root@luckfox root]#
  • Follow the note in RKMPI example: "Before running the demo, execute RkLunch-stop.sh to stop the background program rkicp, which starts by default on Luckfox Pico and occupies the camera"

    I want to know if the rkipc app is running by default. This is the image I captured with the rkipc app, and it was recorded using VLC:Image

    My goal is to get the source code of this app so I can modify it for my human detection task.
    Last edited by pdoanthuannb96 on 2024-10-24 9:16, edited 2 times in total.
  • pdoanthuannb96 wrote: 2024-10-24 9:09 Follow the note in RKMPI example: "Before running the demo, execute RkLunch-stop.sh to stop the background program rkicp, which starts by default on Luckfox Pico and occupies the camera"

    I want to know if the rkipc app is running by default. This is the image I captured with the rkipc app, and it was recorded using VLC:Image

    My goal is to get the source code of this app so I can modify it for my human detection task.
    Rkipc is run by default, when you open the webcam via lukfox-config. You need to close rkipc before running the rkmpi example, but this error you report may be due to only uploading the executable when executing the program without packaging and uploading the model's dynamic libraries along with it Can't find the model and the segment error. Also I would like to ask you to post your current kernel version, use uname -a to check it.
  • Alenwowo wrote: 2024-10-24 9:31
    pdoanthuannb96 wrote: 2024-10-24 9:09 Follow the note in RKMPI example: "Before running the demo, execute RkLunch-stop.sh to stop the background program rkicp, which starts by default on Luckfox Pico and occupies the camera"

    I want to know if the rkipc app is running by default. This is the image I captured with the rkipc app, and it was recorded using VLC:Image

    My goal is to get the source code of this app so I can modify it for my human detection task.
    Rkipc is run by default, when you open the webcam via lukfox-config. You need to close rkipc before running the rkmpi example, but this error you report may be due to only uploading the executable when executing the program without packaging and uploading the model's dynamic libraries along with it Can't find the model and the segment error. Also I would like to ask you to post your current kernel version, use uname -a to check it.
    The current kernel version:

    Code: Select all

    [root@luckfox root]# uname -a
    Linux luckfox 5.10.110 #1 Wed Jul 10 13:57:24 CST 2024 armv7l GNU/Linux
    After run the build.sh

    Code: Select all

    (base) pdoanthuannb96@gcp:~/luckfox_pico_rkmpi_example/build$ ls -la
    total 2536
    drwxrwxr-x  4 pdoanthuannb96 pdoanthuannb96    4096 Oct 24 08:22 .
    drwxrwxr-x 10 pdoanthuannb96 pdoanthuannb96    4096 Oct 24 08:22 ..
    drwxrwxr-x  3 pdoanthuannb96 pdoanthuannb96    4096 Oct 24 08:22 3rdparty.out
    -rw-rw-r--  1 pdoanthuannb96 pdoanthuannb96   16232 Oct 24 08:22 CMakeCache.txt
    drwxrwxr-x  5 pdoanthuannb96 pdoanthuannb96    4096 Oct 24 08:22 CMakeFiles
    -rw-rw-r--  1 pdoanthuannb96 pdoanthuannb96   10155 Oct 24 08:22 Makefile
    -rw-rw-r--  1 pdoanthuannb96 pdoanthuannb96    5298 Oct 24 08:22 cmake_install.cmake
    -rw-rw-r--  1 pdoanthuannb96 pdoanthuannb96     442 Oct 24 08:22 install_manifest.txt
    -rwxrwxr-x  1 pdoanthuannb96 pdoanthuannb96 2538004 Oct 24 08:22 luckfox_pico_rtsp_retinaface
    (base) pdoanthuannb96@gcp:~/luckfox_pico_rkmpi_example/build$
    Which file do I need to package and push to the Luckfox Pico Board?

    Note: The log I provided before is from running only the executable file pushed to the board
  • pdoanthuannb96 wrote: 2024-10-24 9:55
    Alenwowo wrote: 2024-10-24 9:31
    pdoanthuannb96 wrote: 2024-10-24 9:09 Follow the note in RKMPI example: "Before running the demo, execute RkLunch-stop.sh to stop the background program rkicp, which starts by default on Luckfox Pico and occupies the camera"

    I want to know if the rkipc app is running by default. This is the image I captured with the rkipc app, and it was recorded using VLC:Image

    My goal is to get the source code of this app so I can modify it for my human detection task.
    Rkipc is run by default, when you open the webcam via lukfox-config. You need to close rkipc before running the rkmpi example, but this error you report may be due to only uploading the executable when executing the program without packaging and uploading the model's dynamic libraries along with it Can't find the model and the segment error. Also I would like to ask you to post your current kernel version, use uname -a to check it.
    The current kernel version:

    Code: Select all

    [root@luckfox root]# uname -a
    Linux luckfox 5.10.110 #1 Wed Jul 10 13:57:24 CST 2024 armv7l GNU/Linux
    After run the build.sh

    Code: Select all

    (base) pdoanthuannb96@gcp:~/luckfox_pico_rkmpi_example/build$ ls -la
    total 2536
    drwxrwxr-x  4 pdoanthuannb96 pdoanthuannb96    4096 Oct 24 08:22 .
    drwxrwxr-x 10 pdoanthuannb96 pdoanthuannb96    4096 Oct 24 08:22 ..
    drwxrwxr-x  3 pdoanthuannb96 pdoanthuannb96    4096 Oct 24 08:22 3rdparty.out
    -rw-rw-r--  1 pdoanthuannb96 pdoanthuannb96   16232 Oct 24 08:22 CMakeCache.txt
    drwxrwxr-x  5 pdoanthuannb96 pdoanthuannb96    4096 Oct 24 08:22 CMakeFiles
    -rw-rw-r--  1 pdoanthuannb96 pdoanthuannb96   10155 Oct 24 08:22 Makefile
    -rw-rw-r--  1 pdoanthuannb96 pdoanthuannb96    5298 Oct 24 08:22 cmake_install.cmake
    -rw-rw-r--  1 pdoanthuannb96 pdoanthuannb96     442 Oct 24 08:22 install_manifest.txt
    -rwxrwxr-x  1 pdoanthuannb96 pdoanthuannb96 2538004 Oct 24 08:22 luckfox_pico_rtsp_retinaface
    (base) pdoanthuannb96@gcp:~/luckfox_pico_rkmpi_example/build$
    Which file do I need to package and push to the Luckfox Pico Board?

    Note: The log I provided before is from running only the executable file pushed to the board
    Mate can seriously check out the README: https://github.com/LuckfoxTECH/luckfox_ ... pi_example. It should just execute build.sh and then have the folder in install and upload the whole folder to dev!