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.

Linux/AM5728: Interfacing VIP to 12-bit parallel interface camera

Part Number: AM5728


Tool/software: Linux

Hi,  I'm trying to get running a AM5728 VIP, connected to a camera with a 12-bit interface.  The camera interface uses 12-bit samples, with the samples arranged in a bayer pattern.

My question is, is this possible on the AM5728?

I can see in "http://processors.wiki.ti.com/index.php/Linux_Core_VIP_User%27s_Guide" 

Best regards,

Bob.

  • Sorry, part of my message above was omitted. In the VIP User's Guide link, it shows a number of different input pixel formats that are supported, including various options for 8-bit Bayer. What about 12-bit Bayer?
  • Hi,

    See the updated user guide:
    software-dl.ti.com/.../Foundational_Components_Kernel_Drivers.html

    How do I capture 10-bit or 12-bit YUV data?

    VIP can capture data in 8, 16 or 24 bus-width size. Configure VIP for 16 bit bus-width size in order to capture pixel of 10-bit or 12-bit size. This includes dts file configuration and pin-mux configuration. Connect the pixel size data lanes from the sensor board to VIP input port. Ground or tie to VDD remaining unused pins. VIP will receive the 10-bit/12-bit data in 16-bit container in memory with 6/4 LSb or MSb bit always being low or high based on how those unused bits are tied. Note that when capturing 10-bit/12-bit data in 16 bit container, you can not use any of the VIP internal processing module like scaling, format conversion etc.

    In dts file, specify the bus-width field as 16

    bus-width = <16>; /* Used data lines */

    Can you try this configuration in linux dts?

    Best Regards,
    Yordan
  • Hi Yordan,

    Thanks for your response. I have tried adding bus-width = <16>; to the DTS, however I think this doesn't really get to the heart of the problem. You have highlighted the issue when you write "you can not use any of the VIP internal processing module like scaling, format conversion etc."

    What I need to do on a systems level is to get input from the image sensor into the chip, and end up with a suitable compressed file. So I need to be able to get the video into a format that will suit the gstreamer components.

    If it makes it simpler, for my application using monochrome is fine, and I can put the camera into a monochrome mode easily enough. So if I have the video coming in as 12-bit monochrome, can I get it into the right format to be able to use one of the Ducati compression blocks, e.g. ducatimpeg4enc?

    Best regards,
    Bob.
  • Hi Bob,

    The H.264 and MPEG-4 video compression needs input video in YUV NV12 format. If your camera cannot capture in YUV format, you may need to use software module to convert the input captured video from 12 bit RAW BAYER to 8 bit NV12 format. You can try gstreamer plugin videoconvert to convert the video format before feeding it to ducati plugin.
  • Hi Manisha,

    Thanks for this.  Using bayer2rgb and videoconvert, I now have a pipeline that does 8-bit Bayer through to MPEG-4.  So that's further forward than I was before.

    I still need to get the 12-bit version running.  Presumably this means that I need a 12-bit or 16-bit format for the VIP, v4l2src, and bayer2rgb?  VIP seems to have a 16-bit format, i.e. MEDIA_BUS_FMT_SBGGR16_1X16, however that doesn't seem to line up with any of the capabilities in v4l2src.  What do I need to do to get these connected?

    I also have the option of using monochrome.  v4l2src supports GRAY16_LE and GRAY16_BE.  However, there doesn't seem to be a corresponding format for the VIP driver.  What would I need to do to get this going?

    Best regards,

    Bob.

  • Hi Bob,

    The limitation is coming from v4l2src gstreamer plugin. You may want to hack either the v4l2src plugin or seek the gstreamer community help or may want to try another hack suggestion as below.

    Gstreamer RGB16 video formats translates to V4L2_PIX_FMT_RGB565, which is a 16 bit format. So If you need a 16 bit raw format hack compatible with gstreamer then you may want to modify the V4L2_PIX_FMT_SBGGR16 block in vip.c and make the .fourcc = V4L2_PIX_FMT_Y16 instead and see how far you’ll get with that.

    Regards,
    Manisha