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.

Configure VPFE driver in FVID_YCbCr422_INTERLEAVED mode

Other Parts Discussed in Thread: TVP5146

Hi everyone

I'm trying to get input from an Aptina mt9v135 imager into my DM6437 using the BIOS VPFE driver. The imager outputs YCbCr 4:2:2 data by default, which is exactly the format I want.

My first try was to test my imager, using the SD test code that came with my DVM. Here the imager works perfectly following their video_loopback example (<SD install directory>\boards\evmdm6437_v2\tests\video_loopback)

Next, I'm trying to get the imager to work through DSP/BIOS. I've specified my parameters as:

static PSP_VPFECcdcConfigParams ccdcParamsVideo1 =
{
    FVID_YCbCr422_INTERLEAVED,                /* dataFlow     */
    FVID_FRAME_MODE,                                     /* ffMode       */
    480,                                                                    /* height       */
    720,                                                                    /* width        */
    (720*2),                                                             /* pitch        */
    0,                                                                        /* horzStartPix */
    0,                                                                        /* vertStartPix */
    NULL,                                                                /* appCallback  */
    {
        NULL,                                                           /* extVD Fxn    */
        NULL,
        NULL,
    },
    0                                                                     
};

This always comes back with a NULL. Stepping through the PSP code, I find that in DDC_VPFEConfigCcdcParams() in C:\dvsdk_1_01_00_15\psp_1_00_02_00\pspdrivers\drivers\vpfe\srcddc_vpfeCcdc.c only the FVID_CCDC_YCBCR_8 and FVID_CCDC_RAW_FORMAT cases seem to be handled.

What would be the best way for me to get my code to work with DSP/BIOS? Should I try to extend the current driver to deal with my imager?

Any help/pointers would be appreciated

 

  • Leon de Wit said:
    My first try was to test my imager, using the SD test code that came with my DVM. Here the imager works perfectly following their video_loopback example (<SD install directory>\boards\evmdm6437_v2\tests\video_loopback)

    If this is the case than you may want to start with a simpler example that happens to use BIOS, the rough equivalent to video_loopback from the SD tests is C:\dvsdk_1_01_00_15\examples\video_preview\evmDM6437. If the imager is outputting a bt.656 stream, which I imagine it was if video_loopback worked, than this should work as well, unless it is tripping up on some TVP5146 configuration, since the driver just expects bt.656 standard video on the input bus, so it should look the same coming from  your imager or the TVP5146.

  • Hi Bernie

    Thanks very much for the reply. I'll go and look up the example you suggested and try on the dev kit.

    We need to get this working on our own hardware though, and I won't have a TVP5146. In stead, the camera has been connected directly to the input port on the DSP. We've done this because we knew our imager could output BT.656 YCbCr 4:2:2, and thus we reasoned we would not need the TVP5146. It is on our own hardware really that we have the SD example code running. I apologise for not being clear on this earlier.

    Using the driver in FVID_CCDC_YCBCR_8 mode seems to require the TVP5146. It now seems I shall definitely need to modify this driver in order to compensate for the lack of the TVP5146. Am I correct in this assumption? Can you offer any tips, besides looking reallu closely at the current driver code of course =)

    Many thanks again for your input

    Leon

  • Leon de Wit said:
    We need to get this working on our own hardware though, and I won't have a TVP5146. In stead, the camera has been connected directly to the input port on the DSP. We've done this because we knew our imager could output BT.656 YCbCr 4:2:2, and thus we reasoned we would not need the TVP5146. It is on our own hardware really that we have the SD example code running. I apologise for not being clear on this earlier.

    This makes sense, I was not sure if you had a daughterboard on the EVM or if this was fully custom hardware with no TVP5146 available. If you did this on the EVM with a daughtercard than the TVP5146 would still be there to configure by the driver even if you were not using it, since I only have an EVM that has the TVP5146 on it I am not sure of the driver failure pattern when you run it without the TVP5146 on the I2C bus.

    Leon de Wit said:
    Using the driver in FVID_CCDC_YCBCR_8 mode seems to require the TVP5146. It now seems I shall definitely need to modify this driver in order to compensate for the lack of the TVP5146. Am I correct in this assumption? Can you offer any tips, besides looking reallu closely at the current driver code of course =)

    That is about right though not necessarily the driver itself, but at least the driver configuration structures you pass into the driver from the application code. If your camera sensor is already configured to output bt.656 and it requires no additional configuration than all you would need to do is remove the TVP5146 functionality, which I believe you can do by substituting your own functions in place of TVP5146_Open, TVP5146_Close, and TVP5146_Control which go into the VPFECcdcConfigParams structure you use to call FVID_create (this is discussed in the VPFE driver user's guide C:\dvsdk_1_01_00_15\psp_1_00_02_00\pspdrivers\drivers\vpfe\doc\BIOS_VPFE_Driver_UserGuide.pdf). Most of the examples cover this with a default configuration that already contains these, so you would just have to create your own structure instead of just using the default. In theory you could put your own camera activation functions in there, though it sounds like you would not need them if your sensor is already ready.

  • Hi Bernie

    Using the example you suggested I got this to work. As you expected, very little modification of the example code was required. I needed to change the DDC_VPFEConfigCcdcParams(...) function in ddc_vpfeCcdc to accept NULLS in place of the TVP5146 configuration and control functions, but otherwise reading from the image stream turned out to be simple.

    On the display side, I found that the example code did not set up the VPSS_CLK_CTRL and VPBE_VENC_DACTST registers the way I wanted. After changing this I've been able to display the imager output without any problems.

    Thanks again for your help!

    Leon

  • I am glad to hear you were able to make the modifications to do this easily, thank you for posting your results to the forum, I suspect others can base their modifications on this concept.