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.

Problem with adding new video decoder & VPFE registers

Other Parts Discussed in Thread: TVP5146

 

Hi, everyone

I have some problems with the vpfe subsystem on dm365 and really need your help here.

Since TW2835 can digitize 4 channels analog video, so we replace the SD video decoder TVP5146 with TW2835 on our customed board. I have already finished the driver for TW2835 which I use TVP5146 driver in linux 2.6.18.pro_500 as template. TW2835 use 8 video data line and 1 pixel clock line(PCLK=27 MHZ) to connect with DM365, it can generate ITU-R BT.656 format output and the YCbCr sequence is Cb0-Y0-Cr0-Y1...

There are four things need to be done when adding new video decoder according to LSP 2.10 Davinci Linux VPFE Capture Driver:

1. In ccdc_common.c timing information for different standards are defined. Each timing information is tagged by a name. So when adding new standards to the decoder, make sure to use an existing tag or if new, add it to this file as well. Update also #define CCDC_CH0_MAX_MODES.

2. Make sure to use appropriate interface type. If existing interface types are re-used, then it might work with out any change. VPFE Capture driver reads the interface type from the decoder and pass it to CCDC for configuration. Current driver has tested BT.656, BT.1120 and Raw capture interfaces. If a different interface is to be configured, check the ccdc_xxx.c (xxx refers to SoC, example ccdc_dm355.c for DM355) module, configure() function to verify if the required settings in CCDC is done for the interface being used.

