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.

AM5728: Camera captures only half screen

Part Number: AM5728


Hello,

I have a custom board based on TI's AM5728 EVM. I am using the latest Linux PSDK 6.03 on it. I have ported the OV5640 Camera on the custom board. 

I am using the same driver code which is present in Linux 6.03 PSDK. Path for the driver is -  

~./ti-processor-sdk-linux-am57xx-evm-06.03.00.106/board-support/linux-4.19.94+gitAUTOINC+be5389fd85-gbe5389fd85/drivers/media/i2c/ov5640.c

PROBLEM -

I am trying to run yavta test and capture the stream in a file. When I try to play the file on my PC using ffplaythe capture is coming only on half the screen. 

I am using the following command to capture the stream -

For 640x480 - 

root@am57xx-evm:~# yavta -c20 -F640x480.yuv -fYUYV -s640x480 /dev/video1                                                                                                                                   
Device /dev/video1 opened.

Device `vip' on `platform:vip2:vin3a:stream0' is a video output (without mplanes) device.
Video format set: YUYV (56595559) 640x480 (stride 1280) field none buffer size 614400
Video format: YUYV (56595559) 640x480 (stride 1280) field none buffer size 614400
8 buffers requested.

length: 614400 offset: 0 timestamp type/source: mono/EoF
Buffer 0/0 mapped at address 0xb6d63000.
length: 614400 offset: 614400 timestamp type/source: mono/EoF
Buffer 1/0 mapped at address 0xb6ccd000.
length: 614400 offset: 1228800 timestamp type/source: mono/EoF
Buffer 2/0 mapped at address 0xb6c37000.
length: 614400 offset: 1843200 timestamp type/source: mono/EoF
Buffer 3/0 mapped at address 0xb6ba1000.
length: 614400 offset: 2457600 timestamp type/source: mono/EoF
Buffer 4/0 mapped at address 0xb6b0b000.
length: 614400 offset: 3072000 timestamp type/source: mono/EoF
Buffer 5/0 mapped at address 0xb6a75000.
length: 614400 offset: 3686400 timestamp type/source: mono/EoF
Buffer 6/0 mapped at address 0xb69df000.
length: 614400 offset: 4300800 timestamp type/source: mono/EoF
Buffer 7/0 mapped at address 0xb6949000.

0 (0) [-] top 0 614400 B 45.774776 45.774803 23.268 fps ts mono/EoF
1 (1) [-] top 1 614400 B 45.808073 45.808094 30.033 fps ts mono/EoF
2 (2) [-] top 2 614400 B 45.841367 45.841386 30.035 fps ts mono/EoF
3 (3) [-] top 3 614400 B 45.874663 45.874680 30.034 fps ts mono/EoF
4 (4) [-] top 4 614400 B 45.907958 45.908110 30.035 fps ts mono/EoF
5 (5) [-] top 5 614400 B 45.941254 45.941272 30.034 fps ts mono/EoF
6 (6) [-] top 6 614400 B 45.974550 45.974568 30.034 fps ts mono/EoF
7 (7) [-] top 7 614400 B 46.007846 46.007865 30.034 fps ts mono/EoF
8 (0) [-] top 8 614400 B 46.041143 46.041163 30.033 fps ts mono/EoF
9 (1) [-] top 9 614400 B 46.074438 46.074456 30.035 fps ts mono/EoF
10 (2) [-] top 10 614400 B 46.107734 46.107755 30.034 fps ts mono/EoF
11 (3) [-] top 11 614400 B 46.141031 46.141050 30.033 fps ts mono/EoF
12 (4) [-] top 12 614400 B 46.174326 46.174344 30.035 fps ts mono/EoF
13 (5) [-] top 13 614400 B 46.207622 46.207641 30.034 fps ts mono/EoF
14 (6) [-] top 14 614400 B 46.240917 46.240941 30.035 fps ts mono/EoF
15 (7) [-] top 15 614400 B 46.274214 46.274235 30.033 fps ts mono/EoF
16 (0) [-] top 16 614400 B 46.307509 46.307528 30.035 fps ts mono/EoF
17 (1) [-] top 17 614400 B 46.340805 46.340826 30.034 fps ts mono/EoF
18 (2) [-] top 18 614400 B 46.374101 46.374121 30.034 fps ts mono/EoF
19 (3) [-] top 19 614400 B 46.407396 46.407416 30.035 fps ts mono/EoF
Captured 20 frames in 0.675616 seconds (29.602601 fps, 18187837.843750 B/s).
8 buffers released.


