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.

how to de-multiplexed 2-Ch video from tvp5158 in vpfe of 6437?

Other Parts Discussed in Thread: TVP5158

Hi, all

   My board is 6437 interfacing TVP5158.  2-Ch D1 video from tvp5158 go to vpfe of 6437 with Dual BT.656.  but how to config tvp5158 and vpfe to   de-multiplexed 2-Ch video in 6437?

  I am using the line-interleaved mode, but it doen't work.

 I config the tvp5158 like this:

       tvp5158_rset( 0xB0, 0x90 );
       tvp5158_rset( 0xB1, 0x11 );
       tvp5158_rset( 0xB4, 0xD8 );
       tvp5158_rset( 0xB6, 0xE3 );
       tvp5158_rset( 0xB7, 0x14 );
       tvp5158_rset( 0xB8, 0x40 );
       tvp5158_rset( 0xB9, 0x00 );
       tvp5158_rset( 0xB2, 0x25 );

 I config VPFE refer to  "loop-back"  example of  EVM6437  like this :
 

  width   = 720;
   height  = 576*2;         // my video is PAL

   VPFE_CCDC_SYN_MODE  = 0x00032F84;
   VPFE_CCDC_HD_VD_WID = 0;
   VPFE_CCDC_PIX_LINES = 0x02CF04E2;
   VPFE_CCDC_HORZ_INFO = width << 1;   // Horizontal lines
   VPFE_CCDC_HSIZE_OFF = width << 1;   // Horizontal line offset
   VPFE_CCDC_VERT_START = 0;           // Vertical start line
   VPFE_CCDC_VERT_LINES = height >> 1; // Vertical lines
   VPFE_CCDC_CULLING   = 0xFFFF00FF;   // Disable cullng


   VPFE_CCDC_SDOFST    = 0x00000249;
   VPFE_CCDC_SDR_ADDR  = video_buffer;
   VPFE_CCDC_CLAMP     = 0;
   VPFE_CCDC_DCSUB     = 0;
   VPFE_CCDC_COLPTN    = 0xEE44EE44;
   VPFE_CCDC_BLKCMP    = 0;
   VPFE_CCDC_FPC_ADDR  = 0x86800000;
   VPFE_CCDC_FPC       = 0;
   VPFE_CCDC_VDINT     = 0;
   VPFE_CCDC_ALAW      = 0;
   VPFE_CCDC_REC656IF  = 0x00000003;

   VPFE_CCDC_CCDCFG    = 0x00000800;
   VPFE_CCDC_FMTCFG    = 0;
   VPFE_CCDC_FMT_HORZ  = 0x000002D0;
   VPFE_CCDC_FMT_VERT  = 0x00000480;
   VPFE_CCDC_FMT_ADDR0 = 0;
   VPFE_CCDC_FMT_ADDR1 = 0;
   VPFE_CCDC_FMT_ADDR2 = 0;
   VPFE_CCDC_FMT_ADDR3 = 0;
   VPFE_CCDC_FMT_ADDR4 = 0;
   VPFE_CCDC_FMT_ADDR5 = 0;
   VPFE_CCDC_FMT_ADDR6 = 0;
   VPFE_CCDC_FMT_ADDR7 = 0;
   VPFE_CCDC_PRGEVEN_0 = 0;
   VPFE_CCDC_PRGEVEN_1 = 0;
   VPFE_CCDC_PRGODD_0  = 0;
   VPFE_CCDC_PRGODD_1  = 0;
   VPFE_CCDC_VP_OUT    = 0x09C42D00;

   VPFE_CCDC_PCR       = 0x00000001;   // Enable CCDC

It doesn't work .

Can anyone tell me how to config the tvp5158 and vpfe of 6437? or some sample code?

