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.

AM572x v4l2 video capture

Expert 2990 points
Other Parts Discussed in Thread: AM5728

HI all:

         Just now we use am5728's vip to captue bt1120 video(1280x720p60 video) and

         We can capture the video successfully, but the video offset to right and to the downward.

         We have test the sync signal, the vsync is 60HZ and the hsync is 45KHZ , the clk is 75MHZ,I think the sync work well.

         below is my devicetree:

         adv7842@20 {

           compatible = "adi,adv7842";

           reg = <0x20>;

           port {
                   adv7842_1: endpoint {
                                         remote-endpoint = <&vin1a>;
                                         hsync-active = <1>;
                                         vsync-active = <1>;
                                         date-active = <1>;
                                         pclk-sample = <0>;
                                         bus-width = <16>;
                                        };
                  };
           };

           &vip1 {

                        status = "okay";
            };

            &vin1a {

                        status = "okay";
                        endpoint {
                                         slave-mode;
                                         remote-endpoint = <&adv7842_1>;
                        };
            };

         Our sdk version is 3.0 and our board is an custom board.

         The video link is as below:

         VGA -> adv7842(transfer to 16 bit bt1120 video) -> am5728 vin1a

         We use the discrete sync signal,

         Please tell me what has gone wrong!

  

regards

