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.

SK-AM62A-LP: SK-AM62A-LP-camera(KKC.A002.32)-the effect of taking photos

Part Number: SK-AM62A-LP

hi

we use sdk ti-processor-sdk-linux-am62axx-evm-08.06.00.45 to debug camera KKC.A002.32(no need to config ,output yuv 422 8bit ,built-in ISP)

but  the effect is too dark,we put the camera module connect to PC,it's ok,below is on PC's capture ,camera vendor said this is normal,at least 800lux

 operations:

use below code ,and mask i2c operation(camera KKC.A002.32 no need to config)

board-support/linux-kernel/drivers/media/i2c/imx219.c

(need to use media-ctl,and  need to modify imx219's code)

test environmental office with white lights

YUV:

media-ctrl -p is v4l2 yuv format

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
media-ctl -p
Media controller API version 5.10.168
Media device information
------------------------
driver j721e-csi2rx
model TI-CSI2RX
serial
bus info platform:30102000.ticsi2rx
hw revision 0x1
driver version 5.10.168
Device topology
- entity 1: 30102000.ticsi2rx (7 pads, 7 links, 1 route)
type V4L2 subdev subtype Unknown flags 0
device node name /dev/v4l-subdev0
routes:
0/0 -> 1/0 [ACTIVE]
pad0: Sink
[stream:0 fmt:YUYV8_1X16/1920x1080 field:none]
<- "cdns_csi2rx.30101000.csi-bridge":1 [ENABLED,IMMUTABLE]
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

use below comamd to capture

Fullscreen
1
2
3
4
5
media-ctl -V '"imx219 2-0010":0 [fmt:UYVY8_2X8/1920x1080 field: none]'
media-ctl -V '"30102000.ticsi2rx":0 [fmt:UYVY8_2X8/1920x1080 field: none]'
media-ctl -V '"cdns_csi2rx.30101000.csi-bridge":0 [fmt:UYVY8_2X8/1920x1080 field: none]'
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

yavta -s 1920x1080 -f UYVY /dev/video2 -c5 -Fframe-#.bin

 the effect is too dark

RAW

media-ctrl -p is raw

when we use v4l2 raw format(default ,no use media-ctl,and no need to modify imx219's code unuseless i2c's communication)

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
root@am62axx-evm:/opt/edgeai-gst-apps# media-ctl -p
Media controller API version 5.10.168
Media device information
------------------------
driver j721e-csi2rx
model TI-CSI2RX
serial
bus info platform:30102000.ticsi2rx
hw revision 0x1
driver version 5.10.168
Device topology
- entity 1: 30102000.ticsi2rx (7 pads, 7 links, 1 route)
type V4L2 subdev subtype Unknown flags 0
device node name /dev/v4l-subdev0
routes:
0/0 -> 1/0 [ACTIVE]
pad0: Sink
[stream:0 fmt:YUYV8_1X16/1920x1080 field:none]
<- "cdns_csi2rx.30101000.csi-bridge":1 [ENABLED,IMMUTABLE]
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

 the effect is too dark

From the phenomenon of taking photos,the first few pictures are all black,I take 5 picture,show below,there is a delay phenomenon

  • a-demo.zip

    capture yuv photo

    by the way,below ,what's the meaning  8 of UYVY8,2X8 of _2X8

    MEDIA_BUS_FMT_UYVY8_2X8

  • Hello Daiwei,

    what's the meaning  8 of UYVY8,2X8 of _2X8

    Please refer to https://www.kernel.org/doc/html/v4.15/media/uapi/v4l/subdev-formats.html#packed-yuv-formats.

    we put the camera module connect to PC,it's ok

    Was it a USB camera? If that's the case, you can use the USB camera on AM62A as well.

    use below code ,and mask i2c operation(camera KKC.A002.32 no need to config)

    Why did you use IMX219 driver for your KKC.A002.32? Do you have the driver for this camera?

    Regards,

    Jianzhong

  • not usb camera, soc+fpc+camra(isp+sensor),no have driver for this camera,so I use imx219.c

  • How did you connect your camera to the PC?

    I don't think you can use imx219.c for this camera. You'll need to have a driver for this specific camera.

  • I have already use imx219.c to get the picture,the problem should be camera's timiming

    yavta -s 1920x1080 -f UYVY /dev/video2 -c125 -Fframe-#.bin,maybe this command can tell soc the picture format by paramter -f UYVY 

    when I use no set format,like below, I see yavta.c default format is YUYV

    yavta -s 1920x1080 /dev/video2 -c125 -Fframe-#.bin ,after I get the picture,I use 7yuv ,must setting YUYV,the picture is normal

    and can you tell me  can I use yavta to check fps of capture? 

    yavta -c -Fcapture -s 1920x1080 -f UYVY /dev/video2

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    root@am62axx-evm:/opt/edgeai-gst-apps/jpeg# yavta -c -Fcapture -s 1920x1080 -f UYVY /dev/video2
    Device /dev/video2 opened.
    Device `j721e-csi2rx' on `platform:30102000.ticsi2rx' is a video output (without mplanes) device.
    Video format set: UYVY (59565955) 1920x1080 (stride 3840) field none buffer size 4147200
    Video format: UYVY (59565955) 1920x1080 (stride 3840) field none buffer size 4147200
    8 buffers requested.
    length: 4147200 offset: 0 timestamp type/source: mono/EoF
    Buffer 0/0 mapped at address 0xffff932be000.
    length: 4147200 offset: 4149248 timestamp type/source: mono/EoF
    Buffer 1/0 mapped at address 0xffff92ec9000.
    length: 4147200 offset: 8298496 timestamp type/source: mono/EoF
    Buffer 2/0 mapped at address 0xffff92ad4000.
    length: 4147200 offset: 12447744 timestamp type/source: mono/EoF
    Buffer 3/0 mapped at address 0xffff926df000.
    length: 4147200 offset: 16596992 timestamp type/source: mono/EoF
    Buffer 4/0 mapped at address 0xffff922ea000.
    length: 4147200 offset: 20746240 timestamp type/source: mono/EoF
    Buffer 5/0 mapped at address 0xffff91ef5000.
    length: 4147200 offset: 24895488 timestamp type/source: mono/EoF
    Buffer 6/0 mapped at address 0xffff91b00000.
    length: 4147200 offset: 29044736 timestamp type/source: mono/EoF
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • How did you connect your camera to the PC?

    PC+ convert machine + fpc+camra(isp+sensor)

  • Hi Daiwei,

    You can use v4l2 utility or GStreamer to measure the fps:

    v4l2-ctl -d /dev/video2 --set-fmt-video=width=<width>,height=<height>,pixelformat=<format> --stream-mmap

    gst-launch-1.0 -v v4l2src device=/dev/video2 io-mode=dmabuf ! video/x-raw, width=<width>, height=<height>, framerate=30/1, format=<format> ! fpsdisplaysink text-overlay=false

    Regards,

    Jianzhong

  • Please use "YUYV8_1X16", "UYVY8_1X16", etc, instead of 2X8, in your sensor driver. TI's CSI RX driver doesn't support 2X8 formats, because 2X8 is not a valid format for CSI.

  • thx,I got it

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    root@am62axx-evm:/opt/edgeai-gst-apps# v4l2-ctl -d /dev/video2 --set-fmt-video=width=1920,height=1080,pixelformat=UYVY --stream-mmap
    <<<<<<<<<<<<<<<
    <<<<<<<<<<<<<<<<< 30.00 fps
    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 30.00 fps
    <<<<<<<<<<<<<<<<<<<<<<<<<<<<< 30.00 fps
    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 30.00 fps
    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 30.00 fps
    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 30.00 fps
    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 30.00 fps
    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 30.00 fps
    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 30.00 fps
    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 30.00 fps
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • two question:

    1.So I must use MEDIA_BUS_FMT_UYVY8_1X16 instead of MEDIA_BUS_FMT_UYVY8_2X8,

    also other yuv format should use 8_1X16, like YUYV->MEDIA_BUS_FMT_YUYV8_1X16?

    2.when soc start to capture,when soc send stream on , probability 1 or 2 picture is green,Is there a way to avoid SOC here?

    example capture 120 

    yavta -s 1920x1080 -f UYVY /dev/video2 -c125 -Fframe-#.bin

    fist or second frame is green

  • 1.So I must use MEDIA_BUS_FMT_UYVY8_1X16 instead of MEDIA_BUS_FMT_UYVY8_2X8,

    also other yuv format should use 8_1X16, like YUYV->MEDIA_BUS_FMT_YUYV8_1X16?

    You can use other YUV formats as long as they are 8_1X16. Please refer here: https://git.ti.com/cgit/ti-linux-kernel/ti-linux-kernel/tree/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c?h=ti-linux-6.1.y#n138.

    when soc start to capture,when soc send stream on , probability 1 or 2 picture is green

    Does this happen every capture, or just after a power cycle?

  • Does this happen every capture, or just after a power cycle?

    every time when I send below caputure command to machine, and get the picture from machine ,then open picture to analysis  through 7yuv 

    yavta -s 1920x1080 -f UYVY /dev/video2 -c125 -Fframe-#.bin

  • Green pictures mean the camera data buffers have all 0's. That most likely means your camera wasn't streaming in time when you started yavta capture. You'll need to check your sensor driver.

  • ok,thank for your answer