This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM625: Camera CSI performance between SDK Version: 08.06.00.42 vs 09.02.01.10

Part Number: AM625

Tool/software:

Hi Team,

We have a working ar1335 camera module integrated on TI-AM625 Starter Kit with processor SDK Version: 08.06.00.42. Now we have ported the camera driver to processor SDK Version: 09.02.01.10.

In
SDK_08.06.00.42 it takes 400ms to capture and store 4192x3120 resolution image into a yuv format. But the same setup and command take 700ms to capture and store 4192x3120 resolution image into a yuv format.

Is there any way to solve the latency issue in SDK_09.02.01.10 ?


Logs : SDK_08.06.00.42
root@am62xx-evm:~# media-ctl -d /dev/media0 --set-v4l2 '"ar1335 4-0042":0[fmt:UYVY8_1X16/4192x3120 field:none]'
[  134.586980] Skipping Previous mode set ...
root@am62xx-evm:~# gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw, width=4192, height=3120, format=UYVY ! multifilesink location=files_%d.yuv max-files=8
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
[  148.263931]  mcu_cam_stream_on 1626
^Chandling interrupt.
Interrupt: Stopping pipeline ...
Execution ended after 0:00:06.831019090
Setting pipeline to NULL ...
Freeing pipeline ...
root@am62xx-evm:~#
root@am62xx-evm:~# ls -l files_* --full-time

-rw-r--r-- 1 root root 26158080 2023-08-10 13:02:32.256000000 +0000 files_2.yuv
-rw-r--r-- 1 root root 26158080 2023-08-10 13:02:32.672000000 +0000 files_3.yuv
-rw-r--r-- 1 root root 26158080 2023-08-10 13:02:33.088000000 +0000 files_4.yuv
-rw-r--r-- 1 root root 26158080 2023-08-10 13:02:33.508000000 +0000 files_5.yuv
-rw-r--r-- 1 root root 26158080 2023-08-10 13:02:33.928000000 +0000 files_6.yuv
-rw-r--r-- 1 root root 26158080 2023-08-10 13:02:34.348000000 +0000 files_7.yuv
-rw-r--r-- 1 root root 26158080 2023-08-10 13:02:34.932000000 +0000 files_8.yuv
-rw-r--r-- 1 root root 26158080 2023-08-10 13:02:39.800000000 +0000 files_9.yuv

Logs : SDK_09.02.01.10
root@am62xx-evm:~# media-ctl -d /dev/media0 --set-v4l2 '"ar1335 4-0042":0[fmt:UYVY8_1X16/4192x3120 field:none]'
[   82.482839] Skipping Previous mode set ...
root@am62xx-evm:~# gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw, width=4192, height=3120, format=UYVY ! multifilesink location=file_%d.yuv max-files=8
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
[  137.499010]  mcu_cam_stream_on 1626
Redistribute latency...
^Chandling interrupt.
Interrupt: Stopping pipeline ...
Execution ended after 0:00:08.442799500
Setting pipeline to NULL ...
Freeing pipeline ...
root@am62xx-evm:~# ls -l file_* --full-time

-rw-r--r-- 1 root root 26158080 1970-01-01 00:02:24.864000000 +0000 file_1.yuv
-rw-r--r-- 1 root root 26158080 1970-01-01 00:02:25.604000000 +0000 file_2.yuv
-rw-r--r-- 1 root root 26158080 1970-01-01 00:02:26.328000000 +0000 file_3.yuv
-rw-r--r-- 1 root root 26158080 1970-01-01 00:02:27.060000000 +0000 file_4.yuv
-rw-r--r-- 1 root root 26158080 1970-01-01 00:02:27.804000000 +0000 file_5.yuv
-rw-r--r-- 1 root root 26158080 1970-01-01 00:02:30.060000000 +0000 file_6.yuv
-rw-r--r-- 1 root root 26158080 1970-01-01 00:02:30.812000000 +0000 file_7.yuv
-rw-r--r-- 1 root root 26158080 1970-01-01 00:02:31.560000000 +0000 file_8.yuv