For 1280x720 - 

root@am57xx-evm:~# yavta -c20 -F1280x720.yuv -fYUYV -s1280x720 /dev/video1
Device /dev/video1 opened.
Device `vip' on `platform:vip2:vin3a:stream0' is a video output (without mplanes) device.
Video format set: YUYV (56595559) 1280x720 (stride 2560) field none buffer size 1843200
Video format: YUYV (56595559) 1280x720 (stride 2560) field none buffer size 1843200
8 buffers requested.
length: 1843200 offset: 0 timestamp type/source: mono/EoF
Buffer 0/0 mapped at address 0xb6c28000.
length: 1843200 offset: 1843200 timestamp type/source: mono/EoF
Buffer 1/0 mapped at address 0xb6a66000.
length: 1843200 offset: 3686400 timestamp type/source: mono/EoF
Buffer 2/0 mapped at address 0xb68a4000.
length: 1843200 offset: 5529600 timestamp type/source: mono/EoF
Buffer 3/0 mapped at address 0xb66e2000.
length: 1843200 offset: 7372800 timestamp type/source: mono/EoF
Buffer 4/0 mapped at address 0xb6520000.
length: 1843200 offset: 9216000 timestamp type/source: mono/EoF
Buffer 5/0 mapped at address 0xb635e000.
length: 1843200 offset: 11059200 timestamp type/source: mono/EoF
Buffer 6/0 mapped at address 0xb619c000.
length: 1843200 offset: 12902400 timestamp type/source: mono/EoF
Buffer 7/0 mapped at address 0xb5fda000.

0 (0) [-] top 0 1843200 B 226.492738 226.492790 16.974 fps ts mono/EoF
1 (1) [-] top 1 1843200 B 226.525681 226.564673 30.355 fps ts mono/EoF
2 (2) [-] top 2 1843200 B 226.558626 226.630222 30.354 fps ts mono/EoF
3 (3) [-] top 3 1843200 B 226.591569 226.696956 30.355 fps ts mono/EoF
4 (4) [-] top 4 1843200 B 226.624513 226.762544 30.355 fps ts mono/EoF
5 (5) [-] top 5 1843200 B 226.657455 226.828163 30.356 fps ts mono/EoF
6 (6) [-] top 6 1843200 B 226.690399 226.893689 30.355 fps ts mono/EoF
7 (7) [-] top 7 1843200 B 226.723343 226.959336 30.355 fps ts mono/EoF
8 (0) [-] top 8 1843200 B 226.756285 227.024964 30.356 fps ts mono/EoF
9 (1) [-] top 9 1843200 B 226.789229 227.092647 30.355 fps ts mono/EoF
10 (2) [-] top 10 1843200 B 226.822172 227.158128 30.355 fps ts mono/EoF
11 (3) [-] top 12 1843200 B 226.888059 227.224741 15.178 fps ts mono/EoF
12 (4) [-] top 14 1843200 B 226.953945 227.290432 15.178 fps ts mono/EoF
13 (5) [-] top 16 1843200 B 227.019833 227.356140 15.177 fps ts mono/EoF
14 (6) [-] top 18 1843200 B 227.085717 227.421599 15.178 fps ts mono/EoF
15 (7) [-] top 20 1843200 B 227.151605 227.487328 15.177 fps ts mono/EoF
16 (0) [-] top 22 1843200 B 227.217492 227.552805 15.178 fps ts mono/EoF
17 (1) [-] top 24 1843200 B 227.283377 227.620463 15.178 fps ts mono/EoF
18 (2) [-] top 26 1843200 B 227.349265 227.686988 15.177 fps ts mono/EoF
19 (3) [-] top 28 1843200 B 227.415151 227.752682 15.178 fps ts mono/EoF

