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.

capture link with 1600x1200(UXGA) capture

Other Parts Discussed in Thread: TVP7002

Hi,

I tried to capture 1600x1200 video source on my custom dm8168 board.

My RDK is 04.00.00.03, chip revision ES2.0.

Run capture display demo link (I have set capture standard to SYSTEM_STD_UXGA_60):

Capture link -> swms link -> display link

here is log:

0: SYSTEM: System Common Init in progress !!!
0: SYSTEM: IPC init in progress !!!
16: SYSTEM: CPU [DSP] syslink proc ID is [0] !!!
16: SYSTEM: CPU [VIDEO-M3] syslink proc ID is [1] !!!
16: SYSTEM: CPU [VPSS-M3] syslink proc ID is [2] !!!
16: SYSTEM: CPU [HOST] syslink proc ID is [3] !!!
16: SYSTEM: Creating MsgQ Heap [IPC_MSGQ_MSG_HEAP_3] ...
20: SYSTEM: Creating MsgQ [HOST_MSGQ] ...
22: SYSTEM: Creating MsgQ [HOST_ACK_MSGQ] ...
24: SYSTEM: Opening MsgQ [DSP_MSGQ] ...
25: SYSTEM: Opening MsgQ [VIDEO-M3_MSGQ] ...
26: SYSTEM: Opening MsgQ [VPSS-M3_MSGQ] ...
27: SYSTEM: Notify register to [DSP] line 0, event 15 ...
28: SYSTEM: Notify register to [VIDEO-M3] line 0, event 15 ...
29: SYSTEM: Notify register to [VPSS-M3] line 0, event 15 ...
30: SYSTEM: IPC init DONE !!!
31: SYSTEM: Creating ListMP [HOST_IPC_OUT_24] in region 0 ...
34: SYSTEM: Creating ListMP [HOST_IPC_IN_24] in region 0 ...
36: SYSTEM: ListElem Shared Addr = 0x44491a80
38: SYSTEM: Creating ListMP [HOST_IPC_OUT_25] in region 0 ...
41: SYSTEM: Creating ListMP [HOST_IPC_IN_25] in region 0 ...
43: SYSTEM: ListElem Shared Addr = 0x444c7c00
45: SYSTEM: Creating ListMP [HOST_IPC_OUT_19] in region 0 ...
48: SYSTEM: Creating ListMP [HOST_IPC_IN_19] in region 0 ...
50: SYSTEM: ListElem Shared Addr = 0x44509f80
51: SYSTEM: Creating ListMP [HOST_IPC_OUT_20] in region 0 ...
54: SYSTEM: Creating ListMP [HOST_IPC_IN_20] in region 0 ...
56: SYSTEM: ListElem Shared Addr = 0x4454d280
58: SYSTEM: Creating ListMP [HOST_IPC_OUT_21] in region 0 ...
61: SYSTEM: Creating ListMP [HOST_IPC_IN_21] in region 0 ...
63: SYSTEM: ListElem Shared Addr = 0x44590000
80: SYSTEM: System Common Init Done !!!
111: MCFW  : CPU Revision [ES2.0] !!!
[m3vpss ]  1149618: CAPTURE: Create in progress !!!
[m3vpss ]  1149648: CAPTURE: VIP0 PortA capture mode is [16-bit, Non-mux Embedded Sync] !!!
[m3vpss ]  1149846: CAPTURE: VIP1 PortA capture mode is [16-bit, Non-mux Embedded Sync] !!!
[m3vpss ]  UTILS: DMA: Allocated CH (TCC) = 58 (58)
[m3vpss ]  UTILS: DMA: 0 of 4: Allocated PaRAM = 58 (0x49004740)
[m3vpss ]  UTILS: DMA: 1 of 4: Allocated PaRAM = 64 (0x49004800)
[m3vpss ]  UTILS: DMA: 2 of 4: Allocated PaRAM = 65 (0x49004820)
[m3vpss ]  UTILS: DMA: 3 of 4: Allocated PaRAM = 66 (0x49004840)
[m3vpss ] CAPTURE::HEAPID:0        USED:520
[m3vpss ] CAPTURE::HEAPID:4        USED:88627200
[m3vpss ]  1150044: CAPTURE: Create Done !!!
[m3vpss ]  1150045: SWMS: Create in progress !!!
[m3vpss ] SwMsLink_drvCreateOutInfo[link: 536870960] outFrameFormat width 1920 height 1080 pitch[3840 0 0]
[m3vpss ]  UTILS: DMA: Allocated CH (TCC) = 59 (59)
[m3vpss ]  UTILS: DMA: 0 of 1: Allocated PaRAM = 59 (0x49004760)
[m3vpss ] SWMS: instance 0, sc id 5, start win 0 end win 17
[m3vpss ]  1150149: SWMS0    : Loading Vertical Co-effs (UPSCALE)x ...
[m3vpss ]  1150149: SWMS0    : Loading Horizontal Co-effs (UPSCALE)x ...
[m3vpss ]  1150149: SWMS    : Co-effs Loading ... DONE !!!
[m3vpss ] AVSYNC:WARNING!! Application wrongly configureddisplayID[-1]. Reseting to correct displayID[0]
[m3vpss ] SwMsLink_drvSwitchLayout layoutParams outputWidth 0 outputHeight 0
[m3vpss ] SwMsLink_drvSwitchLayout(linkId: 536870960): outFrameFormat width 1920 height 1080 pitch [3840 0 0]
[m3vpss ]  1150150: SWMS    : ******* Configuring clock 30 secs...
[m3vpss ]  1150150: SWMS0    : Loading Vertical Co-effs (14/16)x ...
[m3vpss ]  1150150: SWMS0    : Loading Horizontal Co-effs (UPSCALE)x ...
[m3vpss ]  1150150: SWMS    : Co-effs Loading ... DONE !!!
[m3vpss ]  
[m3vpss ]  *** [SWMS0] Mosaic Parameters ***
[m3vpss ]  
[m3vpss ]  Output FPS: 30
[m3vpss ]  
[m3vpss ]  Win | Ch  | Input      | Input          | Input         | Input       | Output     |  Output         | Output        | Output      | Low Cost | SWMS | Data  | Blank |
[m3vpss ]  Num | Num | Start X, Y | Width x Height | Pitch Y / C   | Memory Type | Start X, Y |  Width x Height | Pitch Y / C   | Memory Type | ON / OFF | Inst | Format| Frame |
[m3vpss ]  ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
[m3vpss ]    0 |   0 |    0,    0 |  1600 x   1200 |  3200 /  3200 | NON-TILED   |    0,    0 |  1920 x   1080 |  3840 /      0 | NON-TILED   |      OFF |    0 |  422I  |   OFF |
[m3vpss ]  
[m3vpss ] SWMS:HEAPID:0    USED:224
[m3vpss ] SWMS:HEAPID:1    USED:47296
[m3vpss ] SWMS:HEAPID:4    USED:20736000
[m3vpss ]  1150152: SWMS: Create Done !!!
[m3vpss ]  1150152: DISPLAY: Create in progress !!!
[m3vpss ]  1150153: DISPLAY: Create Done !!!
[m3vpss ]  1150157: DISPLAY: Start in progress !!!
[m3vpss ]  1150208: DISPLAY: Start Done !!!
[m3vpss ]  1150208: DISPLAY: HDDAC(BP0) : 39 fps, Latency (Min / Max) = ( 255 / 0 ), Callback Interval (Min / Max) = ( 255 / 0 ) DropCount:0 DispLatency (Min / Max) = ( 7811 / 0 ) !!!
[m3vpss ]  1150209: SWMS: Start in Progress !!!
[m3vpss ]  1150209: SWMS: Start Done !!!
[m3vpss ]  1150209: DISPLAY DRV: HDDAC(BP0) : Q:[2] Display:[2], Repeat:[1], DQ:[0]
[m3vpss ]  1150209: DISPLAY: UNDERFLOW COUNT: HDMI(BP0) 21476, HDDAC(BP0) 21476, DVO2(BP1) 43842, SDDAC(SEC1) 43689
[m3vpss ]  1150209: SYSTEM  : FREE SPACE : System Heap      = 67632 B, Mbx = 10238 msgs)
[m3vpss ]  1150209: SYSTEM  : FREE SPACE : SR0 Heap         = 16834560 B (16 MB)
[m3vpss ]  1150209: SYSTEM  : FREE SPACE : Frame Buffer     = 557415296 B (531 MB)
[m3vpss ]  1150210: SYSTEM  : FREE SPACE : Bitstream Buffer = 291504000 B (277 MB)
[m3vpss ] TILER_STATS: CNT :8BIT
[m3vpss ] TILER_STATS: CNT RESOLUTION:    16384 x 8192
[m3vpss ] TILER_STATS: BUCKET RESOLUTION: 16384 x 8188
[m3vpss ] TILER_STATS: NUM FREE BUCKETS:  1
[m3vpss ]  1150210: CAPTURE: Start in progress !!!
[m3vpss ] TILER_STATS: NUM USED BUCKETS:  0
[m3vpss ] TILER_STATS: TOTAL FREE AREA:   134152192 (99 %)
[m3vpss ] TILER_STATS: TOTAL USED AREA:   0 (0 %)
[m3vpss ] TILER_STATS: CNT :16BIT
[m3vpss ] TILER_STATS: CNT RESOLUTION:    32768 x 4096
[m3vpss ] TILER_STATS: BUCKET RESOLUTION: 32768 x 4096
[m3vpss ] TILER_STATS: NUM FREE BUCKETS:  1
[m3vpss ] TILER_STATS: NUM USED BUCKETS:  0
[m3vpss ] TILER_STATS: TOTAL FREE AREA:   134217728 (100 %)
[m3vpss ] TILER_STATS: TOTAL USED AREA:   0 (0 %)
[m3vpss ]  1150211: SYSTEM  : FREE SPACE : Tiler 8-bit      = 134152192 B (127 MB)  - TILER ON
[m3vpss ]  1150211: SYSTEM  : FREE SPACE : Tiler 16-bit     = 134217728 B (128 MB)  - TILER ON
[m3vpss ]  1150310: CAPTURE: Enabled Time Stamping !!!
[m3vpss ]  1150316: CAPTURE: Enabled Time Stamping !!!
[m3vpss ]  1150324: CAPTURE: Start Done !!!