wang

       

  • Hi Wang,

    The part of the dts you use seems correct. Have you tried increasing/decreasing the clk?

    Best Regards,
    Yordan
  • Hi Yordan

    Thanks for your reply
    the video pixel clock is 74.25MHZ,The above description is wrong

    regards
    wang

  • Hi Yordan

    the video pixel clock is 74.25MHZ,The above description is wrong

  • Dear Yordan
    Just now we test the video timmings, the standard is 1280x720P60.
    the hsync is 45KHZ, the hsync positive time is 540ns,hsync total time is 22.24us
    The DE signal positive time is 17.2us,DE signal negative time is 5us
    So I make sure the hardware timings is right,
    I don't know What has gone wrong!
    Is the vip driver or the subdev driver or the devicetree?
    regards
    wang
  • HI Yordan:

    Do you have any advice for me.
    Thanks
    regards
    wang
  • Hi Wang,

    Sorry for the late reply.
    I think you should verify the dts nodes first, before moving to the subdev driver (IMO the subdev driver should be ok).

    Can you verify that the I2C to which you connect the ADV7842 is initialized properly (maybe probe the sda & scl lines)?

    How do you set the i2cX device tree node? You should have something like:
    i2cX {
    .......
    adv7842@20 {
    compatible = <adi,adv7842>;
    reg = <0x20>;
    status = "okay";
    };
    };


    Best Regards,
    Yordan
  • HI Yordan

    thanks for your reply

    the below is the device tree for adv7842
    &i2c4 {
    status = "okay";
    clock-frequency = <400000>;

    adv7842@20 {
    compatible = "adi,adv7842";
    reg = <0x20>;

    port {
    adv7842_1: endpoint {
    remote-endpoint = <&vin1a>;
    hsync-active = <1>;
    vsync-active = <1>;
    data-active = <1>;
    pclk-sample = <0>;
    bus-width = <16>;
    };
    };
    };
    };
    Using the above dts, it can genarate the /dev/video1 and My subdev driver can probe the adv7842 successfully

    The video sync is also OK, the vip1 can also capture the video but the video have some issue which is offset to the right and to the down.

  • HI Yordan:

    Does the am5728 vip support to capture HD video,such as 1280x720P60 standard?

    thanks
    regards
    wang
  • Hi Wang,

    The VIP supports:
    #define MAX_W 2048
    #define MAX_H 1536

    Considering that max VIP pixel clock is 165MHz, and 1280x720p60 requires 1280*720*60 = 55296000 Hz, or 55.296 MHz, then yes VIP should be able to support this resolution.

    Best Regards,
    Yordan
  • HI Yordan

    Thanks for your reply
    The below code is from vip.c ,as for as I know the colorspace V4L2_COLORSPACE_SMPTE170M just support ntsc/pal
    while the V4L2_COLORSPACE_REC709 support HDTV, So I think the vip driver don't support HDTV standard

    static struct vip_fmt vip_formats[] = {
    {
    .fourcc = V4L2_PIX_FMT_NV12,
    .code = MEDIA_BUS_FMT_UYVY8_2X8,
    .colorspace = V4L2_COLORSPACE_SMPTE170M,
    .coplanar = 1,
    .vpdma_fmt = { &vpdma_yuv_fmts[VPDMA_DATA_FMT_Y420],
    &vpdma_yuv_fmts[VPDMA_DATA_FMT_C420],
    },
    },
    {
    .fourcc = V4L2_PIX_FMT_UYVY,
    .code = MEDIA_BUS_FMT_UYVY8_2X8,
    .colorspace = V4L2_COLORSPACE_SMPTE170M,
    .coplanar = 0,
    .vpdma_fmt = { &vpdma_yuv_fmts[VPDMA_DATA_FMT_CBY422],
    },
    },
    {
    .fourcc = V4L2_PIX_FMT_YUYV,
    .code = MEDIA_BUS_FMT_UYVY8_2X8,
    .colorspace = V4L2_COLORSPACE_SMPTE170M,
    .coplanar = 0,
    .vpdma_fmt = { &vpdma_yuv_fmts[VPDMA_DATA_FMT_YCB422],
    },
    },
    {
    .fourcc = V4L2_PIX_FMT_VYUY,
    .code = MEDIA_BUS_FMT_UYVY8_2X8,
    .colorspace = V4L2_COLORSPACE_SMPTE170M,
    .coplanar = 0,
    .vpdma_fmt = { &vpdma_yuv_fmts[VPDMA_DATA_FMT_CRY422],
    },
    },
    {
    .fourcc = V4L2_PIX_FMT_YVYU,
    .code = MEDIA_BUS_FMT_UYVY8_2X8,
    .colorspace = V4L2_COLORSPACE_SMPTE170M,
    .coplanar = 0,
    .vpdma_fmt = { &vpdma_yuv_fmts[VPDMA_DATA_FMT_YCR422],
    },
    },
    {
    .fourcc = V4L2_PIX_FMT_RGB24,
    .code = MEDIA_BUS_FMT_RGB888_1X24,
    .colorspace = V4L2_COLORSPACE_SRGB,
    .coplanar = 0,
    .vpdma_fmt = { &vpdma_rgb_fmts[VPDMA_DATA_FMT_RGB24],
    },
    },
    {
    .fourcc = V4L2_PIX_FMT_RGB32,
    .code = MEDIA_BUS_FMT_ARGB8888_1X32,
    .colorspace = V4L2_COLORSPACE_SRGB,
    .coplanar = 0,
    .vpdma_fmt = { &vpdma_rgb_fmts[VPDMA_DATA_FMT_ARGB32],
    },
    },
    };
  • Dear Yordan

    Is there any other client that uses the am5728 to capture the HDTV video?
    It is critical for us

    Thanks
    wang
  • hi Wang,
    we are also using the adv7842 for video input on EVM5728. Do you have any update on your issue? Which linux driver do you use? We use the driver included in the linux kernel from TI.

    root@am57xx-evm:/sys/module# modinfo adv7842
    filename: /lib/modules/4.4.19-gdb0b54cdad/kernel/drivers/media/i2c/adv7842.ko
    license: GPL
    author: Martin Bugge <marbugge@cisco.com>
    author: Hans Verkuil <hans.verkuil@cisco.com>
    description: Analog Devices ADV7842 video decoder driver
    srcversion: 4F006C2154452E099328C17
    alias: i2c:adv7842
    depends:
    intree: Y
    vermagic: 4.4.19-gdb0b54cdad SMP preempt mod_unload modversions ARMv7 p2v8
    parm: debug:debug level (0-2) (int)


    When the driver is loaded, it always puts out Error "No platform data" inside the probe function. The included driver doesn't support device tree bindings. Do you have an updated version with device tree support?

    Have a nice day

    Marc