Captured 20 frames in 1.318859 seconds (15.164623 fps, 27951433.014256 B/s).
8 buffers released.

I am playing the files captured on my PC using ffplay utility. I have attached the capture file (.mp4) with this post.

The camera preview is coming only in half of the LCD screen at 1280x720 resolution. Also with 640x480 resolution, I am not getting any preview on LCD only lines.

How can I resolve this?

 

Regards,

Devashish

  • Hello TI Experts,

    This is a reminder that I am waiting for your reply on this post.

    Regards,

    Devashish

  • Devashish, 

    can you verify file size of the captured yuv? in the past, I had problems configuring ffplay to play UYUV. so can you try to use yuvplay at:

    https://github.com/IENT/YUView

    make sure to tell the play to play as UYVY interleaved YUV422 format. 

    regards

    Jian

  • Hi Jian,

    Thank you for following up on this.

    I would like to inform you that I have tried opening the camera preview and displaying it on LCD (using the dmabuftest utility), the preview is displayed only on half of the screen.

    I recaptured using yavta test today with 1280x720 resolution and 30 fps in YUYV format.

    root@am57xx-evm:~/cam_test# yavta -c40 -Fsample1.yuv -fYUYV -s1280x720 /dev/video1                                                                                                                         
    
    Device /dev/video1 opened.
    Device `vip' on `platform:vip2:vin3a:stream0' is a video output (without mplanes) device.
    Video format set: YUYV (56595559) 1280x720 (stride 2560) field none buffer size 1843200
    Video format: YUYV (56595559) 1280x720 (stride 2560) field none buffer size 1843200
    8 buffers requested.
    length: 1843200 offset: 0 timestamp type/source: mono/EoF
    Buffer 0/0 mapped at address 0xb6c12000.
    length: 1843200 offset: 1843200 timestamp type/source: mono/EoF
    Buffer 1/0 mapped at address 0xb6a50000.
    length: 1843200 offset: 3686400 timestamp type/source: mono/EoF
    Buffer 2/0 mapped at address 0xb688e000.
    length: 1843200 offset: 5529600 timestamp type/source: mono/EoF
    Buffer 3/0 mapped at address 0xb66cc000.
    length: 1843200 offset: 7372800 timestamp type/source: mono/EoF
    Buffer 4/0 mapped at address 0xb650a000.
    length: 1843200 offset: 9216000 timestamp type/source: mono/EoF
    Buffer 5/0 mapped at address 0xb6348000.
    length: 1843200 offset: 11059200 timestamp type/source: mono/EoF
    Buffer 6/0 mapped at address 0xb6186000.
    length: 1843200 offset: 12902400 timestamp type/source: mono/EoF
    Buffer 7/0 mapped at address 0xb5fc4000.
    
    0 (0) [-] top 0 1843200 B 1087.025301 1087.025355 22.658 fps ts mono/EoF
    1 (1) [-] top 1 1843200 B 1087.058242 1087.098384 30.357 fps ts mono/EoF
    2 (2) [-] top 2 1843200 B 1087.091183 1087.165118 30.357 fps ts mono/EoF
    3 (3) [-] top 3 1843200 B 1087.124125 1087.231512 30.356 fps ts mono/EoF
    4 (4) [-] top 4 1843200 B 1087.157067 1087.297881 30.356 fps ts mono/EoF
    5 (5) [-] top 5 1843200 B 1087.190024 1087.363899 30.343 fps ts mono/EoF
    6 (6) [-] top 6 1843200 B 1087.222952 1087.430122 30.369 fps ts mono/EoF
    7 (7) [-] top 7 1843200 B 1087.255892 1087.496025 30.358 fps ts mono/EoF
    8 (0) [-] top 8 1843200 B 1087.288836 1087.562878 30.355 fps ts mono/EoF
    9 (1) [-] top 9 1843200 B 1087.321776 1087.628846 30.358 fps ts mono/EoF
    10 (2) [-] top 10 1843200 B 1087.354719 1087.695473 30.355 fps ts mono/EoF
    11 (3) [-] top 12 1843200 B 1087.420601 1087.762181 15.179 fps ts mono/EoF
    12 (4) [-] top 14 1843200 B 1087.486485 1087.828179 15.178 fps ts mono/EoF
    13 (5) [-] top 16 1843200 B 1087.552368 1087.894752 15.178 fps ts mono/EoF
    14 (6) [-] top 18 1843200 B 1087.618251 1087.960779 15.178 fps ts mono/EoF
    15 (7) [-] top 20 1843200 B 1087.684136 1088.027186 15.178 fps ts mono/EoF
    16 (0) [-] top 22 1843200 B 1087.750024 1088.094516 15.177 fps ts mono/EoF
    17 (1) [-] top 24 1843200 B 1087.815903 1088.160420 15.179 fps ts mono/EoF
    18 (2) [-] top 26 1843200 B 1087.881787 1088.226269 15.178 fps ts mono/EoF
    19 (3) [-] top 28 1843200 B 1087.947670 1088.292362 15.178 fps ts mono/EoF
    20 (4) [-] top 30 1843200 B 1088.013554 1088.358179 15.178 fps ts mono/EoF
    21 (5) [-] top 32 1843200 B 1088.079438 1089.149554 15.178 fps ts mono/EoF
    22 (6) [-] top 34 1843200 B 1088.145321 1089.220372 15.178 fps ts mono/EoF
    23 (7) [-] top 36 1843200 B 1088.211203 1089.286971 15.179 fps ts mono/EoF
    24 (0) [-] top 38 1843200 B 1088.277087 1089.355976 15.178 fps ts mono/EoF
    25 (1) [-] top 40 1843200 B 1088.342971 1089.422398 15.178 fps ts mono/EoF
    26 (2) [-] top 42 1843200 B 1088.408858 1089.488696 15.178 fps ts mono/EoF
    27 (3) [-] top 44 1843200 B 1088.474742 1089.554552 15.178 fps ts mono/EoF
    28 (4) [-] top 68 1843200 B 1089.265341 1089.626955 1.265 fps ts mono/EoF
    29 (5) [-] top 70 1843200 B 1089.331224 1090.751766 15.178 fps ts mono/EoF
    30 (6) [-] top 72 1843200 B 1089.397109 1090.818468 15.178 fps ts mono/EoF
    31 (7) [-] top 74 1843200 B 1089.462993 1090.884393 15.178 fps ts mono/EoF
    32 (0) [-] top 76 1843200 B 1089.528876 1090.952297 15.178 fps ts mono/EoF
    33 (1) [-] top 78 1843200 B 1089.594760 1091.019044 15.178 fps ts mono/EoF
    34 (2) [-] top 80 1843200 B 1089.660643 1091.085204 15.178 fps ts mono/EoF
    35 (3) [-] top 82 1843200 B 1089.726526 1091.151559 15.178 fps ts mono/EoF
    36 (4) [-] top 117 1843200 B 1090.879489 1091.217890 0.867 fps ts mono/EoF
    37 (5) [-] top 119 1843200 B 1090.945373 1091.283772 15.178 fps ts mono/EoF
    38 (6) [-] top 121 1843200 B 1091.011256 1091.350101 15.178 fps ts mono/EoF
    39 (7) [-] top 123 1843200 B 1091.077139 1091.416142 15.178 fps ts mono/EoF
    Captured 40 frames in 4.434976 seconds (9.019213 fps, 16624213.662580 B/s).
    8 buffers released.

    The yavta test is capturing only the first 10 frames at 30 fps, rest all at 15 fps. Why is fps reduced while capturing? The fps value is set to 30 in the VIP driver.

    I tried to play the captured file using YUV player. I am getting the preview on split-screen with the player as well.

    I am playing the capture file in the "packed" format. With the packed format, the player doesn't give the option for interleaved.

    I am attaching my capture file here, in case you'd like to play it on your end.

    Download file from here - https://easyupload.io/jthd59

    Regards,

    Devashish

  • Hi Jian,

    This is a gentle reminder that I am awaiting your reply to this post.

    Regards,

    Devashish