How to configure CSI for known video stream and grab frame data

If the specifics of the CSI stream are known (which port, how many lanes, resolution, pixel format, frame rate, etc), is it possible, right now, to configure the hardware and start getting the frame data (for example, as parameters to the ‘nvcamerasrc’ gstreamer plugin) ?

This is not a sensor per-se, it is part of a custom carrier board that is pre-configured to generate the MIPI stream.

Thank you for your help.

Hi

In an L4T update dropping soon (R23.2, in a few days), there will be V4L2 interface provided w/ kernel src and user guide to promote ease-of-use.
Please use that path rather than gstreamer to pull frames from CSI without going through the ISP.

Thanks

Thanks @kayccc. I’ve been looking at the (preliminary?) code in ov5693_v4l2.c (which is not compiled in) and it looks like it is going to be straightforward. One of the v4l2 ops specifies the CSI bus configuration:

static int ov5693_g_mbus_config (
    struct v4l2_subdev      * sd,
    struct v4l2_mbus_config *cfg)
{
    cfg->type  = V4L2_MBUS_CSI2;
    cfg->flags = 
        V4L2_MBUS_CSI2_4_LANE |
        V4L2_MBUS_CSI2_CHANNEL_0 |
        V4L2_MBUS_CSI2_CONTINUOUS_CLOCK;

	return 0;
}

Then the v4l2 soc_camera takes care of the rest, via the ‘vi’ host driver that gets registered with it.

Having that interface will certainly boost the development of a lot of people that are trying to make image processing based products with the TX1.

A ‘few days’ is a little vague, hopefully that means less than a week.

I am testing the newly released L4T_R23.2 version for Jetson TX1. One of the features I was looking forward to was the full implementation of the V4L2 driver support for OV5693 camera h/w present with the board. Although the code changes in the kernel look promising, I am unable to see a /dev/video node being enumerated with the latest kernel and after loading the tegra_camera driver.

In fact SOC_CAMERA_OV5693 is not even enabled in the default tegra21_defconfig. I had to do a few other hacks to make sure the driver loads without any issues. There is no mention of V4L2 support for ov5693 in the release notes as well. Am I missing something?

Hi apalopohapa and dilipkumar25,

You might miss to check “Video for Linux User Guide” from L4T Driver Documentation: http://developer.nvidia.com/embedded/dlc/l4t-documentation-23-2

It should explain that you can pull raw frames from the OV5693 using V4L2 API, but the ISP will be bypassed.

Thanks

Ah yes kaycc. I missed the HTML documentation that was present. I was looking for the PDF version. But this is good enough. Let me try it out n report my results. Thanks

Hi. I wanted to update this thread and confirm that on R23.2, the V4L2 interface can be used to capture a custom MIPI CSI-2 video stream. I tested 3 channels (A, C and E), with 2 and 4 lanes, up to 1 Gbps per channel, concurrently, and it works great. You do need to register your devices as platform devices and write a custom media/i2c/soc_camera driver. The ov5693_v4l2.c can be used as an example.

That’s very interesting. Does your carrier card generate MIPI CSI-2 video stream using FPGA and/or it has MIPI CSI-2 camera interface?

@yahoo2016 Yes the FPGA provides the MIPI video streams. The signals are generated per Xilinx app note XAPP894.