Post Go back to editing

ADV7280-M Timeout on Syncpt

I've recently posted about getting a ADV7280-M working over CSI on our NVIDIA Tegra system-on-module.

This now works and I can happily stream video.

However, I've recently stumbled across some issues when starting a gstreamer pipeline whereby occasionally, the video feed stutters and stumbles, with occasional half previous frames being shown alongside half current image frames (if that makes any sense).

Having had a look through the Linux dmesgs, I can see the following being output:

[ 1064.946867] vi vi: Timeout on VI syncpt
[ 1064.946891] vi vi: buffer_addr = 0x00707000
[ 1064.946911] vi vi: PPSTATUS = 0x00000000, CILSTATUS = 0x00000000
[ 1066.956686] vi vi: Timeout on VI syncpt
[ 1066.956709] vi vi: buffer_addr = 0x0079f000
[ 1066.956750] vi vi: PPSTATUS = 0x00000000, CILSTATUS = 0x00000000
[ 1068.956679] vi vi: Timeout on VI syncpt
[ 1068.956703] vi vi: buffer_addr = 0x00707000
[ 1068.956724] vi vi: PPSTATUS = 0x00000000, CILSTATUS = 0x00000000
[ 1074.506788] vi vi: Timeout on VI syncpt
[ 1074.506812] vi vi: buffer_addr = 0x00707000
[ 1074.506833] vi vi: PPSTATUS = 0x00000000, CILSTATUS = 0x00000000
[ 1076.516691] vi vi: Timeout on VI syncpt
[ 1076.516715] vi vi: buffer_addr = 0x0079f000
[ 1076.516736] vi vi: PPSTATUS = 0x00000000, CILSTATUS = 0x00000000
[ 1078.516694] video4linux video0: Timeout on CSI syncpt
[ 1078.516719] video4linux video0: buffer_addr = 0x00707000
[ 1078.516744] video4linux video0: PPSTATUS = 0x00000000, CILSTATUS = 0x00000000, ROSTATUS = 0x00000000
[ 1080.516752] video4linux video0: Timeout on CSI syncpt
[ 1080.516777] video4linux video0: buffer_addr = 0x00707000
[ 1080.516803] video4linux video0: PPSTATUS = 0x00000000, CILSTATUS = 0x00000000, ROSTATUS = 0x00000000

If I power down the camera and power back on while the gstreamer pipeline is closed, about 6/7 times out of 10, the video feed starts again and is smooth without stutter - the rest of the time, the feed is jerky and has issues (if I can capture some images then I will add them to this post).

One previous post on a similar "timeout on VI syncpt" issue mentions the "continuous_clk" field of the platform data for the camera. The adv7280-m driver on my Linux distro has it set to "1" which could be incorrect.

I'd be grateful for any advice.