thanks a lot!

 

  • Unfortunately I don't believe there are any example implementations or source code for the DM6437 to interface to a TVP5158, though it should be possible. There is a DM365 based DVR reference design that uses the TVP5158 that may be of some interest, as the DM365 has a similar VPFE to the DM6437, so the register settings will be similar, the problem is that the DM365 is ARM based so the driver is a Linux driver and would take some effort to port to a DSP only device like DM6437, and that the source does not seem to be available without purchasing the kit.

    As to the problem at hand, when you say it doesn't work, how is it not working? Are you getting events from the VPFE with bad video data or are you not getting any events from the VPFE at all?

  • thank u for your reply.

    Yes, i get video data from the VPFE, but the video is not right:

    1. I config the VPFE to get two PAL vdieo, that means a super-frame of 576*2. In the super-frame, there is no any data in odd line, in even line, video data is gathered from 2ch video.

    2.The video data in even line is composed of two 576/2 video, i split  the 576 lines video data to two image according to interlaced order . please refer to the attached 2 pics.

    I think befor the proper configuration of vpfe of 6437 will de-multiplexed 2Ch video automatically by hardware. now i know i must write code and consume cpu load to  de-multiplexed 2Ch video manually by identify the start code after SAV/EAV.

    i am working hard for this.

  • hi Guishanjun, we also meet the same problems with TVP5158 to DM6437 for multi-channel application. how about your problem?

  • Guishanjun said:
    now i know i must write code and consume cpu load to  de-multiplexed 2Ch video manually by identify the start code after SAV/EAV.

    This is probably a good way to start since it is easiest to debug de-multiplexing issues when working within the software, in the long run you probably want to use the DMA to de-multiplex the streams so it is more efficient, as this would take less CPU overhead.

    As to your video streams, it looks like there are synchronization problems with an offset vertically so it may be worth verifying the VPFE settings, though this could also be an artifact of problems with the de-multiplexing

  • We are planning to de-multiplexed 4-Ch video from tvp5158 in vpfe of 6437, 

    Is it possible?


  • Rex Liao said:

    We are planning to de-multiplexed 4-Ch video from tvp5158 in vpfe of 6437, 

    Is it possible?

    This should be possible, but you would have to customize the DM6437 capture driver to manage the capture and de-multiplexing of the streams.

  • Hi Bernie,

    Thanks for your reply. One more question needs your help.

    If 4-ch video are all D1 resolution, does 6437 can connect with TVP5158 using 4-Ch D1 (16Bit@54MHz) configuration.

    does video capture performance still can achieve 30fps?

     

     

  • Rex Liao said:

    If 4-ch video are all D1 resolution, does 6437 can connect with TVP5158 using 4-Ch D1 (16Bit@54MHz) configuration.

    does video capture performance still can achieve 30fps?

    It looks like this configuration is not possible, the DM6437 only supports embedded syncs in bt.656 mode which only supports an 8 or 10 bit wide bus, and the TVP5158 only supports embedded syncs, no external syncs.

    If it was possible you would still be able to achieve 30fps of capture, however that would be a lot of data for a single DM6437 to process if you intended to do some sort of video compression or advanced video processing, so you may find yourself performance limited with 4 channels of D1.

  • Hi Bernie,

    Thanks for your kindly reply.

    Currently, our critical path is using EDMA to capture 4-ch D1 video at 30fps to DDR RAM.

    So I got the conclusion is "DM6437 can not act as DM6467 to connect TVP5158 under either one of below 4-ch D1 applications"  .

    Is it right?

  • Rex Liao said:

    So I got the conclusion is "DM6437 can not act as DM6467 to connect TVP5158 under either one of below 4-ch D1 applications"  .

    Is it right?

    This is true. For the first implementation of 8bit at 108MHz this is not possible as the DM6437 has a maximum pixel clock of around 98MHz, 108MHz would be out of spec. For the second implementation this is not possible because of the reasons mentioned in my prior post, namely TVP5158 not providing external syncs and DM6437 being unable to capture 16 bit wide data without external syncs.

    The DM6467 uses a different video port mechanism known as VPIF, which is a simpler interface in many ways but that happens to support bt.1120 with embedded syncs for 16bit wide data.

  • Hi all ,

    I am  trying to interface TVP 5158 in 4 channel D1  line multiplexed mode with DM6467 processor using TVP5158 EVM .

    I am trying to  know the behavior of 5158 in line multiplexed mode, I have listed my observation from experiments conducted

    ·         Channel ( camera instance ) order which TVP 5158 sending is not constant, it is changing randomly .

    o   Is it possible to make the this order constant ?

    ·         I have observed that TVP5158 is sending lot of dummy lines  with “channel id= 1 “  and “line count= 129

    o   Is this known ?

    Is there any solution to avoid  this . Otherwise i need to look at each line in a frame to identify which camera it belongs. Any help on this will be useful

  • Thank you very much.

    Bernie Thompson said:

    This is true. For the first implementation of 8bit at 108MHz this is not possible as the DM6437 has a maximum pixel clock of around 98MHz, 108MHz would be out of spec.

     

    Does "maximum pixel " mean the clock of VPFE? I want to use TVP5158 in the mode of line-interleaved(4-ch ,8bit at 108MHz).Can it be possible?

  • zhao yanjie said:
    Does "maximum pixel " mean the clock of VPFE?

    That is right, the maximum clock of the VPFE is ~98MHz, as per table 6-35 of the DM6437 datasheet.

    zhao yanjie said:
    I want to use TVP5158 in the mode of line-interleaved(4-ch ,8bit at 108MHz).Can it be possible?

    I am afraid this is not possible with the DM6437, 108MHz is too fast for the VPFE of the DM6437, it is out of spec so it is not supported and there is a good possibility it will either fail entirely at this rate or will fail intermittently.

  • When tvp5158 works under linee-interleaved mode,the datasheet said that:

    the start code will be inserted following the SAV in super-frame.And the Channel ID is included in start code(SC3).

    1、Does tvp5158 can auto judge the Channel ID and auto set the channel ID in start code?

    2、Or should I set some register,and the value of the register will be the value of channel ID in start code?

    3、if 2 is YES,which register should I set.The register 0xB4?or others?

    I am so eager for your help!!!

    Wish you happy!!

  • I have a question About Timer  of TVP5158.

    If the sensor outputs the 15fps to TVP5158, Can  TVP5158 outputs the 15fps video  data with  mode of 4-CH D1 ?

    If the timer of TVP5158 is changed from 27MHz to 13.5MHz, can  TVP5158 outputs the 15fps video  data with  mode of 4-CH D1 ?

    Could you help me?