It could capture 1600x1200 video and display successfully.

But now, I meet a problem.

When this chain capture source resolution is unexpected(not normal video, large than 1600x1200)

The chain seems  something wrong after capturing unexpected resolution.

When I press 'i'  to print detailed system information, log as below:

[m3vpss ]  
[m3vpss ]  *** Capture Driver Advanced Statistics ***
[m3vpss ]  
[m3vpss ]  VIP Parser Reset Count : 1
[m3vpss ]  
[m3vpss ]      |   Total    Even     Odd  Total  Even   Odd  Min /  Max  Min /  Max Dropped Fid Repeat Frame Error Y/C
[m3vpss ]  CH  |  Fields  Fields  Fields    FPS   FPS   FPS       Width      Height  Fields      Count (Desc Error Y/C)
[m3vpss ]  ------------------------------------------------------------------------------------------------------------
[m3vpss ]  000 |    8885    7545    1340     51    44     7 1920 / 1920   17 / 3626       1          0 0/0 (0/0)
[m3vpss ]  200 |       1       1       0      0     0     0 65535 /    0 65535 /    0       1          0 0/0 (0/0)
[m3vpss ]  
[m3vpss ]  VIP Capture Port 0 | DescMissMatch1 = 0, DescMissMatch2 = 0 , DescMissMatch3 = 0
[m3vpss ]  VIP Capture Port 2 | DescMissMatch1 = 0, DescMissMatch2 = 0 , DescMissMatch3 = 0
[m3vpss ]  
[m3vpss ]  *** Capture List Manager Advanced Statistics ***
[m3vpss ]  
[m3vpss ]  List Post Count        : 388575
[m3vpss ]  List Stall Count       : 0
[m3vpss ]  List Post Time (ms)    : Max = 0, Min = 0, Avg = 0, Total = 0
[m3vpss ]  INTC Timeout Count     : (0, 0) (Min timeout value = 981, 991)
[m3vpss ]  Descriptor miss found count : 0
[m3vpss ]  
[m3vpss ]  
[m3vpss ]  VIP and VPDMA registers,
[m3vpss ]  VIP0 : FIQ_STATUS  : 0x4810551c = 0x00000000
[m3vpss ]  VIP1 : FIQ_STATUS  : 0x48105a1c = 0x00000000
[m3vpss ]  VPDMA: LIST_BUSY   : 0x4810d00c = 0x00020000
[m3vpss ]  
[m3vpss ]  
[m3vpss ]  2197689: CAPTURE: Fields = 8884 (fps = 51, CPU Load = 0)
[m3vpss ]  2197689: CAPTURE: Num Resets = 0 (Avg 0 ms per reset)
[m3vpss ]  2197689: SYSTEM  : FREE SPACE : System Heap      = 67632 B, Mbx = 10239 msgs)
[m3vpss ]  2197689: SYSTEM  : FREE SPACE : SR0 Heap         = 16833152 B (16 MB)

