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.

TDA4VM: Capture node fails to receive frames from streaming sensor

Part Number: TDA4VM

Dear TI Support Team,

I am encountering an issue with the implementation of the driver for the VD1940 sensor. I have successfully developed a driver for the AR0239 sensor, which provides a live stream to my display. (Both sensors are configured identically with a resolution of 1920x1080, single context, RAW12 format, and 60fps.) The serializer used for both is the same – ub953.

The problem arises with the VD1940 sensor, where I only receive a static frame of artifacts on the display that does not change over time.

Here are the steps I have taken to diagnose the issue:

  1. After calling the VD1940_StreamOn function, I verified its status, which is STREAMING. I also read the frame counter twice over a set interval to confirm that it is incrementing.

  2. Upon starting the stream, the registers from the ub960 deserializer show the following:

    • 0x35 -> 0x1
    • 0x90 and 0x91 change over time (which I assume indicates that the stream is reaching the deserializer).
    • 0x92 and 0x93 remain 0x0 (indicating no error frames).
  3. Debugging prints within tivxCaptureProcess() consistently show that the code enters the following block:

    if (status != VX_SUCCESS)
    {
        prms->timeoutRemaining = 0;
        timeoutExceeded = CAPTURE_TIMEOUT_EXCEEDED;
        printf("tivxCaptureProcess() CAPTURE_TIMEOUT_EXCEEDED: %d\n",state);
    }

I would be very grateful for your assistance in debugging and resolving this issue.

