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.

Error with FVID VPFE driver config for 480x640 bt.656 input on DM6437

Other Parts Discussed in Thread: TVP5146

Hi,

     I have some problems running my video application with a  480x640 sensor as the video input.

       i'm working on a custom board with a DM6437 DSP. The application I am using was designed on the DM6437EVM. I have done three iterations of this application. They are:

- running the application on the EVM with the TVP5146 videodecoder as the video source. The application runs correctly.

- running the application on the the custom board with another videodecoder as the video source. The application runs correctly.

- running the application with the 640x480 imager as video source, the application creates an error. Note that my test application (that is not using the FVID driver, is working very well so it's should not be a hardware issue. I have also verified that the data reaches the DSP).

Both imager and videodecoder use BT656 sync embedding.

Here is the most flagrant symptom of the error. In the code below, when using the videodecoder (i.e. the application is working), when the code returns from the FVID_dequeue function, the apphandle->frameBuffPtr is properly set. When using the imager, this pointer is not set correctly, which causes everything that follows to fail (capture, resizer and processing). This leaves me to beleive that it is because the hGioVpfeCcdc object is not correctly configured.

if (status == 0)
    {
       for (i=0; i<FRAME_BUFF_CNT && status == 0; i++)
       {
            result = FVID_allocBuffer(hGioVpfeCcdc, &frameBuffTable[i]);
            status = (result == IOM_COMPLETED && frameBuffTable[i] != NULL ? 0 : -1);
       }
    }

    // prime up the video capture channel
    if (status == 0) {
        FVID_queue(hGioVpfeCcdc, frameBuffTable[0]);
        FVID_queue(hGioVpfeCcdc, frameBuffTable[1]);
        FVID_queue(hGioVpfeCcdc, frameBuffTable[2]);
    }

    // prime up the video display channel
    if (status == 0) {
        FVID_queue(hGioVpbeVid0, frameBuffTable[3]);
        FVID_queue(hGioVpbeVid0, frameBuffTable[4]);
        FVID_queue(hGioVpbeVid0, frameBuffTable[5]);
    }

    // grab first buffer from input queue
    if (status == 0)
    {
        FVID_dequeue(hGioVpfeCcdc, &apphandle->frameBuffPtr);
    }

I am not familliar enough with the FVID driver to pinpoint where I go wrong.

The only changes I do from videodecoder to imager is changing the input width to 640 where it is set to 720 before.

Here is the vpfe structure I pass to the FVID_Create function:

#define VID_PARAMS_CCDC_IMAGER {                                 \
    FVID_CCDC_YCBCR_8,                  /* dataFlow     */            \
    FVID_FRAME_MODE,                    /* ffMode       */            \
    640,                                /* height       */            \
    480,                                /* width        */            \
    (640 * 2),                          /* pitch        */            \
    0,                                  /* horzStartPix */            \
    0,                                 /* vertStartPix */            \
    NULL,                               /* appCallback  */              \
    {                                                                   \
        PSP_VPFE_TVP5146_Open,         /* extVD Fxn    */            \
        PSP_VPFE_TVP5146_Close,                                          \
        PSP_VPFE_TVP5146_Control,                                     \
    },                                                                  \
    0                                   /*segId         */              \
}

I have noticed that when I change the ffMode to FVID_FIELD_MODE, the FVID_Create call fails.

Have any of you dealt with something like this before?

Do you have any hints on where I go wrong?

 

 

 

  • PSP_VPFECcdcConfigParams vpfeCcdcConfigParams = {
        PSP_VPFE_CCDC_RAW,              /* dataFlow     */
        PSP_VPSS_FRAME_MODE,                /* ffMode       */
        480                                /* height       */
        640                                /* width        */
        640,                            /* pitch        */
        0,                                  /* horzStartPix */
        0,                                  /* vertStartPix */
        NULL,                               /* appCallback  */ 
        {
           // PSP_VPFE_TVP5146_Open,        // extVD Fxn   
           // PSP_VPFE_TVP5146_Close,  
           // PSP_VPFE_TVP5146_Control,
        NULL,
        },
        0,         /*segId         */
        {
         8,    
        /**< Input data width; 8-16 bits                    */ 
         PSP_VPFE_PACK8_8BITS_PIXEL,        
        /**< Data stored as 16bit/pixel or 8bit/pixel       */
         PSP_VPFE_DataPol_Normal,      
        /**< Data polarity; Normal/1's compliment               */
         PSP_VPFE_SyncPol_Positive,    
        /**< VD Sync polarity                               */
         PSP_VPFE_SyncPol_Positive,    
        /**< HD Sync polarity                               */
         PSP_VPFE_SyncDir_Input,   
        /**< Master or slave mode for VD and HD signals         */
         0,  
        /**< Width of HD Sync pulse                             */
         0,  
        /**< Width of the VD Sync pulse                         */
         640,
        /**< Number of pixel clock periods in one line      */
         480,
        /**< Number of lines per field                      */
         PSP_VPFE_ALaw_Disable,
        /**< This parameters enables/Disables ALaw packig   */
         PSP_VPFE_ALaw_bits15_6
        /**< This parameter sets the ALaw gamma bit selection   */
        }                        
    };

    ====================================================
    I hope this code can give you some help,I used it to capture a sensor image.

    maybe you can tell us which sensor you used,that can make more advice for you

  • The imager I am using is  a Micron MT9V111 SOC.

  • The problem here is that the sensor you have is not providing a true bt.656 stream, as it is not providing NTSC or PAL standard video, it looks like it generates a 640x480 progressive signal whereas the video driver is going to be expecting a 720x480 interlaced signal, the width is probably adjusted by your driver settings however the interlaced vs progressive is a significant change in how the driver would have to handle things and may not be supported in the driver out of the box, as the bt.656 capture mode is only tested with normal signals (i.e. the TVP5146 video decoder). This being said, you will likely have to make some modifications to the inner workings of the driver to get it to handle this new format.

    Along these lines I would start by adding in the video capture driver source files into your project (i.e. the files in dvsdk_1_01_00_15\psp_1_00_02_00\pspdrivers\drivers\vpfe\src), if you just drag and drop them in they should build with your project and be used instead of the original driver libraries, this allows you both to debug and watch closely where it is going wrong internally as well as to make changes to the driver on the fly. You should be able to set breakpoints within the driver files to examine what is going wrong, the first area I would check is where the FVID_FIELD_MODE setting is failing during the FVID_Create call, as this is a setting you would need to capture a progressive input.

  • Thank you Bernie,

            I have modified the vpfe config driver to allow it to use field mode and I am getting my images. Thanks a lot.

  • Hi Dom,

    Iam also trying to get the progressive mode from TVP5146 driver.

    Could you please share how did u modify the vpfe config driver to allow progressive mode with me?

    Thanks ,

    Thupakula.