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.

[FAQ] What are the common reasons V4L2 based applications fail to capture images from a probed CSI sensor?

Part Number: AM62A7
Other Parts Discussed in Thread: AM67,

Tool/software:

I connected my CSI camera to my board and the sensor has successfully probed, but I'm not able to capture images from the camera. None of "v4l2-ctl --stream-mmap", "yavta -c", or "gst-launch-1.0 v4l2src" can capture images. What could I have missed?

Other parts: AM62A3, , AM62A3-Q1, AM62A7-Q1, AM67, AM68AAM69A

  • There can be various reasons why the camera capture fails.

    1. Check the video device node

    Make sure the right video device node is used for capture. Refer to this FAQ:

    2. Check the link frequency 

    The link frequency for the sensor and D-PHY need to be configured properly. Reference: https://docs.kernel.org/driver-api/media/tx-rx.html#pixel-rate

      3. Configure the media graph 

      The most common miss causing capture failure is incorrect media graph configuration. After the sensor is probed, the entities and routes in the media graph need to be setup properly by the user space. For example, below is the media graph after an IMX219 sensor is probed on AM62A:

      root@am62axx-evm:~# media-ctl -p -d /dev/media0
      Media controller API version 6.6.32
       
      Media device information
      ------------------------
      driver          j721e-csi2rx
      model           TI-CSI2RX
      serial
      bus info        platform:30102000.ticsi2rx
      hw revision     0x1
      driver version  6.6.32
       
      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:UYVY8_1X16/640x480 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
                      <- "cdns_csi2rx.30101000.csi-bridge":1 [ENABLED,IMMUTABLE]
              pad1: Source
                      [stream:0 fmt:UYVY8_1X16/640x480 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
                      -> "30102000.ticsi2rx context 0":0 [ENABLED,IMMUTABLE]
              pad2: Source
                      -> "30102000.ticsi2rx context 1":0 [ENABLED,IMMUTABLE]
              pad3: Source
                      -> "30102000.ticsi2rx context 2":0 [ENABLED,IMMUTABLE]
              pad4: Source
                      -> "30102000.ticsi2rx context 3":0 [ENABLED,IMMUTABLE]
              pad5: Source
                      -> "30102000.ticsi2rx context 4":0 [ENABLED,IMMUTABLE]
              pad6: Source
                      -> "30102000.ticsi2rx context 5":0 [ENABLED,IMMUTABLE]
       
      - entity 9: cdns_csi2rx.30101000.csi-bridge (5 pads, 2 links, 1 route)
                  type V4L2 subdev subtype Unknown flags 0
                  device node name /dev/v4l-subdev1
              routes:
                      0/0 -> 1/0 [ACTIVE]
              pad0: Sink
                      [stream:0 fmt:UYVY8_1X16/640x480 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
                      <- "imx219 4-0010":0 [ENABLED,IMMUTABLE]
              pad1: Source
                      [stream:0 fmt:UYVY8_1X16/640x480 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
                      -> "30102000.ticsi2rx":0 [ENABLED,IMMUTABLE]
              pad2: Source
              pad3: Source
              pad4: Source
       
      - entity 15: imx219 4-0010 (1 pad, 1 link, 0 routes)
                   type V4L2 subdev subtype Sensor flags 0
                   device node name /dev/v4l-subdev2
              pad0: Source
                      [stream:0 fmt:SRGGB10_1X10/3280x2464 field:none colorspace:raw xfer:none quantization:full-range
                       crop.bounds:(8,8)/3280x2464
                       crop:(8,8)/3280x2464]
                      -> "cdns_csi2rx.30101000.csi-bridge":0 [ENABLED,IMMUTABLE]

      Note that the format of "imx219 4-0010" is different from the format of "cdns_csi2rx.30101000.csi-bridge" and "30102000.ticsi2rx". This format mismatch prevents the image capture from running correctly.

      To fix this issue, run the following commands to change the format to be the same among the three entities:

      root@am62axx-evm:~# media-ctl -V '"imx219 4-0010":0 [fmt:SRGGB8_1X8/1920x1080 field:none]'
      root@am62axx-evm:~# media-ctl -V '"cdns_csi2rx.30101000.csi-bridge":0 [fmt:SRGGB8_1X8/1920x1080 field:none]'
      root@am62axx-evm:~# media-ctl -V '"30102000.ticsi2rx":0 [fmt:SRGGB8_1X8/1920x1080 field:none]'

      Now rerun "media-ctl -p" command to verify that the image format is the same across the media graph:

      root@am62axx-evm:~# media-ctl -p
      Media controller API version 6.6.32
       
      Media device information
      ------------------------
      driver          j721e-csi2rx
      model           TI-CSI2RX
      serial
      bus info        platform:30102000.ticsi2rx
      hw revision     0x1
      driver version  6.6.32
       
      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:SRGGB8_1X8/1920x1080 field:none]
                      <- "cdns_csi2rx.30101000.csi-bridge":1 [ENABLED,IMMUTABLE]
              pad1: Source
                      [stream:0 fmt:SRGGB8_1X8/1920x1080 field:none]
                      -> "30102000.ticsi2rx context 0":0 [ENABLED,IMMUTABLE]
              pad2: Source
                      -> "30102000.ticsi2rx context 1":0 [ENABLED,IMMUTABLE]
              pad3: Source
                      -> "30102000.ticsi2rx context 2":0 [ENABLED,IMMUTABLE]
              pad4: Source
                      -> "30102000.ticsi2rx context 3":0 [ENABLED,IMMUTABLE]
              pad5: Source
                      -> "30102000.ticsi2rx context 4":0 [ENABLED,IMMUTABLE]
              pad6: Source
                      -> "30102000.ticsi2rx context 5":0 [ENABLED,IMMUTABLE]
       
      - entity 9: cdns_csi2rx.30101000.csi-bridge (5 pads, 2 links, 1 route)
                  type V4L2 subdev subtype Unknown flags 0
                  device node name /dev/v4l-subdev1
              routes:
                      0/0 -> 1/0 [ACTIVE]
              pad0: Sink
                      [stream:0 fmt:SRGGB8_1X8/1920x1080 field:none]
                      <- "imx219 4-0010":0 [ENABLED,IMMUTABLE]
              pad1: Source
                      [stream:0 fmt:SRGGB8_1X8/1920x1080 field:none]
                      -> "30102000.ticsi2rx":0 [ENABLED,IMMUTABLE]
              pad2: Source
              pad3: Source
              pad4: Source
       
      - entity 15: imx219 4-0010 (1 pad, 1 link, 0 routes)
                   type V4L2 subdev subtype Sensor flags 0
                   device node name /dev/v4l-subdev2
              pad0: Source
                      [stream:0 fmt:SRGGB8_1X8/1920x1080 field:none colorspace:raw xfer:none quantization:full-range
                       crop.bounds:(8,8)/3280x2464
                       crop:(688,700)/1920x1080]
                      -> "cdns_csi2rx.30101000.csi-bridge":0 [ENABLED,IMMUTABLE]

      For sensors with multiple virtual channels, please refer to the following FAQ on setting the routes in the media graph

      For other common problems related to CSI camera please refer to this FAQ: