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] How do I find the right video device node for my CSI-2 sensor?

Part Number: AM62A7

Tool/software:

I connected a sensor to my AM62A starter kit EVM, and the sensor correctly probed. When I did "v4l2-ctl --list-devices", many "/dev/videoX" nodes were listed. Which one should be used to capture images from the sensor?

Other parts: AM68AAM69AAM62A3, , AM62A3-Q1, AM62A7-Q1

  • By default, the first video node under j721e-csi2rx shown by "v4l2-ctl --list-devices" is the capture device for the sensor. By reconfiguration, any of the video device nodes under j721e-csi2rx can be used to capture. For example, on AM62A, there are 6 nodes created by the CSI2-RX driver (/dev/videoX under j721e-csi2rx):

    root@am62axx-evm:~# v4l2-ctl --list-devices
    j721e-csi2rx (platform:30102000.ticsi2rx):
            /dev/video3
            /dev/video4
            /dev/video5
            /dev/video6
            /dev/video7
            /dev/video8
            /dev/media0
    
    wave5-dec (platform:30210000.video-codec):
            /dev/video0
            /dev/video1
    
    e5010 (platform:fd20000.jpeg-encoder):
            /dev/video2

    Any of the video nodes under j721e-csi2rx can be configured to be the capture device to stream video from the sensor. The user can choose a particular video node by setting up the route in the media pipe. By default, the first video node is configured as the capture device.

    To check which video node is set as the capture device, display the media pipe graph by running "media-ctl -p -d /dev/mediaX" where /dev/mediaX is the media device node under j721e-csi2rx. From the media pipe, under entity "ticsi2rx", find the "ticsi2rx context" which has a configured streaming format. For example, AM62A has the following ticsi2rx entity and the format for "ticsi2rx context 0" is configured: 

    Then, go down the media pipe to find the /dev/videoX node associated with this context. For example, on AM62A, /dev/video3 is associated with ticsi2rx context 0 and should be used as the capture device:

    The user can choose a different video node to be the capture device by running the "media-ctl -R/V" command. For example,  

    root@am62axx-evm:~# media-ctl -R '"30102000.ticsi2rx" [0/0 -> 2/0 [1]]'
    root@am62axx-evm:~# media-ctl -V '"30102000.ticsi2rx":0 [fmt:SRGGB8_1X8/1920x1080 field:none]'

    For a sensor with multiple virtual channels, multiple video device nodes will be needed to stream data from multiple virtual channels simultaneously. Please refer to https://github.com/TexasInstruments/edgeai-gst-apps/blob/main/scripts/ox05b.sh for an example.

    Multiple sensors can be connected to a single SoC, with each sensor having one or more capture device nodes (depending on the number of virtual channels of each sensor). Please refer to the following for examples:

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