3. Currently davinci_vpfe.h defines Maximum number of decoders supported as 5. (#define VPFE_CAPTURE_NUM_DECODERS 5). For a specific system, if one or more decoder is not used, the same can be compiled out using configuration variable available for the decoder. Remember to change the above constant if number of decoders in the system crosses 5.

4. Define decoder type constant in davinci_vpfe.h and add it to vpfe_open() and vpfe_init() functions in davinci_vpfe.c

1st, 3rd and 4th are OK except the 2nd. Our digital video from TW2835 is BT.656, but some video-in pins on our customed board are different from DM365 EVM(we only use CIN0-CIN7 and PCLK pins, YIN0-YIN7, HD, VD, C_WE_FIELD pins are not used), so i don't know how to configure ISIF registers to support TW2835.

When I run encode demo on our customed board, everything seems fine except we can't get the video data from the memory, here is the console output:

 

root@192.168.1.103:/opt/dvsdk/dm365# ./loadmodules_sd.sh                        

CMEMK module: built on Mar  5 2010 at 21:04:48                                  

  Reference Linux version 2.6.18                                                

  File /home/luan/dvsdk_2_10_01_18/linuxutils_2_24_02/packages/ti/sdo/linuxutils

/cmem/src/module/cmemk.c                                                        

ioremap_nocache(0x85000000, 50331648)=0xc6000000                                

allocated heap buffer 0xc6000000 of size 0x134000                               

cmem initialized 20 pools between 0x85000000 and 0x88000000                     

CMEM Range Overlaps Kernel Physical - allowing overlap                          

CMEM phys_start (0x1000) overlaps kernel (0x80000000 -> 0x85000000)             

ioremap_nocache(0x1000, 28672)=0xc5818000                                       

no remaining memory for heap, no heap created for memory block 1                

cmem initialized 1 pools between 0x1000 and 0x8000                              

IRQK module: built on Mar  5 2010 at 21:04:50                                   

  Reference Linux version 2.6.18                                                

  File /home/luan/dvsdk_2_10_01_18/linuxutils_2_24_02/packages/ti/sdo/linuxutils

/irq/src/module/irqk.c                                                          

irqk initialized                                                                

EDMAK module: built on Mar  5 2010 at 21:04:50                                  

  Reference Linux version 2.6.18                                                

  File /home/luan/dvsdk_2_10_01_18/linuxutils_2_24_02/packages/ti/sdo/linuxutils

/edma/src/module/edmak.c                                                        

root@192.168.1.103:/opt/dvsdk/dm365# ./encode -y 2 -v test.264 -k               

Encode demo started.                                                            

tw2835_initialize : read i2c reg 0x0E -- 0x11                                   

1095 : tw2835_querystd : 0<3>

1112 : tw2835_querystd : 31<3>

1152 : tw2835_querystd : 1<3>

1095 : tw2835_querystd : 0<3>

1112 : tw2835_querystd : 31<3>

1152 : tw2835_querystd : 1<3>

775 : vpfe_get_std_info : PAL : PAL                             

tw2835_initialize : read i2c reg 0x0E -- 0x11                                   

1095 : tw2835_querystd : 8<3>

1112 : tw2835_querystd : 31<3>

1152 : tw2835_querystd : 1<3>

1095 : tw2835_querystd : 8<3>

1112 : tw2835_querystd : 31<3>

1152 : tw2835_querystd : 1<3>

775 : vpfe_get_std_info : PAL : PAL                             

775 : vpfe_get_std_info : PAL : PAL                                             

davinci_resizer davinci_resizer.2: RSZ_G_CONFIG:0:1:108                         

davinci_previewer davinci_previewer.2: ipipe_set_preview_config                 

davinci_previewer davinci_previewer.2: ipipe_set_preview_config                 

vpfe ccdc capture vpfe ccdc capture.1: IMP chained                              

vpfe ccdc capture vpfe ccdc capture.1: Resizer present                          

tw2835_initialize : read i2c reg 0x0E -- 0x11                                   

1095 : tw2835_querystd : 8<3>

1112 : tw2835_querystd : 31<3>

1152 : tw2835_querystd : 1<3>

1095 : tw2835_querystd : 8<3>

1112 : tw2835_querystd : 31<3>

1152 : tw2835_querystd : 1<3>

775 : vpfe_get_std_info : PAL : PAL                             

tw2835_initialize : read i2c reg 0x0E -- 0x11                                   

1095 : tw2835_querystd : 8<3>

1112 : tw2835_querystd : 31<3>

1152 : tw2835_querystd : 1<3>

1095 : tw2835_querystd : 8<3>

1112 : tw2835_querystd : 31<3>

1152 : tw2835_querystd : 1<3>

775 : vpfe_get_std_info : PAL : PAL                             

775 : vpfe_get_std_info : PAL : PAL                                             

vpfe ccdc capture vpfe ccdc capture.1: hpitch = 720, vpitch = 576, bpp = 1      

vpfe ccdc capture vpfe ccdc capture.1: hpitch = 720, vpitch = 576, bpp = 1      

Starting ccdc_config_ycbcr...<7>                                                

starting ccdc_reset...<7>                                                       

End of ccdc_reset...<3>                                             

Starting ccdc_setwin...<3>                                        

DavinciDisplay DavinciDisplay.1: Before finishing with S_FMT:                   

layer.pix_fmt.bytesperline = 736,                                               

 layer.pix_fmt.width = 720,                                                     

 layer.pix_fmt.height = 576,                                                    

 layer.pix_fmt.sizeimage =635904                                                

DavinciDisplay DavinciDisplay.1: pixfmt->width = 720,                           

 layer->layer_info.config.line_length= 736                                      

Command [ 'help' for usage ] > ARM Load: 15% Video fps: 0 fps Video bit rate: 0 

kbps Sound bit rate: 0 kbps Time: 00:00:01 Demo: Encode Display: D1 PAL Video Co

dec: H.264 HP Resolution: 720x576 Sound Codec: N/A Sampling Freq: N/A           

 

ARM Load: 0% Video fps: 0 fps Video bit rate: 0 kbps Sound bit rate: 0 kbps Time

: 00:00:02 Demo: Encode Display: D1 PAL Video Codec: H.264 HP Resolution: 720x57

6 Sound Codec: N/A Sampling Freq: N/A                                           

 

ARM Load: 0% Video fps: 0 fps Video bit rate: 0 kbps Sound bit rate: 0 kbps Time

: 00:00:03 Demo: Encode Display: D1 PAL Video Codec: H.264 HP Resolution: 720x57

6 Sound Codec: N/A Sampling Freq: N/A                                           

 

ARM Load: 0% Video fps: 0 fps Video bit rate: 0 kbps Sound bit rate: 0 kbps Time

: 00:00:04 Demo: Encode Display: D1 PAL Video Codec: H.264 HP Resolution: 720x57

6 Sound Codec: N/A Sampling Freq: N/A                                           

 

ARM Load: 0% Video fps: 0 fps Video bit rate: 0 kbps Sound bit rate: 0 kbps Time

: 00:00:06 Demo: Encode Display: D1 PAL Video Codec: H.264 HP Resolution: 720x57

6 Sound Codec: N/A Sampling Freq: N/A                                           

 

ARM Load: 0% Video fps: 0 fps Video bit rate: 0 kbps Sound bit rate: 0 kbps Time

: 00:00:07 Demo: Encode Display: D1 PAL Video Codec: H.264 HP Resolution: 720x57

6 Sound Codec: N/A Sampling Freq: N/A                                           

 

ARM Load: 0% Video fps: 0 fps Video bit rate: 0 kbps Sound bit rate: 0 kbps Time

: 00:00:08 Demo: Encode Display: D1 PAL Video Codec: H.264 HP Resolution: 720x57

6 Sound Codec: N/A Sampling Freq: N/A                                           

 

ARM Load: 0% Video fps: 0 fps Video bit rate: 0 kbps Sound bit rate: 0 kbps Time

: 00:00:09 Demo: Encode Display: D1 PAL Video Codec: H.264 HP Resolution: 720x57

6 Sound Codec: N/A Sampling Freq: N/A                                           

 

ARM Load: 0% Video fps: 0 fps Video bit rate: 0 kbps Sound bit rate: 0 kbps Time

: 00:00:10 Demo: Encode Display: D1 PAL Video Codec: H.264 HP Resolution: 720x57

6 Sound Codec: N/A Sampling Freq: N/A

 

the video file test.264 is 0 KB, so we debug the encode program, we find the program stop at "ioctl(capt_fd, VIDIOC_DQBUF, &buf)" in the main function, cause the status of buf is not STATUS_DONE, so we are blocked here.

I have memtioned that some ISIF registers need to be configured above, such as ISIF.MODESET, ISIF.PPLN, ISIF.LPFR, ISIF.SPH, ISIF.LNH, ISIF.LNV, ISIF.SDOFST, ISIF.CCDCFG, but i really don't know how to configure this registers, can you help me with this?