>>>>>> program hangs...

From capture driver statistics, the max height is 3626. Does it cause this issue?

I have changed capture standard to SYSTEM_STD_1080P_60 and try it again.

Program works fine and the max height of capture driver statistics seems limited to 1080.

As I know, maxOutHeight = VPS_CAPT_MAX_OUT_HEIGHT_UNLIMITED in capture driver when capture standard is SYSTEM_STD_UXGA_60. Does it casue this issue?

Any helps will be appreciate.

BR,

Steven

  • Since height is greater than 1080 the VIP maxOutHeight will be set to unlimited and this will cause memory corruption if there is problem with input signal causing large frame to be captured.

  • Hi Badri,

    Very thanks for quick reply!

    Is it possible to enlarge the VIP maxOutHeight from 1080 to 1200 ? Or it is VIP hardware limitation?

    Because we cant control the external video source that user used, so if user want to capture 1600x1200 video, it is risky to cause memory corruption and program will be not normal.

    In such a case, we cant support 1600x1200 capture for customer.

    Does any suggestions for this issue?

    Thanks very much!

    BR

    Steven

  • Hi Steven,

     

    Can you setting up the cropping in VIP in the capture link? it should be able to prevent more than 1200 lines on ES2.0.

     

    Regards,

    Brijesh Jadav

  • Hi Brijesh,

    Thanks so much!

    After setting up the cropping in VIP, the issue is solved!

    When it happened, it shows message as below:

      [m3vpss ]  140302: CAPTURE: Overflow detected on VIP0, Total Resets = 4
     [m3vpss ]  140350: CAPTURE: Overflow detected on VIP0, Total Resets = 5
     [m3vpss ]  140398: CAPTURE: Overflow detected on VIP0, Total Resets = 6
     [m3vpss ]  140430: CAPTURE: Overflow detected on VIP0, Total Resets = 7
     [m3vpss ]  140462: CAPTURE: Overflow detected on VIP0, Total Resets = 8
     [m3vpss ]  140494: CAPTURE: Overflow detected on VIP0, Total Resets = 9
     [m3vpss ]  140526: CAPTURE: Overflow detected on VIP0, Total Resets = 10

    ...

    BTW, I have another questions:

    1) Does capture cropping/scaling cause more capture latency  if the cropping width and height both are the same as input(do nothing about cropping/scaling)?

    2) Could you explain more detail about memory allocation of capture link? Which one is frame size of capture link output buffer: maxWidth/maxHeight, cropWidth/cropHeight or scOutWidth/scOutHeight?

    Thanks again!

    BR,

    Steven

  • Hi Steven,

     

    Cropping/Scaling does not add any latency since it is done inline with the capture.

    I think capture linke allocates the buffers based on maxWidth/Height

     

    Regards,

    Brijesh Jadav

  • Hi Brijesh,

    Thanks for your help.

    I am new for mcfw link and sorry for many questions.

    If I modify the maxWidth/maxHeight from 1920x1080 to 1920x1200 in capture link.

    Are there any changes needed by M3 memory allocation?

    My usecase as below:

    Capture link -> swms link -> display link

    1. Create chain with standard 1080P60. Capture link allocates output buffers with maxWidth 1920/ maxHeight 1200.

    2. Capture link will change input resolution dynamically based on the actual source input. I think the output buffers dont re-allocate, the output buffers is allocated at initial.

    3. Because swms link have limitations in input resolution  max width/max height 1920x1080, so I modify it to 1920x1200 for capture 1600x1200 case.

    This chain works fine but  I am concern about M3 memory allocation.

    BR

    Steven

  • Capture link allocates buffer based on pInst->maxOutWidth and pInst->maxHeight

    Below is the relevant code in CaptureLink_drvCreateInst (/dvr_rdk/mcfw/src_bios6/links_m3vpss/capture/captureLink_drv.c)

     

        switch (pInstPrm->standard)
        {
            case FVID2_STD_1080P_60:
            case FVID2_STD_1080P_30:
                pInst->maxWidth = 1920;
                pInst->maxHeight = 1080;
    
    
    -----
      pVipOutPrm->pitch[0] =
                VpsUtils_align(pInst->maxWidth, VPS_BUFFER_ALIGNMENT * 2);

     

    Capture output buffer size allocated will be pitch x height. If you are using 1080P format it is allocating buffer for frame size 1936 x 1080.This buffer is sufficient to hold 1600 x 1200 frame but there is no configuration in captureLink to update capture pitch in driver dynamically. So it will still be using pitch as 1936 which means you can save only 1080 lines after which it will corrupt memory.

    If you modify the code in (/dvr_rdk/mcfw/src_bios6/links_m3vpss/capture/captureLink_drv.c to allocate frames of 1920 x 1200 by setting pInst->maxHeight to 1200 then it should be fine. It looks like you have already done this change in which case buffer allocation is not a problem


     

  • Hi Badri,

    Thanks for your detailed reply.

    I have another question:

    Could I change the parameters of  inline scalar in capture driver dynamically?

    From this case, I create chain with maxWidthxmaxHight 1920x1200 then I set capture link input  resolution via actual video input dynamically.

    To avoid 1600x1200 memory corruption issue, I must use capture scalar to limited max height captured.

    So I need modify scalar parameters scOutWidth/scOutHeight as capture input resolution.

    Could I use ioctl IOCTL_VPS_CAPT_SET_SC_PARAMS to do it?

    Thanks

    BR,

    Steven

  • Hi Steven,

     

    You could limit the number of lines writen to the memory by scalar, but it may also create overflow if short frame is receiver, so please make sure that you never receive short frame.

     

    Regards,

    Brijesh

  • Hi Brijesh,

    Thanks for quick reply.

    If I could detect video source input correctly, it should be not a problem.

    BTW, This is only way to capture 1600x1200 video and avoid memory corruption,  isn't it?

    Thanks,

    BR,

    Steven

  • Hi Brijesh,

    You are right!!  I met another problem:

    If I set scalar output resolution via capture input resolution(dont scale, just limit the number of lines), the actual width/height of input source MUST the same as the input resolution.

    But in my case, I am using TVP7002 to capture the VGA input source. The VGA sources vary slightly in actual width/height. Wrong width maybe get wrong offset in scalar and wrong height will get overflow messages...

    Are there any way to limit the number of lines written to the memory without capture scalar? 

    I found another thread:

    http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/716/p/275713/964090.aspx

    "The fix is to add x line interrupt in the VIP driver and x line is set to 1201, so whenever this interrupt comes, it is sure that the VPDMA is receiving more than 1200 lines, to in this case, stop the VIP port in the interrupt and restart it. It will still store few more lines, because this is client interrupt, so we could keep buffer of size, 1210 and restart the VIP port when this interrupt comes."

    Could I use x line interrupt to solve this issue? If yes, How could I implement the x line interrupt in the VIP driver? 

    Thanks for your patience.

    BR,

    Steven

  • Hi All,

    Any suggestion will be highly appreciate...

    Are there any ways to capture 1600x1200 without scaler in the capture link?

    Thanks very much!

    BR

    Steven

  • Hi Brijesh,

    Could you give me some directions about x line interrupt in the VIP driver? Where could I found in hdvpss driver?

    Thanks a lot.

    Please help and thanks for your patience...

    BR,

    Steven

  • Hi, Brijesh

        As I know, parameter 'enableSdCrop' and 'doCropInCapture' are applicable only for D1/CIF capture input, how does it work fine for 1600X1200?

        Thanks for your reply

  • Hi Steven,

     

    When x number of lines are captured in the memory, you could get the callback in the application. This is just the notification to the application. With this callback, you could also get the buffer pointer for which x lines are captured. You could use this buffer pointer as read only buffer in this callback. Please note that you will not be able to dequeue this frame/buffer in this callback.

     

    Rgds,

    Brijesh

  • Hi YU,

     

    Can you please check? it might be enabled even for this resolution.

    Btw, what exactly problem are you seeing? Is it the cropping or extra lines/pixels in the frame?

     

    Rgds,

    Brijesh