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.

The VPss is locked up when "Overlow" detected。how can it be avoided?

      I`m using a DM8168 board with DVR_RDK3.0 and encounter a big problem: VPSSM3 sometimes gets locked up When I disconnect or reconnect the video input cable.

     The debug message is as follows:  [m3vpss ]  9233898: CAPTURE: Overflow detected on VIP1,Total Resets = 2 ...

     It seems that the scaler module in VIP parser haven`t stop working while reseting the VIP,which result in the failure of VIP start...

     How can I stop the scaler while reseting the VIP parser? THANKS!!

  • What is the silicon revision you are using. Is it PG1.1 of PG2.0 . Pls share the full console logs showing the issue. When you say lock up do you get slave core Down event ?

    What is your capture format and what is the external decoder you are using.

  • The silicon revision is PG2.0.

    I`ll show you the full console logs because the issue happens occasionally.

    Everytime the VP is locked ,the list0_busy register is set “1” and the capture can not work again until restart the whole system.

    My capture format is 1080p60.

  • pls refer to http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/717/t/217297.aspx

    By the errata

    http://www.ti.com/lit/er/sprz329d/sprz329d.pdf

    Advisory 2.0.2 —VIP Parser Output FIFO Overflow Bit is Set/VIP Port Locks Up When Capture is Run With Other
    Drivers (e.g., SC, Display) ...................................................................................................

    I'm using PG 2.1 and not see that till now.

  • Hi,Jack

        I have read errata file before.

        As Advisory 2.0.2(VIP Parser Output FIFO Overflow Bit is Set/VIP Port Locks Up When Capture is Run With Other Drivers (e.g., SC, Display)) mentioned, when "Overflow" is detected, the VIP parser should go to the reset sequence.

        My RDK version is DVRRDK3.0 and I think the vpss code has done the above VIP RESET sequence.But it still have the issue.

        I`m debugging  this issue and found thah VIP capture port sometimes start with a error of timeout. VpsHal_vpdmaListWaitComplete in the end of Vps_captLmPostList return a "-1".

        When I disable the scaler in VIP,this will not happen. so I think the reset sequence can not make the VIP sc stop explicitly . I don`t know how to stop VIP scaler properly.

        Can you tell me your RDK version?

  • My RDK version is DVRRDK3.0 and I think the vpss code has done the above VIP RESET sequence.But it still have the issue.

    - did you confirm if VIP RESET was really done when issue happened?

    Can you tell me your RDK version?

    - mine is the same as yours, I confirm with my coworker using pg 2.0 and he didn't see that. May I know you probability of occurence?

  • Hi,

     

    Could you me if you have source code for hte HDVPSS? If yes, could add below code in the VpsHal_vipInit function of the file pspdrivers_\packages\ti\psp\vps\hal\src\vpshal_vip.c

     

            VipPortObj[instCnt].regs->XTRA6_PORT_A = 0xFFFFFFFFu;
            VipPortObj[instCnt].regs->XTRA7_PORT_B = 0xFFFFFFFFu;

     

    this should fix overflow issue that you are seeing when scalar is used in the path.

     

    Regards,

    Brijesh Jadav

  • hi Brijesh,

    could you explain why you do the change?

  • Brijesh Jadav said:

    Could you me if you have source code for hte HDVPSS? If yes, could add below code in the VpsHal_vipInit function of the file pspdrivers_\packages\ti\psp\vps\hal\src\vpshal_vip.c

            VipPortObj[instCnt].regs->XTRA6_PORT_A = 0xFFFFFFFFu;
            VipPortObj[instCnt].regs->XTRA7_PORT_B = 0xFFFFFFFFu;

    this should fix overflow issue that you are seeing when scalar is used in the path.

     
    Q1. did you mean the following way?
     
        for(instCnt = 0u; instCnt < numInstances; instCnt++)
        {
            VipPortObj[instCnt].openCnt = 0;
            VipPortObj[instCnt].regs =
            (CSL_VpsVipRegsOvly)initParams[instCnt].baseAddress;
     

            VipPortObj[instCnt].regs->XTRA6_PORT_A = 0xFFFFFFFFu;
            VipPortObj[instCnt].regs->XTRA7_PORT_B = 0xFFFFFFFFu;

        }
     
    Q2. Could you explain why?
     
  • Hi Jack,

     

    when these bits are reset, it does not allow scalar coefficients to get programmed immediately, so list gets stalled and we get time out in the driver. Setting these bits to 1 allows programming of scalar coefficients immediately..

     

    Regards,

    Brijesh Jadav

  • Thanks Brijesh.

    Could you tell me where could I find the description about these registers?  Because I didn't found that in sprugx8.pdf, sprs614b.pdf, hdvpss document.pdf.

  • yes, changes are correct,

  • There are newly added registers in PG2.0, so may not be there in those documetns..

  • Could you try it and see if it fixes the issue?

  • here is the consle logs about the issue:

    19:08:08 .283 [m3vpss ] 572647: CAPTURE: Stop in progress !!!
    19:08:08 .293 [m3vpss ] 572647: CAPTURE: Stop Done !!!
    19:08:08 .463 [m3video] 573111: IPC_BITS_OUT : Delete in progress !!!
    19:08:08 .483 [m3video] 573111: IPCBITSOUT:Link[1000001c]:
    19:08:08 .503 [m3video] RECV:66 FREE:66,DROPPED:0,AVGLATENCY:57
    19:08:08 .525 [m3video] 573111: PRF : IPC_BITS_OUT0 : t: 1 ms, c: 66, f: 66, fps: 66000, fpc: 1 
    19:08:08 .546 [m3vpss ] 
    19:08:08 .566 [m3video] 573111: IPC_BITS_OUT : Delete Done !!!
    19:08:08 .586 [m3vpss ] *** Capture Driver Advanced Statistics *** 
    19:08:08 .606 [m3video] 573112: IPC_IN_M3 : Delete in progress !!!
    19:08:08 .626 [m3video] 573112: IPC_IN_M3 : Delete Done !!!
    19:08:08 .646 [m3vpss ] 
    19:08:08 .666 [m3vpss ] VIP Parser Reset Count : 1656
    19:08:08 .686 [m3vpss ] 
    19:08:08 .706 [m3vpss ] | Total Even Odd Total Even Odd Min / Max Min / Max Dropped Fid R
    19:08:08 .726 [m3vpss ] CH | Fields Fields Fields FPS FPS FPS Width Height Fields 
    19:08:08 .746 [m3vpss ] --------------------------------------------------------------------------------------
    19:08:08 .766 [m3vpss ] 000 | 1 1 0 0 0 0 65535 / 0 65535 / 0 1 
    19:08:08 .786 [m3vpss ] 200 | 149 149 0 11 11 0 1280 / 1280 720 / 720 5 
    19:08:08 .808 [m3vpss ] 
    19:08:08 .848 [m3vpss ] VIP Capture Port 0 | DescMissMatch1 = 0, DescMissMatch2 = 0 , DescMissMatch3 = 0 
    19:08:08 .868 [m3vpss ] VIP Capture Port 2 | DescMissMatch1 = 0, DescMissMatch2 = 0 , DescMissMatch3 = 0 
    19:08:08 .888 [m3vpss ] 
    19:08:08 .908 [m3vpss ] *** Capture List Manager Advanced Statistics *** 
    19:08:08 .928 [m3vpss ] 
    19:08:08 .968 [m3vpss ] List Post Count : 128922 
    19:08:09 .008 [m3vpss ] List Stall Count : 0 
    19:08:09 .048 [m3vpss ] List Post Time (ms) : Max = 3, Min = 0, Avg = 0, Total = 23 
    19:08:09 .068 [m3vpss ] INTC Timeout Count : (0, 0) (Min timeout value = 979, 990) 
    19:08:09 .088 [m3vpss ] Descriptor miss found count : 0 
    19:08:09 .108 [m3vpss ] 
    19:08:09 .128 [m3vpss ] 
    19:08:09 .148 [m3vpss ] VIP and VPDMA registers, 
    19:08:09 .168 [m3vpss ] VIP0 : FIQ_STATUS : 0x4810551c = 0x00000000
    19:08:09 .188 [m3vpss ] VIP1 : FIQ_STATUS : 0x48105a1c = 0x00000000
    19:08:09 .208 [m3vpss ] VPDMA: LIST_BUSY : 0x4810d00c = 0x00060000
    19:08:09 .228 [m3vpss ] 
    19:08:09 .248 [m3vpss ] 
    19:08:09 .268 [m3vpss ] 573115: CAPTURE: Fields = 144 (fps = 10, CPU Load = 0)
    19:08:09 .288 [m3vpss ] 573115: CAPTURE: Num Resets = 701 (Avg 6 ms per reset)
    19:08:09 .308 [m3vpss ] 573115: SYSTEM : FREE SPACE : System Heap = 5408 B, Mbx = 10239 msgs) 
    19:08:09 .328 [m3vpss ] 573115: SYSTEM : FREE SPACE : SR0 Heap = 12076032 B (11 MB) 
    19:08:09 .348 [m3vpss ] 573115: SYSTEM : FREE SPACE : Frame Buffer = 70110080 B (66 MB) 
    19:08:09 .368 [m3vpss ] 573115: SYSTEM : FREE SPACE : Bitstream Buffer = 211382144 B (201 MB) 
    19:08:09 .388 [m3vpss ] 573116: SYSTEM : FREE SPACE : Tiler 8-bit = 134217728 B (128 MB) - TILER ON 
    19:08:09 .408 [m3vpss ] 573116: SYSTEM : FREE SPACE : Tiler 16-bit = 134217728 B (128 MB) - TILER ON 
    19:08:09 .428 [m3vpss ] 573116: CAPTURE: Delete in progress !!!
    19:08:09 .448 [m3vpss ] UTILS: DMA: Free'ed CH (TCC) = 58 (58)
    19:08:09 .468 [m3vpss ] 573116: CAPTURE: Delete Done !!!
    19:08:09 .488 [m3vpss ] 573117: IPC_OUT_M3 : Delete in progress !!!
    19:08:09 .508 [m3vpss ] 573117: IPC_OUT_M3 : Delete Done !!!
    19:08:09 .528 [m3vpss ] 573117: CAPTURE: Create in progress !!!
    19:08:09 .548 [m3vpss ] 573148: CAPTURE: VIP0 PortA capture mode is [16-bit, Non-mux Embedded Sync] !!! 
    19:08:09 .568 [m3vpss ] 573323: CAPTURE: VIP1 PortA capture mode is [16-bit, Non-mux Embedded Sync] !!! 
    19:08:09 .588 [m3vpss ] ++++CaptureLink_drvCreateInst:1920,1080,1920,1080,1280,720
    19:08:09 .608 [m3video] 573442: IPC_IN_M3 : Create in progress !!!
    19:08:09 .641 [m3vpss ] UTILS: DMA: Allocated CH (TCC) = 58 (58)
    19:08:09 .661 [m3video] 573443: SYSTEM: Opening ListMP [VPSS-M3_IPC_OUT_0] ...
    19:08:09 .681 [m3video] 573443: SYSTEM: Opening ListMP [VPSS-M3_IPC_IN_0] ...
    19:08:09 .701 [m3video] 573444: IPC_IN_M3 : Create Done !!!
    19:08:09 .721 [m3vpss ] CAPTURE::HEAPID:0 USED:608
    19:08:09 .741 [m3vpss ] CAPTURE::HEAPID:4 USED:66355200
    19:08:09 .761 [m3vpss ] 573440: CAPTURE: Create Done !!!
    19:08:09 .781 [m3vpss ] 573441: IPC_OUT_M3 : Create in progress !!!
    19:08:09 .801 [m3vpss ] 573442: IPC_OUT_M3 : Create Done !!!
    19:08:09 .821 [m3video] 1088,1920,1,0,9,66,42,3,1,0,0,5,1,1,8000000,1,0
    19:08:09 .841 [m3video] 1920,1088,1920,4000000,60000,1,0,2,8,0,30000,10,40,-1,10,40,-1,0,8000000,8000000
    19:08:09 .861 [m3video] ENCLINK_H264:HEAPID:0 USED:11912
    19:08:09 .881 [m3video] ENCLINK_H264:HEAPID:3 USED:9535488
    19:08:09 .901 [m3video] 720,1280,1,0,9,66,42,3,1,0,0,5,1,1,8000000,1,0
    19:08:09 .921 [m3video] 1280,720,1280,889200,60000,1,0,2,8,0,30000,10,40,-1,10,40,-1,0,1778400,1778400
    19:08:10 .041 [m3video] ENCLINK_H264:HEAPID:0 USED:11912
    19:08:10 .061 [m3vpss ] 573609: CAPTURE: Start in progress !!!
    19:08:10 .081 [m3video] ENCLINK_H264:HEAPID:3 USED:4489216
    19:08:10 .101 [m3vpss ] 573609: CAPTURE: Start decoder Done !!!
    19:08:10 .121 [m3video] ENCLINK:HEAPID:0 USED:23944
    19:08:10 .141 [m3video] ENCLINK:HEAPID:2 USED:17971200
    19:08:10 .161 [m3video] ENCLINK:HEAPID:3 USED:14024704
    19:08:10 .181 [m3video] 573598: IPC_BITS_OUT : Create in progress !!!
    19:08:10 .201 [m3video] 573600: IPC_BITS_OUT : Create Done !!!
    19:08:10 .261 [m3vpss ] 573715: CAPTURE: Start captureVipHandle instId:0 !!!
    19:08:10 .281 [m3vpss ] 573723: CAPTURE: Start captureVipHandle instId:1 !!!
    19:08:10 .301 [m3vpss ] 573723: CAPTURE: Start captureVipHandle Done !!!
    19:08:10 .381 [m3vpss ] CAPTURE:queId: 0,queChId:1, Capture buffer address 0xb2ba9480, format 7 (1280*720, 128
    19:08:10 .401 [m3video] Channel:1 inputframerate:60 targetfps:30
    19:08:13 .850 [m3vpss ] 578661: CAPTURE: Overflow detected on VIP1, Total Resets = 1
    19:08:13 .870 [m3vpss ] 578677: CAPTURE: Overflow detected on VIP1, Total Resets = 2
    19:08:13 .940 [m3vpss ] 578741: CAPTURE: Overflow detected on VIP1, Total Resets = 3
    19:08:14 .000 [m3vpss ] 578789: CAPTURE: Overflow detected on VIP1, Total Resets = 4
    19:08:14 .070 [m3vpss ] 578853: CAPTURE: Overflow detected on VIP1, Total Resets = 5
    19:08:15 .323 [m3vpss ] AVSYNC:WallTime IGNORE Unexpected Discontinuity.PrevTs[579820]/CurTs[579931]
    19:08:31 .448 [m3vpss ] AVSYNC:WallTime IGNORE Unexpected Discontinuity.PrevTs[594045]/CurTs[594155]
    19:08:34 .981 [m3vpss ] 
    19:08:34 .991 [m3vpss ] List Status Dump
    19:08:35 .011 [m3vpss ] ----------------
    19:08:35 .021 [m3vpss ] List Status 0: 0x000001fc
    19:08:35 .031 [m3vpss ] List Status 1: 0x00000101
    19:08:35 .061 [m3vpss ] List Status 2: 0x00000101
    19:08:35 .091 [m3vpss ] List Status 3: 0x000001ff
    19:08:35 .111 [m3vpss ] List Status 4: 0x00000101
    19:08:35 .141 [m3vpss ] List Status 5: 0x00000101
    19:08:35 .161 [m3vpss ] List Status 6: 0x000001ff
    19:08:35 .181 [m3vpss ] List Status 7: 0x000001ff
    19:08:35 .191 [m3vpss ] 
    19:08:35 .201 [m3vpss ] *** Capture Driver Advanced Statistics *** 
    19:08:35 .211 [m3vpss ] 
    19:08:35 .221 [m3vpss ] VIP Parser Reset Count : 1661
    19:08:35 .231 [m3vpss ] 
    19:08:35 .241 [m3vpss ] | Total Even Odd Total Even Odd Min / Max Min / Max Dropped Fid R
    19:08:35 .251 [m3vpss ] CH | Fields Fields Fields FPS FPS FPS Width Height Fields 
    19:08:35 .261 [m3vpss ] --------------------------------------------------------------------------------------
    19:08:35 .271 [m3vpss ] 000 | 1 1 0 0 0 0 65535 / 0 65535 / 0 1 
    19:08:35 .281 [m3vpss ] 200 | 338 338 0 0 0 0 1280 / 1280 720 / 720 4 
    19:08:35 .291 [m3vpss ] 
    19:08:35 .301 [m3vpss ] VIP Capture Port 0 | DescMissMatch1 = 0, DescMissMatch2 = 0 , DescMissMatch3 = 0 
    19:08:35 .311 [m3vpss ] VIP Capture Port 2 | DescMissMatch1 = 0, DescMissMatch2 = 0 , DescMissMatch3 = 0 
    19:08:35 .321 [m3vpss ] 
    19:08:35 .331 [m3vpss ] *** Capture List Manager Advanced Statistics *** 
    19:08:35 .341 [m3vpss ] 
    19:08:35 .351 [m3vpss ] List Post Count : 130207 
    19:08:35 .361 [m3vpss ] List Stall Count : 0 
    19:08:35 .371 [m3vpss ] List Post Time (ms) : Max = 3, Min = 0, Avg = 0, Total = 23 
    19:08:35 .381 [m3vpss ] INTC Timeout Count : (0, 0) (Min timeout value = 979, 990) 
    19:08:35 .391 [m3vpss ] Descriptor miss found count : 0 
    19:08:35 .401 [m3vpss ] 
    19:08:35 .411 [m3vpss ] 
    19:08:35 .421 [m3vpss ] VIP and VPDMA registers, 
    19:08:35 .431 [m3vpss ] VIP0 : FIQ_STATUS : 0x4810551c = 0x00000000
    19:08:35 .441 [m3vpss ] VIP1 : FIQ_STATUS : 0x48105a1c = 0x00020c10
    19:08:35 .451 [m3vpss ] VPDMA: LIST_BUSY : 0x4810d00c = 0x00370000
    19:08:35 .461 [m3vpss ] 
    19:08:35 .471 [m3vpss ] 
    19:08:35 .481 [m3vpss ] 581885: Assertion @ Line: 701 in drivers/capture/src/vpsdrv_captureLm.c: FVID2_SOK ==

    When you say lock up do you get slave core Down event ?

    ---I haven`t got a slave core Down event,but after the Asser happen, VPSSm3 print nothing unless restart the whole system.

    I have debug this issue for serval days .I am puzzling with how to load the stop coefficients to sc modules explicitly .

    Thanks

  • Hi,

     

    If we are using inline scalar, we have to load scalar coefficients after every reset. If we dont reload the coefficients, we will not be able to use scalar after reset.

    We had seen this issue earlier and the fix for this issue is to set those registers to 0xFFFFFFFF, Could you please try out this fix and see if it is working?

     

    Regards,

    Brijesh Jadav

  • Thans for your advise,I`m going to try it.

  • Brijesh Jadav said:

    There are newly added registers in PG2.0, so may not be there in those documetns..

     
    hi brijesh,
       could you provide the path to get the document?
     
  • Hi Jack,

     

    Please contact your local TI FAE to get the documents.

     

    Regards,

    Brijesh Jadav

     

  • hi Brijesh,

      did you know if more registers are added in PG2.1?  if yes, I should contact our local TI FAE. right?

  • Not in PG2.1..

     

    Rgds,

    Brijesh Jadav

  • hi,

        I have tried you advise and the vp hang up didn`t happen until last night.It seems that setting those registers to 0xFFFFFFFF may make this issue happen not so easy.But it still may happen again.

        Do you have some other advise to fix this issue ?  here is the console log of this issue:

        I found that there is a difference:this time the "VPDMA: LIST_BUSY" register is 0x00170000, and before this value is 0x00000007.

    Mar 29 05:35:52 [m3vpss ] | Total Even Odd Total Even Odd Min / Max Min / Max Dropped Fid R
    Mar 29 05:35:52 [m3vpss ] CH | Fields Fields Fields FPS FPS FPS Width Height Fields 
    Mar 29 05:35:52 [m3vpss ] --------------------------------------------------------------------------------------
    Mar 29 05:35:52 [m3vpss ] 000 | 1 1 0 0 0 0 65535 / 0 65535 / 0 1 
    Mar 29 05:35:52 [m3vpss ] 200 | 908 908 0 69 69 0 1920 / 1920 1080 / 1080 20 
    Mar 29 05:35:52 [m3vpss ] 
    Mar 29 05:35:52 [m3vpss ] VIP Capture Port 0 | DescMissMatch1 = 0, DescMissMatch2 = 0 , DescMissMatch3 = 0 
    Mar 29 05:35:53 [m3vpss ] VIP Capture Port 2 | DescMissMatch1 = 0, DescMissMatch2 = 0 , DescMissMatch3 = 0 
    Mar 29 05:35:53 [m3vpss ] 
    Mar 29 05:35:53 [m3vpss ] *** Capture List Manager Advanced Statistics *** 
    Mar 29 05:35:53 [m3vpss ] 
    Mar 29 05:35:53 [m3vpss ] List Post Count : 7382849 
    Mar 29 05:35:53 [m3vpss ] List Stall Count : 0 
    Mar 29 05:35:53 [m3vpss ] List Post Time (ms) : Max = 1, Min = 0, Avg = 0, Total = 1 
    Mar 29 05:35:53 [m3vpss ] INTC Timeout Count : (0, 0) (Min timeout value = 974, 989) 
    Mar 29 05:35:53 [m3vpss ] Descriptor miss found count : 0 
    Mar 29 05:35:53 [m3vpss ] 
    Mar 29 05:35:53 [m3vpss ] 
    Mar 29 05:35:53 [m3vpss ] VIP and VPDMA registers, 
    Mar 29 05:35:53 [m3vpss ] VIP0 : FIQ_STATUS : 0x4810551c = 0x00000000
    Mar 29 05:35:53 [m3vpss ] VIP1 : FIQ_STATUS : 0x48105a1c = 0x00000000
    Mar 29 05:35:53 [m3vpss ] VPDMA: LIST_BUSY : 0x4810d00c = 0x00060000
    Mar 29 05:35:53 [m3vpss ] 
    Mar 29 05:35:53 [m3vpss ] 
    Mar 29 05:35:53 [m3vpss ] 30843723: CAPTURE: Fields = 888 (fps = 66, CPU Load = 0)
    Mar 29 05:35:53 [m3vpss ] 30843723: CAPTURE: Num Resets = 0 (Avg 0 ms per reset)
    Mar 29 05:35:53 [m3vpss ] 30843723: SYSTEM : FREE SPACE : System Heap = 5344 B, Mbx = 10237 msgs) 
    Mar 29 05:35:53 [m3vpss ] 30843723: SYSTEM : FREE SPACE : SR0 Heap = 12076032 B (11 MB) 
    Mar 29 05:35:53 [m3vpss ] 30843723: SYSTEM : FREE SPACE : Frame Buffer = 191730560 B (182 MB) 
    Mar 29 05:35:53 [m3vpss ] 30843723: SYSTEM : FREE SPACE : Bitstream Buffer = 60575616 B (57 MB) 
    Mar 29 05:35:53 [m3vpss ] 30843723: SYSTEM : FREE SPACE : Tiler 8-bit = 134217728 B (128 MB) - TILER ON 
    Mar 29 05:35:53 [m3vpss ] 30843724: SYSTEM : FREE SPACE : Tiler 16-bit = 134217728 B (128 MB) - TILER ON 
    Mar 29 05:35:53 [m3vpss ] 30843724: CAPTURE: Delete in progress !!!
    Mar 29 05:35:53 [m3vpss ] UTILS: DMA: Free'ed CH (TCC) = 60 (60)
    Mar 29 05:35:53 [m3vpss ] 30843724: CAPTURE: Delete Done !!!
    Mar 29 05:35:53 [m3vpss ] 30843724: IPC_OUT_M3 : Delete in progress !!!
    Mar 29 05:35:53 [m3vpss ] 30843725: IPC_OUT_M3 : Delete Done !!!
    Mar 29 05:35:53 [m3vpss ] CaptureLink_tskMain:LinkLineNoAddr=0x962d5910
    Mar 29 05:35:53 [m3vpss ] CaptureLink_tskMain:DrivLineNoAddr=0x962d5914
    Mar 29 05:35:53 [m3vpss ] CaptureLink_tskMain:Send VCapLinkTrack enter
    Mar 29 05:35:53 [m3vpss ] CaptureLink_tskMain:Send VCapLinkTrack Lever
    Mar 29 05:35:53 [m3vpss ] CaptureLink_tskMain:Send VCapDrivTrack enter
    Mar 29 05:35:53 [m3vpss ] CaptureLink_tskMain:Send VCapDrivTrack Lever
    Mar 29 05:35:53 [m3vpss ] 30843725: CAPTURE: Create in progress !!!
    Mar 29 05:35:53 [m3vpss ] 30843755: CAPTURE: VIP0 PortA capture mode is [16-bit, Non-mux Embedded Sync] !!! 
    Mar 29 05:35:53 [m3vpss ] CAPTURE::HEAPID:0 USED:608
    Mar 29 05:35:53 [m3vpss ] CAPTURE::HEAPID:4 USED:41748480
    Mar 29 05:35:53 [m3vpss ] 30844164: CAPTURE: Start in progress !!!
    Mar 29 05:35:53 [m3vpss ] 30844164: CAPTURE: Start decoder Done !!!
    Mar 29 05:35:53 [m3vpss ] 30844272: CAPTURE: Start captureVipHandle instId:0 !!!
    Mar 29 05:35:55 [m3vpss ] 
    Mar 29 05:35:55 [m3vpss ] List Status Dump
    Mar 29 05:35:55 [m3vpss ] ----------------
    Mar 29 05:35:55 [m3vpss ] List Status 0: 0x000001fc
    Mar 29 05:35:55 [m3vpss ] List Status 1: 0x00000101
    Mar 29 05:35:55 [m3vpss ] List Status 2: 0x00000101
    Mar 29 05:35:55 [m3vpss ] List Status 3: 0x000001ff
    Mar 29 05:35:55 [m3vpss ] List Status 4: 0x00000101
    Mar 29 05:35:55 [m3vpss ] List Status 5: 0x000001ff
    Mar 29 05:35:55 [m3vpss ] List Status 6: 0x000001ff
    Mar 29 05:35:55 [m3vpss ] List Status 7: 0x000001ff
    Mar 29 05:35:55 [m3vpss ] 
    Mar 29 05:35:55 [m3vpss ] *** Capture Driver Advanced Statistics *** 
    Mar 29 05:35:55 [m3vpss ] 
    Mar 29 05:35:55 [m3vpss ] VIP Parser Reset Count : 314
    Mar 29 05:35:55 [m3vpss ] 
    Mar 29 05:35:55 [m3vpss ] | Total Even Odd Total Even Odd Min / Max Min / Max Dropped Fid R
    Mar 29 05:35:55 [m3vpss ] CH | Fields Fields Fields FPS FPS FPS Width Height Fields 
    Mar 29 05:35:55 [m3vpss ] --------------------------------------------------------------------------------------
    Mar 29 05:35:55 [m3vpss ] 200 | 908 908 0 0 0 0 1920 / 1920 1080 / 1080 20 
    Mar 29 05:35:55 [m3vpss ] 
    Mar 29 05:35:55 [m3vpss ] VIP Capture Port 0 | DescMissMatch1 = 0, DescMissMatch2 = 0 , DescMissMatch3 = 0 
    Mar 29 05:35:55 [m3vpss ] VIP Capture Port 2 | DescMissMatch1 = 0, DescMissMatch2 = 0 , DescMissMatch3 = 0 
    Mar 29 05:35:55 [m3vpss ] 
    Mar 29 05:35:55 [m3vpss ] *** Capture List Manager Advanced Statistics *** 
    Mar 29 05:35:55 [m3vpss ] 
    Mar 29 05:35:55 [m3vpss ] List Post Count : 7382850 
    Mar 29 05:35:55 [m3vpss ] List Stall Count : 0 
    Mar 29 05:35:55 [m3vpss ] List Post Time (ms) : Max = 1, Min = 0, Avg = 0, Total = 1 
    Mar 29 05:35:55 [m3vpss ] INTC Timeout Count : (0, 0) (Min timeout value = 974, 989) 
    Mar 29 05:35:55 [m3vpss ] Descriptor miss found count : 0 
    Mar 29 05:35:55 [m3vpss ] 
    Mar 29 05:35:55 [m3vpss ] 
    Mar 29 05:35:55 [m3vpss ] VIP and VPDMA registers, 
    Mar 29 05:35:55 [m3vpss ] VIP0 : FIQ_STATUS : 0x4810551c = 0x00000000
    Mar 29 05:35:56 [m3vpss ] VIP1 : FIQ_STATUS : 0x48105a1c = 0x00000c10
    Mar 29 05:35:56 [m3vpss ] VPDMA: LIST_BUSY : 0x4810d00c = 0x00170000
    Mar 29 05:35:56 [m3vpss ] 
    Mar 29 05:35:56 [m3vpss ] 
    Mar 29 05:35:56 [m3vpss ] gVps_captCommonObj.captureObj[0].state = 3
    Mar 29 05:35:56 [m3vpss ] gVps_captCommonObj.captureObj[2].state = 1
    Mar 29 05:35:56 [m3vpss ] g_capturedebug = 3
    Mar 29 05:35:56 [m3vpss ] 30846742: Assertion @ Line: 705 in drivers/capture/src/vpsdrv_captureLm.c: FVID2_SOK =

  • Hi zhuohua,

     

    After this fix, we have run our test for days to check it really fixes timeout issue, we have not seen this issue again. This looks like something else. Could you tell me which RDK release you are using? what operation you are doing in the capture driver? Are you changing the scalar coefficients every now and then? which hdvpss release you are using?

     

    I could see that capture is happening only on VIP1, is it correct? fps seems to be very high but the number of frames captured are very low? Are you storing in YUV420 Tiled memory?

     

    Regards,

    Brijesh Jadav

  • Hi Brijesh,

        We are using VC_SDK_01.01.00.02,the hdvpss release version is hdvpss_01_00_01_37_patched. I changed nothing in the capture driver.

        "Are you changing the scalar coefficients every now and then?"----what do you mean? I didn`t change anything about changing scalar coefficients.Just as hdvpss do.

        I could see that capture is happening only on VIP1, is it correct? ---It is correct ,only VIP1 is uesd for capture .

        This issue happened when disconnect and reconnect the video input cable,are you doing the same operation when check for the fix?

        I can confirm that XTRA6_PORT_A and XTRA7_PORT_B registers is set to "0xffffffffu" by dumping the register memory.As you know,is there any situation could leed to VP hang up like this issue ?

  • Hi Brijesh,

        We have opened and initialed both VIP0 and VIP1,but only capture frames on VIP1.

        The capture output data format is set to "SYSTEM_DF_YUV420SP_UV" and tilerEnable is set "FALSE".

        Thanks for your response~~

  • zhuohua bu said:

    Hi Brijesh,

        We have opened and initialed both VIP0 and VIP1,but only capture frames on VIP1.

        The capture output data format is set to "SYSTEM_DF_YUV420SP_UV" and tilerEnable is set "FALSE".

        Thanks for your response~~

     

    Yes, i was also doing connect/disconnect test and after setting those two registers, we have not seen this issue. Did you check that when it asserted, those registers are still set to 0xFFFFFFFFu?

    Also which silicon revision you are using?

     

    Regards,

    Brijesh Jadav

  • Hi Brijesh,

        The silicon revision is 2.0.

        Now I can only confirm that those registers are still set to 0xFFFFFFFFu whie the programe runnning and connect/disconnect happen. but I didn`t check the value when it asserted last night. I`ll check this if it happen again.

        I can`t found anywhere in the code to change the value of these two register except that we init capture port.

  • hi Brijesh,

         The hang up issue happened again,those two registers is still 0xffffffffu when it asserted.

         are you sure this is because of other bugs ?

         can you give me some advise to debug this issue? 

          THANKS!

  • zhuohua bu said:

    hi Brijesh,

         The hang up issue happened again,those two registers is still 0xffffffffu when it asserted.

         are you sure this is because of other bugs ?

         can you give me some advise to debug this issue? 

          THANKS!

     

    Hi zhuohua,

     

    it looks like some changes are required in the reset api. could you please share you \pspdrivers_\packages\ti\psp\vps\drivers\capture\src\vpsdrv_captureVip.c file?

     

    Regards,

    Brijesh

  • hi Brijesh,

         I haven't change anything in vpsdrv_captureVip.c except some print message for debug.

         what kind of changes are needed?how do I know whether the sc is stop when reset?

  • hi Brijesh,

         I haven't change anything in vpsdrv_captureVip.c except some print message for debug.

         what kind of changes are needed?how do I know whether the sc is stop when reset?

  • hi Brijesh,

    here is the captureVip.c files,pls let me know if the reset api need to be changed.Thanks a lot

    /*******************************************************************************
     *                                                                             *
     * Copyright (c) 2009 Texas Instruments Incorporated - http://www.ti.com/      *
     *                        ALL RIGHTS RESERVED                                  *
     *                                                                             *
     ******************************************************************************/
    
    #include <ti/psp/vps/drivers/capture/src/vpsdrv_capturePriv.h>
    #include <ti/psp/vps/common/vps_evtMgr.h>
    
    /**< Value to indicate that subframe object is FREE and can be allocated */
    #define VPS_CAPT_SUBFRAME_FREE  (FALSE)
    /**< Value to indicate that subframe object is allocated */
    #define VPS_CAPT_SUBFRAME_ALLOC (0xFFFFFFFF)
    
    #define VPS_CAPT_SUBFRAME_DEBUG_CB_COUNTERS
    #define VPS_CAPT_SUBFRAME_CHECK_REQFLOW
    
    /**< Q objects that would used to track the current frame under reception */
    Vps_CaptSubFrameQObj gVps_captSubFrameQObj[VPS_CAPT_STREAM_ID_MAX][VPS_CAPT_FRAME_QUE_LEN_PER_CH_MAX];
    /**< Index indicating the next free object in the array */
    UInt32 gVps_captSubFrameQIndex = 0x0;
    
    #ifdef VPS_CAPT_SUBFRAME_DEBUG_CB_COUNTERS
    typedef struct {
        UInt32 eofCounter;
        UInt32 xLineCounter;
        UInt32 fidMismatch;
        UInt32 maxHeight;
        UInt32 minHeight;
        UInt32 maxWidth;
        UInt32 minWidth;
        UInt32 shortFrames;
        UInt32 minSubFrames;
        UInt32 maxSubFrames;
        UInt32 shortFrameTrigFlag;
    } VPS_CaptSubFrameDebugCounters;
    /**< Index indicating the next free object in the array */
    VPS_CaptSubFrameDebugCounters gCaptSubFrameDebug;
    #endif /* VPS_CAPT_SUBFRAME_DEBUG_CB_COUNTERS */
    
    
    /* Forward Declaration */
    Void Vps_captVipSubFrameXlinePIsr ( const UInt32 *event,
                                        UInt32 numEvents,
                                        Ptr arg);
    Void Vps_captVipSubFrameEOFIsr(const UInt32 *event,
                                      UInt32 numEvents,
                                      Ptr arg);
    #ifdef VPS_CAPT_SUBFRAME_CHECK_SEC_CHANNEL
    Void Vps_captVipSubFrameXlineSIsr ( const UInt32 *event,
                                        UInt32 numEvents,
                                       Ptr arg);
    #endif /* VPS_CAPT_SUBFRAME_CHECK_SEC_CHANNEL */
    
    /* Local Functions */
    static Vps_CaptSubFrameQObj * Vps_captVipSubFrameAllocQObj ( UInt32 streamId );
    static Int32 Vps_captVipSubFrameFreeQObj ( Vps_CaptSubFrameQObj *obj );
    
    /*
      Make VIP parser config based on create parameters
    
      The HW register are not updated in this API
      only config structure is initialized.
    */
    Int32 Vps_captVipParserConfigSetup ( Vps_CaptObj * pObj,
                                         VpsHal_VipConfig * vipInstConfig,
                                         VpsHal_VipPortConfig * vipPortConfig )
    {
        Int32 status = FVID2_SOK;
        Vps_VipConfig *pUserInstConfig;
        Vps_VipPortConfig *pUserPortConfig;
    
        /*
         * setup VIP parser parameters
         */
        vipInstConfig->vipConfig.clipActive = FALSE;
        vipInstConfig->vipConfig.clipBlank = FALSE;
    
        vipPortConfig->ancChSel8b = VPS_VIP_ANC_CH_SEL_8B_LUMA_SIDE;
        vipPortConfig->pixClkEdgePol = VPS_VIP_PIX_CLK_EDGE_POL_RISING;
        vipPortConfig->disConfig.fidSkewPostCnt = 0;
        vipPortConfig->disConfig.fidSkewPreCnt = 0;
        vipPortConfig->disConfig.lineCaptureStyle =
            VPS_VIP_LINE_CAPTURE_STYLE_ACTVID;
        if ((pObj->createArgs.videoCaptureMode ==
            VPS_CAPT_VIDEO_CAPTURE_MODE_SINGLE_CH_NON_MUX_DISCRETE_SYNC_HSYNC_VBLK) ||
            (pObj->createArgs.videoCaptureMode ==
            VPS_CAPT_VIDEO_CAPTURE_MODE_SINGLE_CH_NON_MUX_DISCRETE_SYNC_HSYNC_VSYNC))
        {
            vipPortConfig->disConfig.lineCaptureStyle =
                VPS_VIP_LINE_CAPTURE_STYLE_HSYNC;
        }
        vipPortConfig->disConfig.fidDetectMode = VPS_VIP_FID_DETECT_MODE_PIN;
        vipPortConfig->disConfig.actvidPol = VPS_VIP_POLARITY_HIGH;
        vipPortConfig->disConfig.vsyncPol = VPS_VIP_POLARITY_LOW;
        vipPortConfig->disConfig.hsyncPol = VPS_VIP_POLARITY_LOW;
    
        vipPortConfig->embConfig.srcNumPos
            = VPS_VIP_SRC_NUM_POS_LS_NIBBLE_OF_CODEWORD;
    
        vipPortConfig->embConfig.isMaxChan3Bits = FALSE;
    
        vipPortConfig->invertFidPol = FALSE;
        vipPortConfig->enablePort = FALSE;
        vipPortConfig->clrAsyncFifoRd = FALSE;
        vipPortConfig->clrAsyncFifoWr = FALSE;
    
        vipPortConfig->ctrlChanSel = VPS_VIP_CTRL_CHAN_SEL_7_0;
    
        /*
         * setup 8/16/24 interface based on user parameters
         */
        if ( pObj->createArgs.videoIfMode == VPS_CAPT_VIDEO_IF_MODE_8BIT )
        {
            vipInstConfig->intfMode = VPSHAL_VIP_INTF_MODE_8B;
        }
        else if ( pObj->createArgs.videoIfMode == VPS_CAPT_VIDEO_IF_MODE_16BIT )
        {
            vipInstConfig->intfMode = VPSHAL_VIP_INTF_MODE_16B;
            vipPortConfig->ctrlChanSel = VPS_VIP_CTRL_CHAN_SEL_15_8;
    
            /*
             * control channel needs to be Luma in sim for 16-bit interface
             */
            vipPortConfig->ctrlChanSel = VPS_VIP_CTRL_CHAN_SEL_15_8;
        }
        else if ( pObj->createArgs.videoIfMode == VPS_CAPT_VIDEO_IF_MODE_24BIT )
        {
            vipInstConfig->intfMode = VPSHAL_VIP_INTF_MODE_24B;
        }
        else
        {
            vipInstConfig->intfMode = VPSHAL_VIP_INTF_MODE_8B;
        }
    
        vipPortConfig->embConfig.errCorrEnable = FALSE;
        vipPortConfig->syncType = VPSHAL_VIP_SYNC_TYPE_EMB_SINGLE_422_YUV;
    
        /*
         * based on capture mode setup VIP parser syncType
         */
        switch ( pObj->createArgs.videoCaptureMode )
        {
            case VPS_CAPT_VIDEO_CAPTURE_MODE_SINGLE_CH_NON_MUX_EMBEDDED_SYNC:
    
                if ( pObj->createArgs.inDataFormat == FVID2_DF_YUV422P )
                    vipPortConfig->syncType =
                        VPSHAL_VIP_SYNC_TYPE_EMB_SINGLE_422_YUV;
                else
                    vipPortConfig->syncType =
                        VPSHAL_VIP_SYNC_TYPE_EMB_SINGLE_RGB_OR_444_YUV;
    
                break;
    
            case VPS_CAPT_VIDEO_CAPTURE_MODE_MULTI_CH_LINE_MUX_SPLIT_LINE_EMBEDDED_SYNC:
            case VPS_CAPT_VIDEO_CAPTURE_MODE_MULTI_CH_LINE_MUX_EMBEDDED_SYNC:
    
                if ( pObj->createArgs.inDataFormat == FVID2_DF_YUV422P )
                {
                    vipPortConfig->syncType = VPSHAL_VIP_SYNC_TYPE_EMB_LINE_YUV;
                }
                break;
    
            case VPS_CAPT_VIDEO_CAPTURE_MODE_MULTI_CH_PIXEL_MUX_EMBEDDED_SYNC:
    
                if ( pObj->createArgs.inDataFormat == FVID2_DF_YUV422P )
                {
                    if ( pObj->createArgs.numCh == 2 )
                        vipPortConfig->syncType =
                            VPSHAL_VIP_SYNC_TYPE_EMB_2X_422_YUV;
                    else
                        vipPortConfig->syncType =
                            VPSHAL_VIP_SYNC_TYPE_EMB_4X_422_YUV;
                }
                break;
    
            case VPS_CAPT_VIDEO_CAPTURE_MODE_SINGLE_CH_NON_MUX_DISCRETE_SYNC_HSYNC_VBLK:
            case VPS_CAPT_VIDEO_CAPTURE_MODE_SINGLE_CH_NON_MUX_DISCRETE_SYNC_HSYNC_VSYNC:
            case VPS_CAPT_VIDEO_CAPTURE_MODE_SINGLE_CH_NON_MUX_DISCRETE_SYNC_ACTVID_VBLK:
            case VPS_CAPT_VIDEO_CAPTURE_MODE_SINGLE_CH_NON_MUX_DISCRETE_SYNC_ACTVID_VSYNC:
    
                if ( pObj->createArgs.videoIfMode == VPS_CAPT_VIDEO_IF_MODE_24BIT )
                {
                    vipPortConfig->syncType =
                        VPSHAL_VIP_SYNC_TYPE_DIS_SINGLE_24B_RGB;
                }
                else
                {
                    vipPortConfig->syncType =
                        VPSHAL_VIP_SYNC_TYPE_DIS_SINGLE_YUV;
                }
    
                vipPortConfig->discreteBasicMode = FALSE;
                if ((pObj->createArgs.videoCaptureMode ==
                    VPS_CAPT_VIDEO_CAPTURE_MODE_SINGLE_CH_NON_MUX_DISCRETE_SYNC_HSYNC_VSYNC) ||
                    (pObj->createArgs.videoCaptureMode ==
                    VPS_CAPT_VIDEO_CAPTURE_MODE_SINGLE_CH_NON_MUX_DISCRETE_SYNC_ACTVID_VSYNC))
                {
                    vipPortConfig->discreteBasicMode = TRUE;
                }
    
    #if 0
                if ( pObj->createArgs.inDataFormat == FVID2_DF_YUV422P )
                {
                    vipPortConfig->syncType =
                        VPSHAL_VIP_SYNC_TYPE_DIS_SINGLE_422_YUV;
                }
                else
                {
    
                    if ( pObj->createArgs.videoIfMode ==
                         VPS_CAPT_VIDEO_IF_MODE_24BIT )
                        vipPortConfig->syncType =
                            VPSHAL_VIP_SYNC_TYPE_DIS_SINGLE_24B_RGB;
                    else
                        vipPortConfig->syncType =
                            VPSHAL_VIP_SYNC_TYPE_DIS_SINGLE_8B_RGB;
                }
    #endif
                break;
        }
    
        /*
         * over ride with user supplied extended params if required
         */
        pUserPortConfig = pObj->createArgs.vipParserPortConfig;
        pUserInstConfig = pObj->createArgs.vipParserInstConfig;
    
        if ( pUserInstConfig != NULL )
        {
            if ( pUserInstConfig->clipActive !=
                 ( UInt32 ) VPS_VIP_VALUE_DONT_CARE )
            {
                vipInstConfig->vipConfig.clipActive =
                    pUserInstConfig->clipActive;
            }
            if ( pUserInstConfig->clipBlank !=
                 ( UInt32 ) VPS_VIP_VALUE_DONT_CARE )
            {
                vipInstConfig->vipConfig.clipBlank = pUserInstConfig->clipBlank;
            }
        }
        if ( pUserPortConfig != NULL )
        {
            if ( pUserPortConfig->ctrlChanSel
                 != ( UInt32 ) VPS_VIP_CTRL_CHAN_DONT_CARE )
            {
                vipPortConfig->ctrlChanSel = pUserPortConfig->ctrlChanSel;
            }
            if ( pUserPortConfig->ancChSel8b
                 != ( UInt32 ) VPS_VIP_ANC_CH_SEL_DONT_CARE )
            {
                vipPortConfig->ancChSel8b = pUserPortConfig->ancChSel8b;
            }
            if ( pUserPortConfig->pixClkEdgePol !=
                 ( UInt32 ) VPS_VIP_PIX_CLK_EDGE_POL_DONT_CARE )
            {
                vipPortConfig->pixClkEdgePol = pUserPortConfig->pixClkEdgePol;
            }
            if ( pUserPortConfig->invertFidPol !=
                 ( UInt32 ) VPS_VIP_VALUE_DONT_CARE )
            {
                vipPortConfig->invertFidPol = pUserPortConfig->invertFidPol;
            }
    
            if ( pUserPortConfig->embConfig.errCorrEnable
                 != ( UInt32 ) VPS_VIP_VALUE_DONT_CARE )
            {
                vipPortConfig->embConfig.errCorrEnable
                    = pUserPortConfig->embConfig.errCorrEnable;
            }
            if ( pUserPortConfig->embConfig.srcNumPos !=
                 ( UInt32 ) VPS_VIP_SRC_NUM_POS_DONT_CARE )
            {
                vipPortConfig->embConfig.srcNumPos
                    = pUserPortConfig->embConfig.srcNumPos;
            }
            if ( pUserPortConfig->embConfig.isMaxChan3Bits !=
                 ( UInt32 ) VPS_VIP_VALUE_DONT_CARE )
            {
                vipPortConfig->embConfig.isMaxChan3Bits
                    = pUserPortConfig->embConfig.isMaxChan3Bits;
            }
    
            if ( pUserPortConfig->disConfig.fidSkewPostCnt !=
                 ( UInt32 ) VPS_VIP_VALUE_DONT_CARE )
            {
                vipPortConfig->disConfig.fidSkewPostCnt
                    = pUserPortConfig->disConfig.fidSkewPostCnt;
            }
            if ( pUserPortConfig->disConfig.fidSkewPreCnt !=
                 ( UInt32 ) VPS_VIP_VALUE_DONT_CARE )
            {
                vipPortConfig->disConfig.fidSkewPreCnt
                    = pUserPortConfig->disConfig.fidSkewPreCnt;
            }
            if ( pUserPortConfig->disConfig.lineCaptureStyle
                 != ( UInt32 )  VPS_VIP_LINE_CAPTURE_STYLE_DONT_CARE )
            {
                vipPortConfig->disConfig.lineCaptureStyle
                    = pUserPortConfig->disConfig.lineCaptureStyle;
            }
            if ( pUserPortConfig->disConfig.fidDetectMode !=
                 ( UInt32 ) VPS_VIP_FID_DETECT_MODE_DONT_CARE )
            {
                vipPortConfig->disConfig.fidDetectMode
                    = pUserPortConfig->disConfig.fidDetectMode;
            }
            if ( pUserPortConfig->disConfig.actvidPol !=
                 ( UInt32 ) VPS_VIP_POLARITY_DONT_CARE )
            {
                vipPortConfig->disConfig.actvidPol
                    = pUserPortConfig->disConfig.actvidPol;
            }
            if ( pUserPortConfig->disConfig.vsyncPol !=
                 ( UInt32 ) VPS_VIP_POLARITY_DONT_CARE )
            {
                vipPortConfig->disConfig.vsyncPol
                    = pUserPortConfig->disConfig.vsyncPol;
            }
            if ( pUserPortConfig->disConfig.hsyncPol !=
                 ( UInt32 ) VPS_VIP_POLARITY_DONT_CARE )
            {
                vipPortConfig->disConfig.hsyncPol
                    = pUserPortConfig->disConfig.hsyncPol;
            }
        }
    
        return status;
    }
    
    /*
      Make scaler config based on create parameters
    
      The HW register are not updated in this API
      only config structure is initialized.
    */
    Int32 Vps_captVipScConfigSetup ( Vps_CaptObj * pObj,
                                     VpsHal_ScConfig * scConfig,
                                     Vps_ScCoeffParams * scCoeffConfig )
    {
        Int32 status = FVID2_SOK;
        Vps_CaptScParams *pScParams;
        Vps_ScConfig *pUserConfig;
        Vps_ScCoeffParams *pUserCoeffConfig;
    
        pScParams = &pObj->createArgs.scParams;
    
        if ((pScParams->outWidth > pScParams->inCropCfg.cropWidth) ||
            (pScParams->outHeight > pScParams->inCropCfg.cropHeight))
        {
            status = FVID2_EFAIL;
        }
    
        scConfig->tarWidth = pScParams->outWidth;
        scConfig->tarHeight = pScParams->outHeight;
        scConfig->srcWidth = pScParams->inWidth;
        scConfig->srcHeight = pScParams->inHeight;
        scConfig->cropStartX = pScParams->inCropCfg.cropStartX;
        scConfig->cropStartY = pScParams->inCropCfg.cropStartY;
        scConfig->cropWidth = pScParams->inCropCfg.cropWidth;
        scConfig->cropHeight = pScParams->inCropCfg.cropHeight;
        scConfig->inFrameMode
            = ( Vps_ScanFormat )
                FVID2_SF_PROGRESSIVE;
        scConfig->outFrameMode
            = ( Vps_ScanFormat )
                FVID2_SF_PROGRESSIVE;
        scConfig->hsType = VPS_SC_HST_AUTO;
        scConfig->nonLinear = FALSE;
        scConfig->stripSize = 0;
        scConfig->vsType = VPS_SC_VST_POLYPHASE;
        scConfig->fidPol = VPS_FIDPOL_NORMAL;
        scConfig->selfGenFid = VPS_SC_SELF_GEN_FID_DISABLE;
        scConfig->defConfFactor = 0;
        scConfig->biLinIntpType = VPS_SC_BINTP_ORIGINAL;
        scConfig->enableEdgeDetect = FALSE;
        scConfig->hPolyBypass = TRUE;
        /* For downscaling enable pre-peaking filter */
        if (scConfig->tarWidth < scConfig->cropWidth)
        {
            scConfig->enablePeaking = TRUE;
        }
        else
        {
            scConfig->enablePeaking = FALSE;
        }
        scConfig->phInfoMode = VPS_SC_SET_PHASE_INFO_DEFAULT;
        scConfig->bypass = FALSE;
        scConfig->arg = NULL;
    
        #if 0 // if user has said enable SC then always enable, sicne for YUV420 output user may always want SC
        /*
         * bypass scaler if not required
         */
        if ( pScParams->outWidth    /* input = output and no crop */
             == pScParams->inWidth
            &&
            pScParams->inCropCfg.cropWidth
                == pScParams->inWidth
            &&
            pScParams->outHeight
             == pScParams->inHeight
            &&
            pScParams->inCropCfg.cropHeight
                == pScParams->inHeight
           )
        {
            scConfig->bypass = TRUE;
        }
        #endif
    
        /*
         * Check if user has provided SC coeff config
         */
        pUserCoeffConfig = pObj->createArgs.scParams.scCoeffConfig;
        if (NULL != pUserCoeffConfig)
        {
            /* Use user-provided values. */
            scCoeffConfig->hScalingSet = pUserCoeffConfig->hScalingSet;
            scCoeffConfig->vScalingSet = pUserCoeffConfig->vScalingSet;
            scCoeffConfig->coeffPtr = pUserCoeffConfig->coeffPtr;
            scCoeffConfig->scalarId = pUserCoeffConfig->scalarId;
        }
        else
        {
            /* Fill with defaults. */
            scCoeffConfig->hScalingSet = VPS_SC_DS_SET_8_16;
            scCoeffConfig->vScalingSet = VPS_SC_DS_SET_8_16;
            scCoeffConfig->coeffPtr = NULL;
            scCoeffConfig->scalarId = VPS_CAPT_SCALAR_ID_DEFAULT;
        }
    
        /*
         * over ride with user supplied extended params if required
         */
        pUserConfig = pObj->createArgs.scParams.scConfig;
    
        if ( pUserConfig != NULL )
        {
            scConfig->bypass = pUserConfig->bypass;
            scConfig->nonLinear = pUserConfig->nonLinear;
            scConfig->stripSize = pUserConfig->stripSize;
            scConfig->vsType = pUserConfig->vsType;
            scConfig->enablePeaking = pUserConfig->enablePeaking;
            scConfig->enableEdgeDetect = pUserConfig->enableEdgeDetect;
        }
    
        return status;
    }
    
    /*
      Setup path in VIP HW
    
      Setup all modules in the path
      Setup all muxes to enable the path
    
      The VIP port itself is not started at this point
    */
    Int32 Vps_captCreateVip ( Vps_CaptObj * pObj )
    {
        Bool scEnable = FALSE;
        VpsHal_ScConfig scConfig;
        VpsHal_VipConfig vipInstConfig;
        VpsHal_VipPortConfig vipPortConfig;
        Vps_CscConfig *pUserCscConfig;
        Vps_ScCoeffParams scCoeffConfig;
    
        Int32 status = FVID2_SOK;
        UInt32 streamId;
    
        /*
         * disable port, just in case it is enabled
         */
        Vcore_vipEnablePort ( &pObj->resObj, FALSE );
    
        /*
         * setup HW modules
         */
    
        /*
         * setup VIP parser
         */
        Vps_captVipParserConfigSetup ( pObj, &vipInstConfig, &vipPortConfig );
    
        /*
         * setup scaler if required
         */
        for ( streamId = 0; streamId < pObj->numStream; streamId++ )
        {
            if ( pObj->createArgs.outStreamInfo[streamId].scEnable )
            {
                scEnable = TRUE;
                status = Vps_captVipScConfigSetup ( pObj, &scConfig,
                                           &scCoeffConfig );
                /* Needs to be done only once for this instance. */
                break;
            }
        }
    
        if (FVID2_SOK == status)
        {
            /*
             * override with user params if set by user
             */
            pUserCscConfig = pObj->createArgs.cscConfig;
    
            /*
             * setup CSC, internally the API does no setting if CSC is not in this path
             */
            Vcore_vipSetCscParams ( &pObj->resObj, pUserCscConfig );
    
            if (TRUE == scEnable)
            {
                /*
                 * setup SC.
                 */
                Vcore_vipSetScParams(&pObj->resObj, &scConfig);
    
                /* Setup the current scaling factor information. */
                pObj->curScFactor.hScalingSet = scCoeffConfig.hScalingSet;
                pObj->curScFactor.vScalingSet = scCoeffConfig.vScalingSet;
                pObj->curScFactor.hsType = scConfig.hsType;
                pObj->curScFactor.vsType = scConfig.vsType;
    
                /* If scaler is not in bypass and if user has not provided specific
                 * scaler coefficients, then calculate the best scaling factor
                 * internally. If scaler is in bypass, use the default coefficient
                 * sets configured. */
                if ((FALSE == scConfig.bypass) &&
                    (NULL == pObj->createArgs.scParams.scCoeffConfig))
                {
                    /*
                     * Get current scaling factor
                     */
                    Vcore_vipGetAndUpdScFactorConfig(&pObj->resObj,
                        &scConfig,
                        &pObj->curScFactor);
    
                    scCoeffConfig.hScalingSet = pObj->curScFactor.hScalingSet;
                    scCoeffConfig.vScalingSet = pObj->curScFactor.vScalingSet;
                }
    
                /* Update the scaler config. */
                Vcore_vipSetScCoeff(&pObj->resObj,
                    &scCoeffConfig,
                    Vps_captGetScCoeffMem(pObj->vipInstId));
            }
    
            /*
             * setup VIP parser, internally the API
             * sets up the correct VIP for this path
             */
            Vcore_vipSetParserParams ( &pObj->resObj, &vipInstConfig, &vipPortConfig );
    
            /*
             * setup muxes for this path
             */
            Vcore_vipSetMux ( &pObj->resObj, NULL );
    
            /*
             * set frame start events for associated VPDMA channels
             */
            Vps_captSetFrameStartEvent ( pObj );
        }
    
        return status;
    }
    
    /*
      Set frame start event as channel active for all associated VPDMA channels
    */
    Int32 Vps_captSetFrameStartEvent ( Vps_CaptObj * pObj )
    {
        UInt16 chId, streamId, vChId;
        Vps_CaptChObj *pChObj;
    
        /*
         * for all channels in the driver instance
         */
        for ( chId = 0; chId < pObj->numCh; chId++ )
        {
            /*
             * for all streams
             */
            for ( streamId = 0; streamId < pObj->numStream; streamId++ )
            {
    
                pChObj = &pObj->chObj[streamId][chId];
    
                /*
                 * for associated VPDMA channels
                 */
                for ( vChId = 0; vChId < pChObj->vChannelNum; vChId++ )
                {
                    /*
                     * set frame start event as channel active
                     */
                    VpsHal_vpdmaSetFrameStartEvent ( pChObj->vChannelId[vChId], VPSHAL_VPDMA_FSEVENT_CHANNEL_ACTIVE, VPSHAL_VPDMA_LM_0, /* NOT USED  */
                                                     0, NULL, 0u );
                }
            }
        }
    
        return FVID2_SOK;
    }
    
    /*
      Start VIP HW port
    */
    Int32 Vps_captStartVip ( Vps_CaptObj * pObj )
    {
        /*
         * enable port
         */
        Vcore_vipEnablePort ( &pObj->resObj, TRUE );
    
        return FVID2_SOK;
    }
    
    /*
      Stop VIP HW port
    */
    Int32 Vps_captStopVip ( Vps_CaptObj * pObj )
    {
        /*
         * disable port
         */
        Vcore_vipEnablePort ( &pObj->resObj, FALSE );
    
        return FVID2_SOK;
    }
    
    /*
      Delete VIP
    */
    Int32 Vps_captDeleteVip ( Vps_CaptObj * pObj )
    {
        /*
         * stop VIP HW port
         */
        Vps_captStopVip ( pObj );
    
        return FVID2_SOK;
    }
    
    /*
      Set scaler frame info
    */
    Int32 Vps_captVipSetScParams(Vps_CaptObj *pObj,
                                 Vps_CaptScParams *scParams)
    {
        Int32 status = FVID2_EFAIL, outId;
        Ptr userCoeffPtr = NULL;
        VpsHal_ScConfig scConfig;
        Vps_ScCoeffParams scCoeffConfig;
        VpsHal_ScFactorConfig scFactorConfig;
        Vps_CaptOutInfo *outInfo;
        UInt32 cookie;
    
        /*
         * parameter checking
         */
        if ((pObj == (Vps_CaptObj *)VPS_CAPT_INST_VIP_ALL) ||
            (pObj == NULL) ||
            (scParams == NULL))
        {
            return FVID2_EFAIL;
        }
    
        /*
         * for all capture stream
         */
        for ( outId = 0; outId < pObj->numStream; outId++ )
        {
    
            outInfo = &pObj->createArgs.outStreamInfo[outId];
    
            /*
             * if scaler is enabled
             */
            if ( outInfo->scEnable )
            {
                /*
                 * copy current scaler frame info to driver frame info
                 */
                pObj->createArgs.scParams = *scParams;
    
                /*
                 * make scaler config
                 */
                status = Vps_captVipScConfigSetup (pObj, &scConfig, &scCoeffConfig);
    
                if (FVID2_SOK == status)
                {
                    /*
                     * disable interrupt
                     */
                    cookie = Hwi_disable (  );
    
                    /*
                     * set scaler HW
                     */
                    Vcore_vipSetScParams ( &pObj->resObj, &scConfig );
    
                    /*
                     * restore interrupt
                     */
                    Hwi_restore ( cookie );
    
                    /* The scaler coeff load must be done only if scaler is not in
                     * bypass and enableCoeffLoad is TRUE. */
                    if ((FALSE == scConfig.bypass) &&
                        (TRUE == scParams->enableCoeffLoad))
                    {
                        /* If user has not provided specific scaler coefficients,
                         * then calculate the best scaling factor internally. */
                        if (NULL == pObj->createArgs.scParams.scCoeffConfig)
                        {
                            /*
                             * Get new scaling factor
                             */
                            Vcore_vipGetAndUpdScFactorConfig (&pObj->resObj,
                                &scConfig,
                                &scFactorConfig);
                        }
                        else
                        {
                            if (NULL != scCoeffConfig.coeffPtr)
                            {
                                userCoeffPtr = scCoeffConfig.coeffPtr;
                            }
                            /* Otherwise set scFactorConfig to user-provided scaler
                             * coeff config. */
                            scFactorConfig.hScalingSet = scCoeffConfig.hScalingSet;
                            scFactorConfig.vScalingSet = scCoeffConfig.vScalingSet;
                            scFactorConfig.hsType = scConfig.hsType;
                            scFactorConfig.vsType = scConfig.vsType;
                        }
    
                        /* If the user has provided coefficient pointer, OR
                         * if the coefficient set has changed from current, then
                         * need to stop, reset and restart the VIP instance so that
                         * the new scaler coefficients can be configured.
                         * This is the case when either:
                         * 1. Horizontal polyphase scaling set has changed
                         * 2. Vertical filter type is Polyphase and the scaling set
                         *    has changed.
                         * The curScFactor must reflect the current scaling factor
                         * for which scaler coefficients have been loaded.
                         */
                        if (   (NULL != userCoeffPtr)
                            || (pObj->curScFactor.hScalingSet !=
                                    scFactorConfig.hScalingSet)
                            || ( (scFactorConfig.vsType == VPS_SC_VST_POLYPHASE)
                                && (pObj->curScFactor.vScalingSet !=
                                       scFactorConfig.vScalingSet)))
                        {
                            /* Update the scaler config with latest
                             * scaling factor. The vsType is set internally
                             * in the Vcore_vipGetAndUpdScFactorConfig
                             * function. */
                            scCoeffConfig.hScalingSet = scFactorConfig.hScalingSet;
                            scCoeffConfig.vScalingSet = scFactorConfig.vScalingSet;
    
                            /* Change curScFactor to the new one. */
                            pObj->curScFactor.hScalingSet =
                                scFactorConfig.hScalingSet;
                            pObj->curScFactor.vScalingSet =
                                scFactorConfig.vScalingSet;
                            pObj->curScFactor.hsType = scFactorConfig.hsType;
                            pObj->curScFactor.vsType = scFactorConfig.vsType;
    
                            /* Stop the VIP instance. */
                            pObj->resetStatistics = FALSE;
                            Vps_captStop(pObj, 1u);
    
                            Vcore_vipSetScCoeff (&pObj->resObj,
                                &scCoeffConfig,
                                Vps_captGetScCoeffMem (pObj->vipInstId));
    
                            /* Reset the VIP instance */
                            if (((pObj->platform == VPS_PLATFORM_ID_EVM_TI816x) &&
                                 (pObj->cpuRev <= VPS_PLATFORM_CPU_REV_1_1)) ||
                                ((pObj->platform == VPS_PLATFORM_ID_EVM_TI814x) &&
                                 (pObj->cpuRev <= VPS_PLATFORM_CPU_REV_2_1)) ||
                                (VPS_PLATFORM_ID_EVM_TI8107 == pObj->platform))
                            {
                                Vps_captVipBlockReset(pObj);
                            }
    
                            /* Start the VIP instance. When it is started, the new
                             * coefficients are loaded. */
                            Vps_captStart(pObj);
                        }
                    }
    
                    /*
                     * mark status as OK
                     */
                    status = FVID2_SOK;
                }
    
                /*
                 * break since there will be atmost only one stream with scaler enabled
                 */
                break;
            }
        }
    
        return status;
    }
    
    Int32 Vps_captVipPortAndModulesReset(Vps_CaptObj *pObj)
    {
        UInt32 delayMsec = 1;
    
        /* Reset VIP Port */
        Vcore_vipResetPort(&pObj->resObj, TRUE);
    
        /* Reset CSC, SC, core will ensure if CSC, SC is being used in the path,
           it would reset otherwise skip resetting it */
        Vcore_vipResetModules(&pObj->resObj, TRUE);
    
        Task_sleep(delayMsec);
    
        /* Program Abort descriptors and wait for list to get completed */
        Vps_captPostAbortList(pObj);
    
        /* clear VIP overflow FIQ */
        VpsHal_vipInstPortClearFIQ((VpsHal_VipInst)pObj->vipInstId);
    
        Task_sleep(delayMsec);
    
        Vcore_vipResetModules(&pObj->resObj, FALSE);
    
        /* Clear VIP port */
        Vcore_vipResetPort(&pObj->resObj, FALSE);
    
        return (FVID2_SOK);
    }
    
    
    //#define VPS_CAPT_DEBUG_LOG_VIP_RESET
    Int32 Vps_captVipBlockReset(Vps_CaptObj *pObj)
    {
        UInt32                  delayMsec = 1;
        VpsHal_VpsClkcModule    vipAllClkcModule;
    
        GT_assert( GT_DEFAULT_MASK, (pObj != NULL));
    
        if (pObj->vipInstId == VPSHAL_VIP_INST_0)
        {
            vipAllClkcModule = VPSHAL_VPS_CLKC_VIP0;
        }
        else if (pObj->vipInstId == VPSHAL_VIP_INST_1)
        {
            vipAllClkcModule = VPSHAL_VPS_CLKC_VIP1;
        }
        else
        {
            return FVID2_EFAIL;
        }
    
        /*
         * take CLM lock
         */
        Vps_captLmLock (  );
    
        #ifdef VPS_CAPT_DEBUG_LOG_VIP_RESET
        Vps_rprintf(" [VIP%d] VIP Reset Starting !!!\n", pObj->vipInstId );
        #endif
    
        Task_sleep(delayMsec);
    
        #ifdef VPS_CAPT_DEBUG_LOG_VIP_RESET
        Vps_rprintf(" [VIP%d] Disabling Parser !!!\n", pObj->vipInstId);
        #endif
    
        /* disable VIP Parser */
        VpsHal_vipInstDisable((VpsHal_VipInst)pObj->vipInstId);
    
        #ifdef VPS_CAPT_DEBUG_LOG_VIP_RESET
        Vps_rprintf(" [VIP%d] Asserting Reset !!!\n", pObj->vipInstId);
        #endif
    
        /* Reset the whole VIP block */
        VpsHal_vpsClkcModuleReset(vipAllClkcModule, TRUE);
    
        #ifdef VPS_CAPT_DEBUG_LOG_VIP_RESET
        Vps_rprintf(" [VIP%d] Asserting Clear FIFO !!!\n", pObj->vipInstId);
        #endif
    
        /* assert clear async FIFO */
        VpsHal_vipInstResetFIFO((VpsHal_VipInst)pObj->vipInstId, TRUE);
    
        Task_sleep(delayMsec);
    
        #ifdef VPS_CAPT_DEBUG_LOG_VIP_RESET
        Vps_rprintf(" [VIP%d] Posting Abort List !!!\n", pObj->vipInstId);
        #endif
    
        /* clear VIP overflow FIQ */
        VpsHal_vipInstPortClearFIQ((VpsHal_VipInst)pObj->vipInstId);
    
        /* post abort desc on all VIP VPDMA CHs */
        Vps_captPostAllAbortList((VpsHal_VipInst)pObj->vipInstId);
    
        Task_sleep(delayMsec);
    
        #ifdef VPS_CAPT_DEBUG_LOG_VIP_RESET
        Vps_rprintf(" [VIP%d] De-asserting Reset !!!\n", pObj->vipInstId);
        #endif
    
        /* Release the VIP block reset */
        VpsHal_vpsClkcModuleReset(vipAllClkcModule, FALSE);
    
        #ifdef VPS_CAPT_DEBUG_LOG_VIP_RESET
        Vps_rprintf(" [VIP%d] De-asserting Clear FIFO !!!\n", pObj->vipInstId);
        #endif
    
        /* Release FIFO Reset */
        VpsHal_vipInstResetFIFO((VpsHal_VipInst)pObj->vipInstId, FALSE);
    
        Task_sleep(delayMsec);
    
        #ifdef VPS_CAPT_DEBUG_LOG_VIP_RESET
        Vps_rprintf(" [VIP%d] VIP Reset Done !!!\n", pObj->vipInstId);
        #endif
    
        /*
         * unlock CLM
         */
        Vps_captLmUnlock (  );
    
        return 0;
    }
    
    
    Void Vps_captVipWaitForComplete(Vps_CaptObj *pObj)
    {
        UInt32 delay = 1u;
        volatile UInt32 waitCnt = 40;
    
        while (0u == Vcore_vipGetPortCompleteStatus(&pObj->resObj))
        {
            Task_sleep(delay);
    
            waitCnt --;
    
            if (!waitCnt)
            {
    
                #ifdef VPS_CAPT_DEBUG_LOG_VIP_RESET
                Vps_rprintf("[VIP%d]Cannot get Complete Status!!!\n",
                    pObj->instanceId);
                #endif
                break;
            }
        }
    
        Vcore_vipClearPortCompleteStatus(&pObj->resObj);
    }
    
    
    /**
     *  Vps_captSubFrameIsEnabled
     *  \brief This function checks if sub frame capturing is enabled for any of the
     *         output streams are not. The create arguments supplied by application
     *         is used to determine if subframe based capture is enabled.
     *
     *  \param pObj   Pointer to instance object.
     *
     *  \return       Returns TRUE is sub frame based capture is enabled, FALSE
     *                otherwise.
     */
    
    Bool Vps_captSubFrameIsEnabled ( Vps_CaptObj *pObj )
    {
        Bool rtnValue = FALSE;
        UInt32 numStream;
    
        for ( numStream = 0x0; numStream < pObj->createArgs.numStream; numStream++ )
        {
            if ( pObj->createArgs.outStreamInfo[numStream].subFrameModeEnable
                    == TRUE )
            {
                rtnValue = TRUE;
                break;
            }
        }
    
        return (rtnValue);
    }
    
    
    /**
     *  Vps_captVipSubFrameRegisterIsr
     *  \brief This function register the ISR for X line interrupt and frame
     *         reception complete interrupts.
     *
     *  \param pObj   Instance object pointer.
     *
     *  \pre This function assumes that subFrameQ for each channel is created.
     *
     *  \return   Returns 0 on success, negative value otherwise.
     */
    
    Int32 Vps_captVipSubFrameRegisterIsr ( Vps_CaptObj * pObj )
    {
        Int32 rtnValue = FVID2_SOK;
        UInt32 streamId, chId, subFrameEn;
        Int32 clientNo[VPS_CAPT_VCH_PER_LCH_MAX];
        UInt32 vpdmaChanNo;
        Vps_CaptChObj *pChObj;
        Vps_CaptSubFrameChObj *pChSfObj;
    
        #ifdef VPS_CAPT_SUBFRAME_DEBUG_CB_COUNTERS
        gCaptSubFrameDebug.eofCounter = 0x0;
        gCaptSubFrameDebug.xLineCounter = 0x0;
        gCaptSubFrameDebug.fidMismatch = 0x0;
        gCaptSubFrameDebug.maxHeight = 0x0;
        gCaptSubFrameDebug.minHeight = 0xFFFF;
        gCaptSubFrameDebug.maxWidth = 0x0;
        gCaptSubFrameDebug.minWidth = 0xFFFF;
        gCaptSubFrameDebug.shortFrames = 0x0;
        gCaptSubFrameDebug.minSubFrames = 0xFFFF;
        gCaptSubFrameDebug.maxSubFrames = 0x0;
        gCaptSubFrameDebug.shortFrameTrigFlag = 0x0;
        #endif /* VPS_CAPT_SUBFRAME_DEBUG_CB_COUNTERS */
    
        for ( streamId = 0; streamId < pObj->numStream; streamId++ )
        {
            subFrameEn =
                pObj->createArgs.outStreamInfo[streamId].subFrameModeEnable;
            for ( chId = 0; chId < pObj->numCh; chId++ )
            {
                pChObj = &pObj->chObj[streamId][chId];
                if (subFrameEn == TRUE)
                {
                    pChSfObj = &pChObj->subFrameObj;
    
                    GT_assert( GT_DEFAULT_MASK, (chId == 0x0));
                    GT_assert( GT_DEFAULT_MASK, (pChSfObj != NULL));
                    /* Primarily we will registering N line callback for
                     * Luma / Green. In case we have to look at secondary
                     * (Chroma / Blue) channel also, register the secondary
                     * channel ISRs
                     */
                    clientNo[0x0u] =
                        VpsHal_vpdmaGetClientNo ( pChObj->vChannelId[0] );
                    GT_assert( GT_DEFAULT_MASK,
                        ( clientNo[0x0u] != VPSHAL_VPDMA_CLIENT_INVALID ));
    
                    pChSfObj->subFrameClientInt[0x0u] =  Vem_register (
                                            VEM_EG_CLIENT,
                                            (UInt32 *) clientNo,
                                            1,
                                            VEM_PRIORITY1,
                                            Vps_captVipSubFrameXlinePIsr,
                                            (Void *) (&pChSfObj->subFrameQ) );
    
                    if ( pChSfObj->subFrameClientInt[0x0u] == NULL )
                    {
                        rtnValue = FVID2_EFAIL;
                    }
    
                    #ifdef VPS_CAPT_SUBFRAME_CHECK_SEC_CHANNEL
                    if ( (pChObj->vChannelNum > 0x0u) && (rtnValue == FVID2_SOK) )
                    {
                         clientNo[0x1u] =
                            VpsHal_vpdmaGetClientNo ( pChObj->vChannelId[1] );
                        GT_assert( GT_DEFAULT_MASK,
                            ( clientNo[0x0u] != VPSHAL_VPDMA_CLIENT_INVALID ));
    
                        pChSfObj->subFrameClientInt[0x1u] = Vem_register (
                                            VEM_EG_CLIENT,
                                            (UInt32 *) &(clientNo[1]),
                                            1,
                                            VEM_PRIORITY1,
                                            Vps_captVipSubFrameXlineSIsr,
                                            (Void *) (&pChSfObj->subFrameQ) );
    
                        if ( pChSfObj->subFrameClientInt[0x1u] == NULL )
                        {
                            rtnValue = FVID2_EFAIL;
                        }
                    }
                    #endif /* VPS_CAPT_SUBFRAME_CHECK_SEC_CHANNEL */
    
                    /* Register Channel ISR
                     * End Of Frame Reception ISR
                     */
                    if ( rtnValue == FVID2_SOK )
                    {
                        vpdmaChanNo = pChObj->vChannelId[0];
                        pChSfObj->subFrameChannelInt  =   Vem_register (
                                                VEM_EG_CHANNEL,
                                                (UInt32 *) &vpdmaChanNo,
                                                1,
                                                VEM_PRIORITY0,
                                                Vps_captVipSubFrameEOFIsr,
                                                (Void *)(&pChSfObj->subFrameQ));
    
                        if ( pChSfObj->subFrameChannelInt == NULL )
                        {
                            rtnValue = FVID2_EFAIL;
                        }
                    }
                    /* Assumption, end of frame is assumed when we get end of frame
                     * for the primary channel. Hence not registering CB for
                     * secondary channel
                     */
                }
            }
        }
    
        return (rtnValue);
    }
    
    /**
     *  Vps_captVipSubFrameUnRegisterIsr
     *  \brief This function un-register the ISR for X line interrupt and frame
     *         reception complete interrupt.
     *
     *  \param pObj   Instance object pointer.
     *
     *  \return   Returns 0 on success, negative value otherwise.
     */
    
    Int32 Vps_captVipSubFrameUnRegisterIsr ( Vps_CaptObj * pObj )
    {
        Int32 rtnValue = FVID2_SOK;
        UInt32 streamId, chId, subFrameEn;
        Vps_CaptChObj *pChObj;
        Vps_CaptSubFrameChObj *pChSfObj;
    
        for ( streamId = 0; streamId < pObj->numStream; streamId++ )
        {
            subFrameEn =
                pObj->createArgs.outStreamInfo[streamId].subFrameModeEnable;
            for ( chId = 0; chId < pObj->numCh; chId++ )
            {
                GT_assert( GT_DEFAULT_MASK, (chId == 0x0));
    
                pChObj = &pObj->chObj[streamId][chId];
                if (subFrameEn == TRUE)
                {
                    pChSfObj = &pChObj->subFrameObj;
    
                    GT_assert( GT_DEFAULT_MASK,
                        ( pChSfObj->subFrameClientInt[0x0u] != NULL ) );
                    rtnValue =
                        Vem_unRegister ( pChSfObj->subFrameClientInt[0x0u] );
                    GT_assert( GT_DEFAULT_MASK, ( rtnValue == FVID2_SOK ) );
    
                    if (pChObj->vChannelNum > 0x0u)
                    {
                        #ifdef VPS_CAPT_SUBFRAME_CHECK_SEC_CHANNEL
                        GT_assert( GT_DEFAULT_MASK,
                            ( pChSfObj->subFrameClientInt[0x1u] != NULL ) );
    
                        rtnValue =
                            Vem_unRegister (pChSfObj->subFrameClientInt[0x1u]);
    
                        GT_assert( GT_DEFAULT_MASK, ( rtnValue == FVID2_SOK ) );
                        #endif /* VPS_CAPT_SUBFRAME_CHECK_SEC_CHANNEL */
                    }
                    GT_assert( GT_DEFAULT_MASK,
                        ( pChSfObj->subFrameChannelInt != NULL ) );
    
                    rtnValue = Vem_unRegister ( pChSfObj->subFrameChannelInt );
                    GT_assert( GT_DEFAULT_MASK, ( rtnValue == FVID2_SOK ) );
                }
            }
        }
        return (rtnValue);
    }
    
    
    /**
     *  Vps_captVipSubFrameAddQObj
     *  \brief This function, adds the given frame into channels sub frame Q.
     *
     *  \param pChObj       Pointer to channel handle
     *  \param pFrame       Pointer to frame that would be saved
     *
     *  \return   Returns pointer to Vps_CaptSubFrameQObj, which was added into
     *            subFrame Q. NULL otherwise.
     */
    
    Vps_CaptSubFrameQObj * Vps_captVipSubFrameAddQObj( Vps_CaptChObj *pChObj,
                                                       FVID2_Frame *pFrame)
    {
        Int32 rtnValue;
        Vps_CaptSubFrameQObj *pQObj = NULL;
    
        GT_assert( GT_DEFAULT_MASK, (pFrame != NULL));
        GT_assert( GT_DEFAULT_MASK, (pChObj != NULL));
        GT_assert( GT_DEFAULT_MASK, (pChObj->isSubFrameEnabled == TRUE));
    
        pQObj = Vps_captVipSubFrameAllocQObj( pChObj->subFrameObj.streamId );
    
        if (pQObj != NULL)
        {
            pQObj->pFrame = pFrame;
            rtnValue = VpsUtils_quePut ( &pChObj->subFrameObj.subFrameQ,
                                         (Ptr) pQObj, BIOS_NO_WAIT );
            if ( rtnValue != FVID2_SOK )
            {
                Vps_captVipSubFrameFreeQObj ( pQObj );
                pQObj = NULL;
            }
        }
    
        return (pQObj);
    }
    
    /**
     *  Vps_captVipSubFrameAllocQObj
     *  \brief This function allocates a subframe Q object.
     *
     *  \param streamId     Stream identifier that of a given channel
     *
     *  \return   Returns pointer to Vps_CaptSubFrameQObj, NULL otherwise.
     */
    
    static Vps_CaptSubFrameQObj * Vps_captVipSubFrameAllocQObj( UInt32 streamId )
    {
        Vps_CaptSubFrameQObj *allocObj = NULL;
        UInt32 cookie, index, exitCondition, startIndex, stopIndex;
    
        exitCondition = FALSE;
        startIndex = gVps_captSubFrameQIndex;
        stopIndex = VPS_CAPT_FRAME_QUE_LEN_PER_CH_MAX;
    
        if (streamId >= VPS_CAPT_STREAM_ID_MAX)
        {
            return (allocObj);
        }
        while (TRUE)
        {
            cookie = Hwi_disable (  );
            for (index = startIndex; index < stopIndex; index++)
            {
                if (gVps_captSubFrameQObj[streamId][index].allocStatus ==
                        VPS_CAPT_SUBFRAME_FREE)
                {
                    gVps_captSubFrameQObj[streamId][index].allocStatus =
                        VPS_CAPT_SUBFRAME_ALLOC;
    
                    allocObj = &gVps_captSubFrameQObj[streamId][index];
                    gVps_captSubFrameQIndex = index;
                    gVps_captSubFrameQIndex++;
                    if (gVps_captSubFrameQIndex == VPS_CAPT_FRAME_QUE_LEN_PER_CH_MAX)
                    {
                        gVps_captSubFrameQIndex = 0x0;
                    }
                    break;
                }
            }
    
            if (allocObj == NULL)
            {
                if (exitCondition == TRUE)
                {
                    /* We have checked all entries no objects available */
                    /* Allocation error */
                    break;
                }
                startIndex = 0x0;
                stopIndex = VPS_CAPT_FRAME_QUE_LEN_PER_CH_MAX;
                exitCondition = TRUE;
            }
            else
            {
                /* We have a object */
                break;
            }
            Hwi_restore ( cookie );
        }
        return (allocObj);
    }
    
    
    /**
     *  Vps_captVipSubFrameFreeQObj
     *  \brief Releases a previously allocated sub frame Q object.
     *
     *  \param obj      Pointer to previously allocated sub frame Q object.
     *
     *  \return   Returns FVID2_SOK on success, a negative value otherwise.
     *
     *  CAUTION : Do not clear following elements of Q object
     *      1. obj->pChObj
     *      2. obj->handle
     *      3. obj->maxFrameHeight
     */
    
    static Int32 Vps_captVipSubFrameFreeQObj ( Vps_CaptSubFrameQObj *obj )
    {
        UInt32 cookie;
    
        GT_assert( GT_DEFAULT_MASK, obj);
    
        cookie = Hwi_disable (  );
    
        obj->status                 = FVID2_SOK;
        obj->pFrame                 = NULL;
        obj->totalNoOfLinesPChan    = 0x0;
        obj->totalNoOfLinesSChan    = 0x0;
        obj->allocStatus            = VPS_CAPT_SUBFRAME_FREE;
        obj->subFrameNo             = 0x0;
    
        Hwi_restore ( cookie );
    
        return (FVID2_SOK);
    }
    
    /**
     *  Vps_captVipSubFrameXlinePIsr
     *  \brief When sub frame based processing is enabled, this function would be
     *         called once every X lines are captured for the primary channel, Y
     *         case of YUV data type and G incase of RGB. This function would
     *         1. For very first X lines of a field, this function would READ and
     *            update the FID.
     *         2. Frame and issue application callbacks indicating completion of
     *            X lines reception.
     *
     *  \param event        Event that caused this interrupt. Ignored
     *  \param numEvents    Number of events that happened. Ignored
     *  \param arg          Pointer to channels subFrame queue.
     *
     *  \return   Returns 0 on success, negative value otherwise.
     */
    
    Void Vps_captVipSubFrameXlinePIsr( const UInt32 *event,
                                       UInt32 numEvents,
                                       Ptr arg )
    {
        Vps_CaptSubFrameQObj *currField = NULL;
        VpsUtils_QueHandle *qHndl = (VpsUtils_QueHandle *)arg;
        Int32 rtnValue = FVID2_SOK;
        Vps_CaptSubFrameChObj *pChSfObj = NULL;
    
        /* arg Will point to the channels Q Handle */
        /* 1. Get the address of the first element */
        rtnValue = VpsUtils_quePeek(qHndl, (Ptr *) &currField);
    
        if ((rtnValue == FVID2_SOK) && (currField != NULL))
        {
            GT_assert( GT_DEFAULT_MASK, currField->pFrame);
            /* 2. Ensure the frame under capture is valid */
            if ((currField->status == FVID2_SOK) &&
                (currField->pFrame->channelNum != VPS_CAPT_DROP_FRAME_CH_ID))
            {
                pChSfObj = &currField->pChObj->subFrameObj;
    
                /* 2.1. Check if current field is still under capture */
                if (pChSfObj->currCaptField == currField)
                {
                    /* 3. Increment the primary slice counters */
                    currField->totalNoOfLinesPChan += pChSfObj->nLineCount;
    
                    #ifdef VPS_CAPT_SUBFRAME_CHECK_SEC_CHANNEL
                    /* 3.1 if N counter > 0x2 and S counters == 0x0
                           We did not get chroma flag an error to apps */
                    if (currField->subFrameNo == 0x2)
                    {
                        if (currField->totalNoOfLinesSChan == 0x0)
                        {
                            /* Did not see any callback on secondary channel */
    
                        }
                    }
                    #endif /* VPS_CAPT_SUBFRAME_CHECK_SEC_CHANNEL */
    
                    /* 3.2 Read the FID, width and height from VIP registers */
                    if (currField->subFrameNo == 0x0)
                    {
                        /* Read FID for the very first time */
                        currField->pFrame->fid =
                            (((*pChSfObj->fidReg) & pChSfObj->maskFid)
                                >> pChSfObj->shiftFid);
    
                        #ifdef VPS_CAPT_SUBFRAME_DEBUG_CB_COUNTERS
                        /* Track FID here SUBFRAME_TBD */
                        #endif /* VPS_CAPT_SUBFRAME_DEBUG_CB_COUNTERS */
    
                    }
                    /* 3.3 Update the return value */
                    if (currField->pFrame->subFrameInfo != NULL)
                    {
                        currField->pFrame->subFrameInfo->subFrameNum =
                            currField->subFrameNo;
                        currField->pFrame->subFrameInfo->numOutLines =
                            currField->totalNoOfLinesPChan;
                    }
                    currField->subFrameNo++;
    
                    /* 4. Issue the X line callback */
                    pChSfObj->subFrameCb ( currField->handle, currField->pFrame );
                }
            }
        }
        #ifdef VPS_CAPT_SUBFRAME_DEBUG_CB_COUNTERS
        gCaptSubFrameDebug.xLineCounter++;
        #endif /* VPS_CAPT_SUBFRAME_DEBUG_CB_COUNTERS */
        return;
    }
    
    /**
     *  Vps_captVipSubFrameXlineSIsr
     *  \brief When sub frame based processing is enabled, this function would be
     *         called once every X lines are captured on secondary channel, UV
     *         in case of YUV data type. This function would update the secondary
     *         line counter.
     *         Primarily used for DEBUG.
     *
     *  \param event        Event that caused this interrupt. Ignored
     *  \param numEvents    Number of events that happened. Ignored
     *  \param arg          Pointer to channels subFrame queue.
     *
     *  \return   Returns 0 on success, negative value otherwise.
     */
    #ifdef VPS_CAPT_SUBFRAME_CHECK_SEC_CHANNEL
    Void Vps_captVipSubFrameXlineSIsr(const UInt32 *event,
                                      UInt32 numEvents,
                                      Ptr arg)
    {
        Vps_CaptSubFrameQObj *currField = NULL;
        Int32 rtnValue = FVID2_SOK;
        VpsUtils_QueHandle *qHndl = (VpsUtils_QueHandle *)arg;
    
        /* arg Will point to the channels Q Handle */
        /* 1. Get the address of the first element - */
        rtnValue = VpsUtils_quePeek( qHndl, (Ptr *) &currField );
        if ( (rtnValue == FVID2_SOK) && (currField != NULL) )
        {
            GT_assert( GT_DEFAULT_MASK, currField->pFrame );
            /* 2. Ensure the frame under capture is valid */
            if ( (currField->status == FVID2_SOK) &&
                 (currField->pFrame->channelNum != VPS_CAPT_DROP_FRAME_CH_ID) )
            {
                if ( currField->pChObj->subFrameObj->currCaptField == currField)
                {
                    /* 3. Increment the secondary slice counters */
                    currField->totalNoOfLinesSChan++;
                }
            }
        }
    
        return;
    }
    #endif /* VPS_CAPT_SUBFRAME_CHECK_SEC_CHANNEL */
    
    
    /**
     *  Vps_captVipSubFrameEOFIsr
     *  \brief When sub frame based processing is enabled and capture of a field
     *         completes. This function would perform following steps
     *          1. Get the first element from the sub frame Q
     *              Require exclusive access here
     *          1.1. Get the handle for next frame, update channel var
     *               with next frame pointer value
     *              Exit exclusive access
     *          2. Ensure current frame is NOT dummy frame and
     *              can be issue callback to application
     *          3. Check for short frames and long frames - Debug AID
     *          4. Frame and Issue callback - Read Height and Width
     *          5. Release sub frame Q object
     *
     *  \param event        Event that caused this interrupt. Ignored
     *  \param numEvents    Number of events that happened. Ignored
     *  \param arg          Pointer to channels subFrame queue.
     *
     *  \return   Returns 0 on success, negative value otherwise.
     */
    
    Void Vps_captVipSubFrameEOFIsr(const UInt32 *event,
                                      UInt32 numEvents,
                                      Ptr arg)
    {
        /* Note :   In situation where in N line ISR has low pirority when compared
            with frame completion ISR, N line ISR could be preempted. To ensure that
            consistency between N line CB and end of frame CB
            1. Have a global var in channel handle that will hold current frame
                under reception.
            2. Frame complete CB will update this as a first step in ISR
            3. In N lines ISR compare this var with pFrame value if its not same
               do not issue N line CB.
        */
    
        UInt32 cookie, widthAtEof, heightAtEof;
        VpsUtils_QueHandle *qHndl = (VpsUtils_QueHandle *)arg;
        Vps_CaptSubFrameQObj *compField, *currField;
        Vps_CaptSubFrameChObj *pChSfObj = NULL;
        Vps_CaptRtParams *pRtParams = NULL;
    
        /* arg Will point to the channels Q Handle */
        /* 1. Get the first element - First frame captured */
    
        VpsUtils_queGet( qHndl, (Ptr *) &compField, 1, BIOS_NO_WAIT );
    
        if ( compField != NULL )
        {
            /* 1.1. Update the pFrame with current frame under reception */
            cookie = Hwi_disable (  );
    
            VpsUtils_quePeek( qHndl, (Ptr *) &currField );
    
            if ( currField != NULL )
            {
                currField->pChObj->subFrameObj.currCaptField = currField;
            }
            Hwi_restore ( cookie );
    
            GT_assert( GT_DEFAULT_MASK, compField->pFrame );
            /* 2. Ensure the frame under capture is valid */
            if ( compField->pFrame->channelNum != VPS_CAPT_DROP_FRAME_CH_ID )
            {
                pChSfObj = &compField->pChObj->subFrameObj;
                /* Read the width and Height */
                widthAtEof = (((*pChSfObj->srcSizeWidthReg) & pChSfObj->maskWidth)
                                >> pChSfObj->shiftWidth);
                heightAtEof = (((*pChSfObj->srcSizeHeightReg) & pChSfObj->maskHeight)
                                >> pChSfObj->shiftHeight);
    
                /* Check if we can update sub frame info */
                if ( compField->pFrame->subFrameInfo != NULL )
                {
                    /* 3. Check short / long frames - debug trackers */
                    #ifdef VPS_CAPT_SUBFRAME_DEBUG_CB_COUNTERS
                    if (pChSfObj->expectSFCount !=
                            VPS_CAPT_SUBFRAME_HEIGHT_UNLIM_EXPECTED_SF_COUNT)
                    {
                        if ( compField->subFrameNo != (pChSfObj->expectSFCount - 0x1u) )
                        {
                            /* Did not receive expected number of sub frames.
                               Due to connect / disconnect ?
                               Nothing much could be done, tell the apps frame
                               is completed, increment debug counters */
    
                            gCaptSubFrameDebug.shortFrames++;
                        }
                    }
                    else
                    {
                        /* Track the minimum sub frames and maximum sub frames */
                        if (gCaptSubFrameDebug.minSubFrames > compField->subFrameNo)
                        {
                            gCaptSubFrameDebug.minSubFrames = compField->subFrameNo;
                            if (gCaptSubFrameDebug.shortFrameTrigFlag == 0x0)
                            {
                                gCaptSubFrameDebug.shortFrameTrigFlag = 0x01;
                            }
                            else
                            {
                                gCaptSubFrameDebug.shortFrames++;
                            }
                        }
                        if (gCaptSubFrameDebug.maxSubFrames < compField->subFrameNo)
                        {
                            gCaptSubFrameDebug.maxSubFrames = compField->subFrameNo;
                        }
                    }
                    #endif /* VPS_CAPT_SUBFRAME_DEBUG_CB_COUNTERS */
    
                    /* End Of Frame, its expected to receive full buffer, if few
                       lines were missing, nothing much can be done. Tell the app
                       we captured complete frame */
                    compField->pFrame->subFrameInfo->subFrameNum =
                        compField->subFrameNo;
                    compField->pFrame->subFrameInfo->numOutLines = heightAtEof;
                }
    
                /* 4.1 Update the height and width */
                if (NULL != compField->pFrame->perFrameCfg)
                {
                    pRtParams = (Vps_CaptRtParams *)compField->pFrame->perFrameCfg;
    
                    /* udpate width x height in run time per frame config */
                    pRtParams->captureOutWidth = widthAtEof;
                    pRtParams->captureOutHeight = heightAtEof;
    
                }
                #ifdef VPS_CAPT_SUBFRAME_DEBUG_CB_COUNTERS
                if (gCaptSubFrameDebug.maxHeight < heightAtEof)
                {
                    gCaptSubFrameDebug.maxHeight = heightAtEof;
                }
                if (gCaptSubFrameDebug.minHeight > heightAtEof)
                {
                    gCaptSubFrameDebug.minHeight = heightAtEof;
                }
                if (gCaptSubFrameDebug.maxWidth < widthAtEof)
                {
                    gCaptSubFrameDebug.maxWidth = widthAtEof;
                }
                if (gCaptSubFrameDebug.minWidth > widthAtEof)
                {
                    gCaptSubFrameDebug.minWidth = widthAtEof;
                }
                #endif /* VPS_CAPT_SUBFRAME_DEBUG_CB_COUNTERS */
                /* 4.2 Issue the callback */
                pChSfObj->subFrameCb ( compField->handle, compField->pFrame );
            }
            /* 5. Release sub frame Q */
            Vps_captVipSubFrameFreeQObj ( compField );
    
        }
    
        #ifdef VPS_CAPT_SUBFRAME_DEBUG_CB_COUNTERS
        gCaptSubFrameDebug.eofCounter++;
        #endif /* VPS_CAPT_SUBFRAME_DEBUG_CB_COUNTERS */
        return;
    }
    

     

     

  • Hi Brijesh,

        Are there any changs required in my reset api?

    Regards,

    BU

  • Hi zhuohua,

     

    There are some changes required, i am making those changes, i will share the patch once it is ready.

     

    Regards,

    Brijesh

  • Hi Brijesh,

        Thanks for your response.I`m still debugging in this issue.

        Is there any datesheet available for those two registers?

        After setting those two register to "0xFFFFFFFFu", is there any possiblity to ran into other problems?

        Thanks.

    Regards,

    Bu

  • Hi Brijesh,

        Is there any progress about this issue ?

        I`m now trying to program an invaild coefficient to scaler before VP reset ,so that I can know whether I have programmed a new  coefficient to scaler when necessary.

        But I·m not sure which IOCTL can program the coefficient to the scaler. Can you help me?

        Thanks.

    Regards,

    Bu

  • Hi,

     

    You could use ioctl IOCTL_VPS_CAPT_SET_SC_PARAMS to change all scalar parameters, please go through the structure Vps_CaptScParams to change coefficients parameters.

     

    Still not, i will send patch once i have solution.

     

    regards,

    Brijesh Jadav

  • Hi Brijesh,

        This issue seems to be the VIP_SC is still running while VIP reset. So I want to make sure VIP_sc is not processing any frames before calling IOCTL_VPS_CAPT_RESET_AND_RESTART to reset VIP.

         I`m doing some experiments and I have some question .

         1, I called IOCTL_VPS_CAPT_SET_SC_PARAMS to set a  invalid coeff parameters to VIP_SC before IOCTL_VPS_CAPT_RESET_AND_RESTART. The issue still happens.  I`m not sure whether the VIP_SC  is stop after I do this.Is there any semaphore to show VIP_SC stop??

         2, How can I enable/disable lazy_loading for VIP_SC? 

        By the way,I want to tell you that after I change those two registers last week , the issue is still happened when switchover the video source between 1080P60/720p60/1280*1024@60.  Not by connect and disconnect.

        pls let me know if you have make progress.Thanks!!!

    regards,

    Bu

        

  • Hi,

     

    Could you do one experiment? Can you bypass the scalar, ie, set the ScEnable flag to 0 in capture link? As such, the setting of these two registesr should have fixed this issue, but let 's check if it comes even if scalar is not in the path.

     

    Regards,

    Brijesh Jadav

  • Hi,

        I have done this experiment before. I set scEnable to 0 in captureLink without setting those two register to "0xffffffffu", and I tested it by both two ways for serveral days:(1)disconnect and reconnect mang times ;(2) switchover the video source between different resolutions. The hang up events did not happened again .

        If we disable scalar in VIP ,I think this issue will not happen.

    Regards,

    Bu

  • Hi Brijesh,

        I want to do more experiments about controling VIP_SC.

        1,How can I disable lazy_loading while loading VIP_SC coeff.

        2,when VIP_SC finished progressing a frame , is there anything telling that?

        Thanks !

    Regards

    Bu

  • Brijesh Jadav said:

    Hi,

     

    You could use ioctl IOCTL_VPS_CAPT_SET_SC_PARAMS to change all scalar parameters, please go through the structure Vps_CaptScParams to change coefficients parameters.

     

    Still not, i will send patch once i have solution.

     

    regards,

    Brijesh Jadav

    Hi Brijesh,

        If I uesd IOCTL_VPS_CAPT_SET_SC_PARAMS to change vip inline scalar parameters, will the coeff parameters be loaded to scaler immediately ? Or I should diable lazyloading first ?

        Do you have any progress on this issue ? Is there any advise for debugging ? I can do some experiments.

        Thanks.

    Regards,

    Bu

  • Hi Brijesh,

        Are you still debugging on this issue?

        I found that when the issue happened, state of two vip ports is as follows:

           gVps_captCommonObj.captureObj[0].state = 3    (running)

           gVps_captCommonObj.captureObj[2].state = 1    (created)

        what does these mean?

    regards

    Bu

  • Please check the API Vps_captResetAndRestart  in the file ti\psp\vps\drivers\capture\src\vpsdrv_captureApi.c and see if below code is present.

     

     

        for ( instId = 0; instId < VPS_CAPT_INST_MAX; instId++ )

        {

            pObj = &gVps_captCommonObj.captureObj[instId];

     

            if(overFlowStatus->isPortOverFlowed[instId])

            {

                for (streamId = 0u; streamId < pObj->numStream; streamId ++)

                {

                    for (chCnt = 0u; chCnt < pObj->numCh; chCnt ++)

                    {

                        pObj->chObj[streamId][chCnt].numDropData =

                                VPS_CAPT_MAX_DROP_FRAMES;

                    }

                }

     

                Vps_captStart(pObj);

            }

        }

  • Hi Shawn,

        Yes,we have that code in Vps_captResetAndRestart API.

        By the way, I have two question about this issue:

        In our code ,when connect/disconnect happen,we will stop VIP--delete--creat---start VIP. But we did not clear the FIQ status register before stop VIP.

        I also found that when this hang-up issue happened ,the VIP1 FIQ status register is 0x00000010. Maybe this result in hang up.

        when VIP restart , FIQ status register of both VIP0 and VIP1 MUST be clear??

        Thanks

  • hi zhuohua,

    This FIQ indicate VIP overflow, so you need clear it first,

    here clear means reset VIP parser, VIP SC, and so on

  • Shawn,

    Does this code exist in DVRRDK 2.0 ?

    My customer is facing similar issue. BTW they are using PG 2.0.

    BR,

    Eason

  • the key code for this function is:

    CaptureLink_drvOverflowDetectAndReset

    Vps_captResetAndRestart

    Please help check if those API are there and also they can compare that part with the 4.0 code.