Kevin

  • Hi,

    Which reference thread you are getting a ADV7280-M working over CSI on our NVIDIA Tegra system-on-module?

    Can you please link it here?

    Best Regards,

    Jeyasudha.M

  • This is the other thread:

    ADV7280-M Resolution Issue 

    Here is the initialization code from the adv7280 driver:

    /* Reset */
    ret = adv7280_write_reg(client,
    ADV7280_POWER_MANAGEMENT, 0xA0);
    if (ret < 0)
    goto err_unreg_subdev;
    msleep(10);

    ret = adv7280_write_reg(client, 0x0F, 0x00);
    if (ret < 0)
    goto err_unreg_subdev;

    ret = adv7280_write_reg(client, 0x00, 0x00);
    if (ret < 0)
    goto err_unreg_subdev;

    ret = adv7280_write_reg(client, 0x0E, 0x80);
    if (ret < 0)
    goto err_unreg_subdev;

    ret = adv7280_write_reg(client, 0x9c, 0x00);
    if (ret < 0)
    goto err_unreg_subdev;

    ret = adv7280_write_reg(client, 0x9c, 0xff);
    if (ret < 0)
    goto err_unreg_subdev;

    ret = adv7280_write_reg(client, 0x0e, 0x00);
    if (ret < 0)
    goto err_unreg_subdev;

    ret = adv7280_write_reg(client, 0x03, 0x4e);
    if (ret < 0)
    goto err_unreg_subdev;

    ret = adv7280_write_reg(client, 0x04, 0x57);
    if (ret < 0)
    goto err_unreg_subdev;

    ret = adv7280_write_reg(client, 0x13, 0x00);
    if (ret < 0)
    goto err_unreg_subdev;

    ret = adv7280_write_reg(client, 0x17, 0x41);
    if (ret < 0)
    goto err_unreg_subdev;

    ret = adv7280_write_reg(client, 0x1D, 0xC0);
    if (ret < 0)
    goto err_unreg_subdev;

    ret = adv7280_write_reg(client, 0x52, 0xCD);
    if (ret < 0)
    goto err_unreg_subdev;

    ret = adv7280_write_reg(client, 0x80, 0x51);
    if (ret < 0)
    goto err_unreg_subdev;

    ret = adv7280_write_reg(client, 0x81, 0x51);
    if (ret < 0)
    goto err_unreg_subdev;

    ret = adv7280_write_reg(client, 0x82, 0x68);
    if (ret < 0)
    goto err_unreg_subdev;


    #ifdef HW_DEINT
    /* Set VPP Map */
    ret = adv7280_write_reg(client,
    ADV7280_VPP_SLAVE_ADDRESS, (VPP_SLAVE_ADDRESS << 1));
    if (ret < 0)
    goto err_unreg_subdev;

    /* VPP - not documented */
    ret = adv7280_write_reg(&vpp_client,
    0xA3, 0x00);
    if (ret < 0)
    goto err_unreg_subdev;

    /* VPP - Enbable Advanced Timing Mode */
    ret = adv7280_write_reg(&vpp_client,
    VPP_ADV_TIMING_MODE_EN, 0x00);
    if (ret < 0)
    goto err_unreg_subdev;

    /* VPP - Enable Deinterlacer */
    ret = adv7280_write_reg(&vpp_client,
    VPP_I2C_DEINT_ENABLE, 0x80);
    if (ret < 0)
    goto err_unreg_subdev;
    #endif

    ret = adv7280_write_reg(client, 0xfe, 0x88);
    if (ret < 0)
    goto err_unreg_subdev;

    // --------------------------------
    // Based on Analog recommended script
    ret = adv7280_write_reg(&csi_client, 0x01, 0x20);
    if (ret < 0)
    goto err_unreg_subdev;

    ret = adv7280_write_reg(&csi_client, 0x02, 0x28);
    if (ret < 0)
    goto err_unreg_subdev;

    ret = adv7280_write_reg(&csi_client, 0x03, 0x38);
    if (ret < 0)
    goto err_unreg_subdev;

    ret = adv7280_write_reg(&csi_client, 0x04, 0x30);
    if (ret < 0)
    goto err_unreg_subdev;

    ret = adv7280_write_reg(&csi_client, 0x05, 0x30);
    if (ret < 0)
    goto err_unreg_subdev;

    ret = adv7280_write_reg(&csi_client, 0x06, 0x80);
    if (ret < 0)
    goto err_unreg_subdev;

    ret = adv7280_write_reg(&csi_client, 0x07, 0x70);
    if (ret < 0)
    goto err_unreg_subdev;

    ret = adv7280_write_reg(&csi_client, 0x08, 0x50);
    if (ret < 0)
    goto err_unreg_subdev;

    // --------------------------------

    ret = adv7280_write_reg(&csi_client, 0xde, 0x02);
    if (ret < 0)
    goto err_unreg_subdev;

    ret = adv7280_write_reg(&csi_client, 0xd2, 0xf7);
    if (ret < 0)
    goto err_unreg_subdev;

    ret = adv7280_write_reg(&csi_client, 0xd8, 0x65);
    if (ret < 0)
    goto err_unreg_subdev;

    ret = adv7280_write_reg(&csi_client, 0xe0, 0x09);
    if (ret < 0)
    goto err_unreg_subdev;

    ret = adv7280_write_reg(&csi_client, 0x2c, 0x00);
    if (ret < 0)
    goto err_unreg_subdev;

    ret = adv7280_write_reg(&csi_client, 0x00, 0x00);
    if (ret < 0)
    goto err_unreg_subdev;

    return 0;

  • Hi,

    We are checking with part specialist on this whether he has any feedback on this. Again if this is related to Linux, could you post this to Linux software drivers group https://ez.analog.com/community/linux-device-drivers/linux-software-drivers  where you will be more likely to get a knowledgeable answer.

    Best Regards,

    Jeyasudha.M

  • Hi Kevin,

    Sorry I am not a software engineer so I have no idea if there is an issue with your code. I advise you follow Jeyasudha suggestion above and post on the Linux forum. 

    What I will say is that if there is any distortion on the analog video input to the ADV728x then this will be fed out from the ADV728x. In order to check that your code is correct I advise programming the ADV728x into free-run mode. In this mode the ADV728x ignore the analog video input and outputs a color bars test pattern. If the issue is no longer present then you know the issue is with the analog video source or the Analog Front End of the ADV728x.  Sample free-run code is available here:

    ADV7280 / ADV7280-M Design Support Files 

    Also when the ADV728x locks to an analog video source it will start outputting video immediately. This means that the first field can be shorter than standard. This can confuse some microprocessors. I advise not storing the video output from the ADV728x until the ADV728x has locked to a video source (IN_LOCK and FSC_LOCK bits are high in user map register 0x10) and then wait until the next "frame start" MIPI packet. This will ensure that the first field received by the microprocessor is of the correct length. I discuss this in the applications note AN-1337 which is also available at the link above.

    Regards,
    Robert Hinchy,

    Applications Engineer,

    Analog Devices Inc.

  • This question has been assumed as answered either offline via email or with a multi-part answer. This question has now been closed out. If you have an inquiry related to this topic please post a new question in the applicable product forum.

    Thank you,
    EZ Admin