Best regards,
Stanislav

  • Hi Stanislav,

    I verified its status, which is STREAMING. I also read the frame counter twice over a set interval to confirm that it is incrementing.

    Is this frame counter read from the sensor ? 

    I only receive a static frame of artifacts on the display that does not change over time.

    Is this static frame of artifacts are received from the csirx or is it the error frame that is displayed on the screen.

    Can you print the capture statistics to see if there are any errors in receiving the frames.

    Regards,
    Gokul

  • Hi Gokul,

    Is this frame counter read from the sensor ? 

    Yes, I've read the sensor's frame counter and its error and warning registers, they do not indicate any configuration issues.

    Is this static frame of artifacts are received from the csirx or is it the error frame that is displayed on the screen.

    The frame displayed on the screen is something like this:

    I am not sure that the capture node receives any frames at all.

    Capture status:

    [MCU2_0] 477.588500 s: src/csirx_drv.c @ Line 825:
    [MCU2_0] 477.588555 s: NO_MORE_BUFFERS: No more buffers with driver
    [MCU2_0] 477.588628 s: ==========================================================
    [MCU2_0] 477.588692 s: Capture Status: Instance|0
    [MCU2_0] 477.588750 s: ==========================================================
    [MCU2_0] 477.588799 s: overflowCount: 0
    [MCU2_0] 477.588831 s: spuriousUdmaIntrCount: 0
    [MCU2_0] 477.588864 s: frontFIFOOvflCount: 0
    [MCU2_0] 477.588894 s: crcCount: 2
    [MCU2_0] 477.588919 s: eccCount: 0
    [MCU2_0] 477.588948 s: correctedEccCount: 0
    [MCU2_0] 477.588979 s: dataIdErrorCount: 0
    [MCU2_0] 477.589010 s: invalidAccessCount: 0
    [MCU2_0] 477.589040 s: invalidSpCount: 0
    [MCU2_0] 477.589072 s: strmFIFOOvflCount[0]: 0
    [MCU2_0] 477.589103 s: strmFIFOOvflCount[1]: 0
    [MCU2_0] 477.589150 s: Channel Num | Frame Queue Count | Frame De-queue Count | Frame Drop Count | Error Frame Count |
    [MCU2_0] 477.589215 s: 0 | 8 | 8 | 0 | 0 |
    [MCU2_0] 477.589895 s: src/csirx_drv.c @ Line 825:
    [MCU2_0] 477.589947 s: NO_MORE_BUFFERS: No more buffers with driver
    [MCU2_0] 477.590016 s: ==========================================================
    [MCU2_0] 477.590075 s: Capture Status: Instance|1
    [MCU2_0] 477.590117 s: ==========================================================
    [MCU2_0] 477.590161 s: overflowCount: 0
    [MCU2_0] 477.590194 s: spuriousUdmaIntrCount: 0
    [MCU2_0] 477.590228 s: frontFIFOOvflCount: 0
    [MCU2_0] 477.590259 s: crcCount: 0
    [MCU2_0] 477.590285 s: eccCount: 0
    [MCU2_0] 477.590316 s: correctedEccCount: 0
    [MCU2_0] 477.590346 s: dataIdErrorCount: 0
    [MCU2_0] 477.590376 s: invalidAccessCount: 0
    [MCU2_0] 477.590406 s: invalidSpCount: 0
    [MCU2_0] 477.590438 s: strmFIFOOvflCount[0]: 0
    [MCU2_0] 477.590472 s: strmFIFOOvflCount[1]: 0

    and

    tivx_capture_params_t 
    local_capture_config:

    === TIVX Capture Parameters ===
    Number of Instances: 2
    Number of Channels: 1
    Timeout: 33 ms
    Initial Timeout: 500 ms

    --- Instance IDs ---
      instId[0]: 0 (CSIRx0)
      instId[1]: 1 (CSIRx1)

    --- Channel Configuration ---
        Channel 0:
        Virtual Channel Number: 0
        Instance ID Mapping: 0

    --- Instance Configurations ---
        Instance 0:
        CSIV2P0 Support Enabled: 1
        Number of Data Lanes: 4
        Data Lanes Map: [1, 2, 3, 4]
        Lane Band Speed: 0x12
        Number of Pixels: 0 (1 pixel per clock)
        Instance 1:
        CSIV2P0 Support Enabled: 1
        Number of Data Lanes: 4
        Data Lanes Map: [1, 2, 3, 4]
        Lane Band Speed: 0x12
        Number of Pixels: 0 (1 pixel per clock)
    ================================


    Regards,
    Stanislav

  • Hi Stanislav,

    I can see there is a crc error there is a frame enqueue/dequeue count which means frames are received by the csirx how long did you run this demo before printing the statistics ?

    Also general things to check for integrating new sensor,

    CSIRX does not capture data only due below reasons

    - mismatching data type

    - mismatching virtual channel id

    - number of lanes mismatch

    - lane speed mismatch

    - deserializer/sensor is started before DPHY configuration. 

    Can you please check if all of above taken care? 

    Regards,
    Gokul

  • Hi Gokul,

    I have run this demo for approximately 1-2 minutes, but the display shows nothing different from what I described above.

    Sensor params:

    static IssSensor_CreateParams  vd1940CreatePrms = {
        SENSOR_STM_VD1940_UB953,     /*sensor name*/
        0x6,                             /*i2cInstId*/
        {
            SENSOR_0_I2C_ALIAS, SENSOR_1_I2C_ALIAS, SENSOR_2_I2C_ALIAS, SENSOR_3_I2C_ALIAS,
            SENSOR_4_I2C_ALIAS, SENSOR_5_I2C_ALIAS, SENSOR_6_I2C_ALIAS, SENSOR_7_I2C_ALIAS
        },/*i2cAddrSensor*/
        {
            SER_0_I2C_ALIAS, SER_1_I2C_ALIAS, SER_2_I2C_ALIAS, SER_3_I2C_ALIAS,
            SER_4_I2C_ALIAS, SER_5_I2C_ALIAS, SER_6_I2C_ALIAS, SER_7_I2C_ALIAS
        },/*i2cAddrSer*/
        /*IssSensor_Info*/
        {
            {
                VD1940_OUT_WIDTH,               /*width*/
                VD1940_OUT_HEIGHT,              /*height*/
                1,                              /*num_exposures*/
                vx_false_e,                     /*line_interleaved*/
                {
                    {TIVX_RAW_IMAGE_16_BIT, 9},    /*dataFormat and MSB [0]*/
                },
                0,                              /*meta_height_before*/
                2,                              /*meta_height_after*/
            },
            ISS_SENSOR_VD1940_FEATURES,     /*features*/
            //ALGORITHMS_ISS_AEWB_MODE_AWB,  /*aewbMode*/
            ALGORITHMS_ISS_AEWB_MODE_NONE,
            30,                             /*fps*/
            4,                              /*numDataLanes*/
            {1, 2, 3, 4},                   /*dataLanesMap*/
            {0, 0, 0, 0},                   /*dataLanesPolarity*/
            //CSIRX_LANE_BAND_SPEED_1350_TO_1500_MBPS, /*csi_laneBandSpeed*/
            CSIRX_LANE_BAND_SPEED_800_TO_880_MBPS,
        },
        4,                                  /*numChan*/
        1940,                                /*dccId*/
    };


    From the sensor driver side settings are:
    Width - 1920 == VD1940_OUT_WIDTH
    Height - 1080 == VD1940_OUT_HEIGHT
    Configuration - RGB RAW10
    Mipi data rata is set to 744Mbps

    Also there is no remapping or polarity changing from sensor drv.
    After the pixel data there is 2 status lines which can't be disabled from sensor drv with data type 0x12. (we do not want to capture them only filter the pixel data)

    The stream is enabled in IssSensor_StreamOnFxn callback.

    It would be of great help if you could share debugging steps for this issue.

    Regards,
    Stanislav
  • Hi Stanislav,

    Can you connect to css and debug the to check if csirx interrupts are called.

    After running 2 minutes can you share the capture statistics ? 

    Also can you try with CSIRX_LANE_BAND_SPEED_720_TO_800_MBPS in the sensor create params.

    Check the sensor configuration once to ensure it is giving the configured output.

    After the pixel data there is 2 status lines which can't be disabled from sensor drv with data type 0x12. (we do not want to capture them only filter the pixel data)

    I didn't understand can you explain a bit more elaborate.

    Regards,
    Gokul

  • Hi Gokul,

    After running 2 minutes can you share the capture statistics ? 

    I'm not entirely sure if you mean this by capture statistics, but for exactly 2 minutes, the result is:

    [MCU2_0] 1876.837541 s: ==========================================================
    [MCU2_0] 1876.837603 s: Capture Status: Instance|0
    [MCU2_0] 1876.837646 s: ==========================================================
    [MCU2_0] 1876.837692 s: overflowCount: 0
    [MCU2_0] 1876.837727 s: spuriousUdmaIntrCount: 0
    [MCU2_0] 1876.837760 s: frontFIFOOvflCount: 0
    [MCU2_0] 1876.837807 s: crcCount: 0
    [MCU2_0] 1876.837840 s: eccCount: 0
    [MCU2_0] 1876.837871 s: correctedEccCount: 0
    [MCU2_0] 1876.837901 s: dataIdErrorCount: 0
    [MCU2_0] 1876.837932 s: invalidAccessCount: 0
    [MCU2_0] 1876.837962 s: invalidSpCount: 0
    [MCU2_0] 1876.837994 s: strmFIFOOvflCount[0]: 0
    [MCU2_0] 1876.838026 s: strmFIFOOvflCount[1]: 0
    [MCU2_0] 1876.838071 s: Channel Num | Frame Queue Count | Frame De-queue Count | Frame Drop Count | Error Frame Count |
    [MCU2_0] 1876.838135 s: 0 | 8 | 8 | 0 | 0 |
    [MCU2_0] 1876.838836 s: src/csirx_drv.c @ Line 825:
    [MCU2_0] 1876.838885 s: NO_MORE_BUFFERS: No more buffers with driver
    [MCU2_0] 1876.838951 s: ==========================================================
    [MCU2_0] 1876.839009 s: Capture Status: Instance|1
    [MCU2_0] 1876.839051 s: ==========================================================
    [MCU2_0] 1876.839094 s: overflowCount: 0
    [MCU2_0] 1876.839128 s: spuriousUdmaIntrCount: 0
    [MCU2_0] 1876.839162 s: frontFIFOOvflCount: 0
    [MCU2_0] 1876.839194 s: crcCount: 0
    [MCU2_0] 1876.839222 s: eccCount: 0
    [MCU2_0] 1876.839250 s: correctedEccCount: 0
    [MCU2_0] 1876.839281 s: dataIdErrorCount: 0
    [MCU2_0] 1876.839311 s: invalidAccessCount: 0
    [MCU2_0] 1876.839341 s: invalidSpCount: 0
    [MCU2_0] 1876.839372 s: strmFIFOOvflCount[0]: 0
    [MCU2_0] 1876.839407 s: strmFIFOOvflCount[1]: 0

    Also can you try with CSIRX_LANE_BAND_SPEED_720_TO_800_MBPS in the sensor create params.

    I tried but the is no result.

    The output data of the sensor is compliant with MIPI CSI-2 specifications v1.1. If we visit the specifications




    I didn't understand can you explain a bit more elaborate.

    The image sensor is configured at resolution 1920x1080 (pixel data) after this data there is 2 lines (embedded/status/metadata).

    I tried configuring the sensor in RAW8 mode because I'm not entirely sure if RAW10 (packaged) is supported, but the result is the same. I would be glad if this information is useful for solving the problem.

    Regards,
    Stanislav

  • Hi Stanislav,

    - deserializer/sensor is started before DPHY configuration. 

    Can you check if the sensor is started to stream the data before verifygraph(). Check the configuration once or the commands that you send to sensor, that accidentally during config it is also starting the sensor stream.

    Regards,
    Gokul

  • Hi Gokul,

    Here is the log from sensor initialization:

    LDC Selection Yes(1)/No(0) : LDC Selection Yes(1)/No(0) : 0
    app_init done
    Querying VD1940-UB953
    220.626934 s: ISS: Querying sensor [VD1940-UB953] ... !!!
    220.627112 s: ISS: Querying sensor [VD1940-UB953] ... Done !!!
    WDR mode is supported
    Expsoure control is supported
    Gain control is supported
    obj->aewb_cfg.ae_mode = 1
    obj->aewb_cfg.awb_mode = 2
    Sensor DCC is NOT enabled
    Sensor width = 1920
    Sensor height = 1080
    Sensor DCC ID = 1940
    Sensor Supported Features = 0x78
    Sensor Enabled Features = 0x58
    220.627169 s: ISS: Initializing sensor [VD1940-UB953], doing IM_SENSOR_CMD_PWRON ... !!!
    220.627255 s: ISS: Initializing sensor [VD1940-UB953], doing IM_SENSOR_CMD_CONFIG ... !!!
    [MCU2_0] 222.011531 s: IN VD1940_config function
    [MCU2_0] 223.818285 s: Configuring VD1940 imager .. Please wait till it finishes
    [MCU2_0] 224.822592 s: VD1940_Status: SYSTEM_UP
    [MCU2_0] 237.201328 s: VD1940: Loading DRV register set
    239.010523 s: ISS: Initializing sensor [VD1940-UB953] ... Done !!!
    Creating graph
    Initializing params for capture node
    capture_config = 0x0xffff8c6ca9b0
    Creating capture node
    obj->capture_node = 0x0xffff8c63bb30
    Test data path is NULL. Defaulting to current folder
    read_test_image_raw : Unable to open file .//img_test.raw
    app_create_viss : sensor_dcc_id = 1940
    AEWB Set Reference done
    Display Set Target done
    vxSetGraphScheduleConfig done
    [MCU2_0] 239.010338 s: VD1940: DRV register set complete.
    [MCU2_0] 239.010398 s: VD1940_Status: SW_STANDBY
    [MCU2_0] 239.024714 s: VX_ZONE_WARNING: [tivxVpacVissCreate:373] VISS H3A output is not generated due to DCC not being enabled
    [MCU2_0] 239.031043 s: VX_ZONE_WARNING: [tivxAewbCreate:1153] No DCC buffer passed. Disabling 2A
    Scaler is enabled
    app_create_graph exiting
    app_create_graph done
    239.048094 s: ISS: Starting sensor [VD1940-UB953] ... !!!
    ==========================
    Demo : Single Camera w/ 2A
    ==========================

    p: Print performance statistics

    s: Save Sensor RAW, VISS Output and H3A output images to File System

    e: Export performance statistics

    u: Update DCC from File System


    x: Exit

    Enter Choice:

    [MCU2_0] 240.432540 s: [VD1940_StreamOn] Enable Vd1940 stream...  HERE WE START THE STREAM
    [MCU2_0] 240.534305 s: [VD1940_StreamOn] VD1940_Status: STREAMING
    241.082611 s: ISS: Starting sensor [VD1940-UB953] ... Done !!!
    get_dcc_dir_size : Could not open directory or directory is empty /opt/vision_apps/dcc/VD1940-UB953/linear
    [MCU2_0] 241.082464 s: READ_DES_0x35_after_5s: 0x01

  • Hi Stanislav,

    [MCU2_0] 240.432540 s: [VD1940_StreamOn] Enable Vd1940 stream...  HERE WE START THE STREAM

    Yes, 

    I am asking to check the sensor configuration. That it may start the sensor during the sensor config phase.

    [MCU2_0] 222.011531 s: IN VD1940_config function

    Just double check the configuration once.

    And can you start debugging in ccs and check for csirx event irq callback is getting called or not.

    Can you see if these functions are getting called, CsirxDrv_udmaCQEventCb(), CSIRX_Isr()

    Regards,
    Gokul