Regards,
Ajith Kumaresh S.

  • Hello Ajith,

    Can you run yavta to capture multiple frames in both releases and see if the latency is the same? For example, yavta -s 4192x3120 -f UYVY /dev/video0 -c10 -Fframe-#.yuv.

    Thanks,

    Jianzhong

  • Hi Jianzhong Xu,

    Thanks for the reply.

    I have validated the image capture time with the above mentioned yavta tool.
    I could see the latency between SDK8 and SDK9.

    SDK8 Logs

    root@am62xx-evm:~# yavta -s 4192x3120 -f UYVY /dev/video0 -c10 -F frame*.yuv
    Device /dev/video0 opened.
    Device `j721e-csi2rx' on `platform:30102000.ticsi2rx' is a video output (without mplanes) device.
    Video format set: UYVY (59565955) 4192x3120 (stride 8384) field none buffer size 26158080
    Video format: UYVY (59565955) 4192x3120 (stride 8384) field none buffer size 26158080
    8 buffers requested.
    length: 26158080 offset: 0 timestamp type/source: mono/EoF
    Buffer 0/0 mapped at address 0xffff84a9b000.
    length: 26158080 offset: 26161152 timestamp type/source: mono/EoF
    Buffer 1/0 mapped at address 0xffff831a8000.
    length: 26158080 offset: 52322304 timestamp type/source: mono/EoF
    Buffer 2/0 mapped at address 0xffff818b5000.
    length: 26158080 offset: 78483456 timestamp type/source: mono/EoF
    Buffer 3/0 mapped at address 0xffff7ffc2000.
    length: 26158080 offset: 104644608 timestamp type/source: mono/EoF
    Buffer 4/0 mapped at address 0xffff7e6cf000.
    length: 26158080 offset: 130805760 timestamp type/source: mono/EoF
    Buffer 5/0 mapped at address 0xffff7cddc000.
    length: 26158080 offset: 156966912 timestamp type/source: mono/EoF
    Buffer 6/0 mapped at address 0xffff7b4e9000.
    length: 26158080 offset: 183128064 timestamp type/source: mono/EoF
    Buffer 7/0 mapped at address 0xffff79bf6000.
    [   99.160676]  mcu_cam_stream_on 1626
    0 (0) [-] any 0 26158080 B 99.139568 99.139632 -28571.429 fps ts mono/EoF
    1 (1) [-] any 1 26158080 B 99.306774 99.580222 5.981 fps ts mono/EoF
    2 (2) [-] any 2 26158080 B 99.401025 100.048841 10.610 fps ts mono/EoF
    3 (3) [-] any 3 26158080 B 99.495280 100.470180 10.610 fps ts mono/EoF
    4 (4) [-] any 4 26158080 B 99.589521 100.899762 10.611 fps ts mono/EoF
    5 (5) [-] any 5 26158080 B 99.683781 101.344888 10.609 fps ts mono/EoF
    6 (6) [-] any 6 26158080 B 99.778026 101.788921 10.611 fps ts mono/EoF
    7 (7) [-] any 7 26158080 B 99.872275 102.235679 10.610 fps ts mono/EoF
    8 (0) [-] any 8 26158080 B 99.966524 102.677066 10.610 fps ts mono/EoF
    9 (1) [-] any 9 26158080 B 100.155042 103.122594 5.305 fps ts mono/EoF
    Captured 10 frames in 3.982990 seconds (2.510676 fps, 65674469.516961 B/s).
    8 buffers released.
    root@am62xx-evm:~# ls -l frame-00000* --full-time
    -rw-r--r-- 1 root root 26158080 2023-08-10 13:01:42.320000000 +0000 frame-000000.bin
    -rw-r--r-- 1 root root 26158080 2023-08-10 13:01:42.760000000 +0000 frame-000001.bin
    -rw-r--r-- 1 root root 26158080 2023-08-10 13:01:43.228000000 +0000 frame-000002.bin
    -rw-r--r-- 1 root root 26158080 2023-08-10 13:01:43.648000000 +0000 frame-000003.bin
    -rw-r--r-- 1 root root 26158080 2023-08-10 13:01:44.080000000 +0000 frame-000004.bin
    -rw-r--r-- 1 root root 26158080 2023-08-10 13:01:44.524000000 +0000 frame-000005.bin
    -rw-r--r-- 1 root root 26158080 2023-08-10 13:01:44.968000000 +0000 frame-000006.bin
    -rw-r--r-- 1 root root 26158080 2023-08-10 13:01:45.416000000 +0000 frame-000007.bin
    -rw-r--r-- 1 root root 26158080 2023-08-10 13:01:45.856000000 +0000 frame-000008.bin
    -rw-r--r-- 1 root root 26158080 2023-08-10 13:01:46.300000000 +0000 frame-000009.bin

    SDK9 Logs
    root@am62xx-evm:~# yavta -s 4192x3120 -f UYVY /dev/video0 -c10 -F frame*.yuv                                                                 
    Device /dev/video0 opened.
    Device `j721e-csi2rx' on `platform:30102000.ticsi2rx' (driver 'j721e-csi2rx') supports video, capture, without mplanes.
    Video format set: UYVY (59565955) 4192x3120 (stride 8384) field none buffer size 26158080
    Video format: UYVY (59565955) 4192x3120 (stride 8384) field none buffer size 26158080
    [  457.968963] cma: cma_alloc: linux,cma: alloc failed, req-size: 6387 pages, ret: -12
    [  457.976669] ti-udma 485c0100.dma-controller: dma alloc of size 26161152 failed
    5 buffers requested.
    length: 26158080 offset: 0 timestamp type/source: mono/EoF
    Buffer 0/0 mapped at address 0xffffacdfd000.
    length: 26158080 offset: 26161152 timestamp type/source: mono/EoF
    root@am62xx-evm:~# yavta -s 4192x3120 -f UYVY /dev/video0 -c10 -F frame#.yuv                                                                 
    Device /dev/video0 opened.
    Device `j721e-csi2rx' on `platform:30102000.ticsi2rx' (driver 'j721e-csi2rx') supports video, capture, without mplanes.
    Video format set: UYVY (59565955) 4192x3120 (stride 8384) field none buffer size 26158080
    Video format: UYVY (59565955) 4192x3120 (stride 8384) field none buffer size 26158080
    [  523.852881] cma: cma_alloc: linux,cma: alloc failed, req-size: 6387 pages, ret: -12
    [  523.860582] ti-udma 485c0100.dma-controller: dma alloc of size 26161152 failed
    5 buffers requested.
    length: 26158080 offset: 0 timestamp type/source: mono/EoF
    Buffer 0/0 mapped at address 0xffff8fe1d000.
    length: 26158080 offset: 26161152 timestamp type/source: mono/EoF
    Buffer 1/0 mapped at address 0xffff8e52a000.
    length: 26158080 offset: 52322304 timestamp type/source: mono/EoF
    Buffer 2/0 mapped at address 0xffff8cc37000.
    length: 26158080 offset: 78483456 timestamp type/source: mono/EoF
    Buffer 3/0 mapped at address 0xffff8b344000.
    length: 26158080 offset: 104644608 timestamp type/source: mono/EoF
    Buffer 4/0 mapped at address 0xffff89a51000.
    [  524.347650]  mcu_cam_stream_on 1626
    0 (0) [-] any 0 26158080 B 523.804360 524.191975 -2.580 fps ts mono/EoF
    1 (1) [-] any 1 26158080 B 523.898618 524.946061 10.609 fps ts mono/EoF
    2 (2) [-] any 2 26158080 B 523.992834 525.716844 10.614 fps ts mono/EoF
    3 (3) [-] any 3 26158080 B 524.087081 526.478839 10.610 fps ts mono/EoF
    4 (4) [-] any 4 26158080 B 524.181351 527.233339 10.608 fps ts mono/EoF
    5 (0) [-] any 5 26158080 B 525.123870 527.989947 1.061 fps ts mono/EoF
    6 (1) [-] any 6 26158080 B 525.877874 528.760930 1.326 fps ts mono/EoF
    7 (2) [-] any 7 26158080 B 526.631891 529.523298 1.326 fps ts mono/EoF
    8 (3) [-] any 8 26158080 B 527.385913 530.277847 1.326 fps ts mono/EoF
    9 (4) [-] any 9 26158080 B 528.139930 531.011986 1.326 fps ts mono/EoF
    Captured 10 frames in 6.820053 seconds (1.466264 fps, 38354657.329054 B/s).
    5 buffers released.
    root@am62xx-evm:~# ls -l frame-00000* --full-time
    -rw-r--r-- 1 root root 26158080 1970-01-01 00:08:51.064000000 +0000 frame-000000.bin
    -rw-r--r-- 1 root root 26158080 1970-01-01 00:08:51.816000000 +0000 frame-000001.bin
    -rw-r--r-- 1 root root 26158080 1970-01-01 00:08:52.588000000 +0000 frame-000002.bin
    -rw-r--r-- 1 root root 26158080 1970-01-01 00:08:53.348000000 +0000 frame-000003.bin
    -rw-r--r-- 1 root root 26158080 1970-01-01 00:08:54.104000000 +0000 frame-000004.bin
    -rw-r--r-- 1 root root 26158080 1970-01-01 00:08:54.860000000 +0000 frame-000005.bin
    -rw-r--r-- 1 root root 26158080 1970-01-01 00:08:55.632000000 +0000 frame-000006.bin
    -rw-r--r-- 1 root root 26158080 1970-01-01 00:08:56.392000000 +0000 frame-000007.bin
    -rw-r--r-- 1 root root 26158080 1970-01-01 00:08:57.148000000 +0000 frame-000008.bin
    -rw-r--r-- 1 root root 26158080 1970-01-01 00:08:57.884000000 +0000 frame-000009.bin


    Regards,
    Ajith Kumaresh S.

  • Thanks for doing the test. Looks like SDK 9.2 has degradation in streaming throughput.

    Can you try something like below (streaming from the sensor but not writing to a file) in both releases?

    v4l2-ctl --verbose -d /dev/video3 --set-fmt-video=width=640,height=480,pixelformat='RGGB' --stream-mmap=10 --stream-count=20

    This should tell us whether the fps degradation is due to CSI receiver or file I/O.