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.

TDA3MV: How to feed camera frame into TIDL by iss capture link

Part Number: TDA3MV
Other Parts Discussed in Thread: SYSBIOS

Hi,

I would like to run tidl with sensor AR0140 through iss capture link on TDA3 rvp.

I generated a new use-case for it, but I couldn't see anything from camera.

But when I remove tidl link from my use-case, the camera worked well.

1. Can you please help me check my use-case.txt is correct?

Here is my txt content,

IssCapture -> IssM2mIsp -> IssM2mSimcop -> Dup -> Merge

IssM2mIsp -> Alg_IssAewb

IssM2mIsp -> Alg_SceneObstructionDetect (IPU1_0)

Alg_SceneObstructionDetect -> Null

Dup -> Alg_tidlpreproc (IPU1_0) -> Alg_tidl_Eve1 (EVE1) -> Alg_tidl_Dsp (DSP1) -> Merge

Merge -> Sync -> Alg_tiop (DSP1) -> Alg_ObjectDraw -> Display_Video

GrpxSrc -> Display_Grpx

2. Can you also suggest me what to do next?

3. Can I use vip capture link instead of iss capture link on TDA3?

Thany you,

Gary

  • Hi,

    Can you share logs for working case & non-working case? & It's supported only ISS capture.

    Thanks

    Gaviraju

  • Hi Gaviraju,

    My working case is almost the same as use-case "iss_capture_isp_simcop_display".

    The difference is I removed "IssM2mResizer" link from it.

    The non-working case is combine "iss_capture_isp_simcop_display" & "tidlOD", which the use-case.txt is as below.

    UseCase: chains_issTidlOD
    
    IssCapture -> IssM2mIsp -> IssM2mSimcop -> Dup -> Merge
    
    IssM2mIsp -> Alg_IssAewb
    
    Dup -> Alg_tidlpreproc (IPU1_0) -> Alg_tidl_Eve1 (EVE1) -> Alg_tidl_Dsp (DSP1) -> Merge
    
    Merge -> Sync -> Alg_tiop (DSP1) -> Alg_ObjectDraw -> Display_Video
    
    GrpxSrc -> Display_Grpx
    

    Here are two cases logs,

    iss_capture_isp_simcop_display_log.txt

    iss_tidlOD_log.txt

    In my observation, the fps is quite low at issCapture link in non-working case.

    I guess the capture link is not started correctly, however, the issCapture parts in  non-working case are copy from working one.

    1. Can you suggest what to do?

    2. Are above use-case link connections correct?

    3. How to trace data flow of camera from debug mode?

        Can you give me some hints? Are there any specific functions taking care of camera data?

    Thank you,

    Gary

  • Hi,

    Are you creating a use-case manually or using a use-case-gen-tool?

    All the frames are dropping at the sync link, so what is the "syncThreshold" value is set in the use-case?

    Thanks

    Gaviraju

  • Hi Gaviraju,

    1. I use use-case-gen-tool to generate _priv.h & _priv.c, then manually create the use-case.c .

    2. syncThreshold is 600, what value do you suggest?

    thank you,

    Gary

  • Hi

    Set syncThreshold = 6000 then see the result.

    Thanks

    Gaviraju

  • Hi Gaviraju,

    After changing syncThreshold to 6000, frames don't drop anymore. But the fps is quite low (0.1x fps) for all links and I still can't see camera frames on my monitor.

    I found the process stop processing frames @ line329  in IssCaptureLink_drvProcessData(). Because the status value is -8, which should be 0 in normal case. So it can't pass if-else condition. Therefore, all the afterward processes will be skip.

    The line329 code is as below,

    if ((0U != frmList.numFrames) && (FVID2_SOK == status))

    I guess this is why the issCapture link fps so low and why I can't see camera capture results on monitor.

    Can you suggest how to fix this issue?

    Here is the debug log file.

    iss_tidlOD_sync(6000)_log.txt

    Thank you,

    Gary

  • Hi,

    From the log, I observed you are getting this error 

    Assertion @ Line: 191 in system_linkApi.c: procId < SYSTEM_PROC_MAX : failed !!!

    It seems you are passing the wrong link ID to function "System_sendLinkCmd", So please check the link ID in this function.

    > if ((0U != frmList.numFrames) && (FVID2_SOK == status))

    This will fail when there is no output buffer available in the queue

    The Source to Link Latency from ISSM2MSIMCOP  to ALG_TIDLPREPROC is taking too much of time around 1200 ms, So please add timestamp print statement while sending NEW_DATA command in  ISSM2MSIMCOP  link & add same print in the ALG_TIDLPREPROC  link when you are receiving new data command & observe the differences. 

    Thanks

    Gaviraju

  • Hi Gaviraju,

    By your help, I have solved my problem, thank you.

    But the system runs so slow, the bottle neck is alg_tidlpreproc @ IPU1_0, which the IPU usage is 90%.

    Also, most frames are drop @  ISSM2MSIMCOP stage.

    Here is debug log of ISSM2MSIMCOP.

    [2020-02-07 16:55:50.741] [IPU1-0]    128.253736 s:  ### CPU [IPU1-0], LinkID [ 89],
    [2020-02-07 16:55:50.788] [IPU1-0]    128.253827 s:  
    [2020-02-07 16:55:50.788] [IPU1-0]    128.253858 s:  [ ISSM2MSIMCOP ] Link Statistics,
    [2020-02-07 16:55:50.788] [IPU1-0]    128.253919 s:  ******************************
    [2020-02-07 16:55:50.788] [IPU1-0]    128.253980 s:  
    [2020-02-07 16:55:50.788] [IPU1-0]    128.254041 s:  Elapsed time       = 103408 msec
    [2020-02-07 16:55:50.788] [IPU1-0]    128.254102 s:  
    [2020-02-07 16:55:50.788] [IPU1-0]    128.254132 s:  New data Recv      =  30.9 fps
    [2020-02-07 16:55:54.516] [IPU1-0]    128.254224 s:  Get Full Buf Cb    =   0.77 fps
    [2020-02-07 16:56:05.935] [IPU1-0]    128.254285 s:  
    [2020-02-07 16:56:05.935] [IPU1-0]    128.254346 s:  Input Statistics,
    [2020-02-07 16:56:05.935] [IPU1-0]    128.254407 s:  
    [2020-02-07 16:56:05.935] [IPU1-0]    128.254437 s:  CH | In Recv | In Drop | In User Drop | In Process
    [2020-02-07 16:56:05.935] [IPU1-0]    128.254529 s:     | FPS     | FPS     | FPS          | FPS        
    [2020-02-07 16:56:09.726] [IPU1-0]    128.254620 s:  --------------------------------------------------
    [2020-02-07 16:56:09.726] [IPU1-0]    128.254712 s:   0 |  30. 9     29.32      0. 0           0.77
    [2020-02-07 16:56:09.726] [IPU1-0]    128.254864 s:  
    [2020-02-07 16:56:09.726] [IPU1-0]    128.254895 s:  Output Statistics,
    [2020-02-07 16:56:09.726] [IPU1-0]    128.254956 s:  
    [2020-02-07 16:56:09.726] [IPU1-0]    128.254986 s:  CH | Out | Out     | Out Drop | Out User Drop
    [2020-02-07 16:56:09.726] [IPU1-0]    128.255047 s:     | ID  | FPS     | FPS      | FPS           
    [2020-02-07 16:56:09.726] [IPU1-0]    128.255139 s:  ---------------------------------------------
    [2020-02-07 16:56:13.517] [IPU1-0]    128.255230 s:   0 |  0      0.77     0. 0      0. 0
    [2020-02-07 16:56:13.517] [IPU1-0]    128.256725 s:  
    [2020-02-07 16:56:13.517] [IPU1-0]    128.256816 s:  [ ISSM2MSIMCOP ] LATENCY,
    [2020-02-07 16:56:13.517] [IPU1-0]    128.256877 s:  ********************
    [2020-02-07 16:56:13.517] [IPU1-0]    128.256938 s:  Local Link Latency     : Avg =   5681 us, Min =   5459 us, Max =   6344 us,
    [2020-02-07 16:56:13.517] [IPU1-0]    128.257060 s:  Source to Link Latency : Avg =  12302 us, Min =  12048 us, Max =  14121 us,
    [2020-02-07 16:56:17.292] [IPU1-0]    128.257213 s:  
    [2020-02-07 16:56:17.292] [IPU1-0]    128.257274 s:  CPU [  IPU1-0], LinkID [ 25], Link Statistics not available !

    My questions are,

    1. Is it normal that usage of alg_tidlpreproc  so high?
        if no,can you suggest how to lower the usage?

    2. Can you also suggest how to decrease the # of dropping frames in ISSM2MSIMCOP stage.

    Thank you,

    Gary

  • Hi 

    Please share the complete log & what is the no of  O/P buffer set in the use case?

    Thanks

    Gaviraju

  • Hi Gaviraju,

    Here is the log iss_tidlOD_algousage(89)_log.txt

    I'm not sure what is O/P buffer, if you mean # of input buffers in tidlpreprocLink_algPlugin.c, then the buffer number is 2.

    Also, can I run alg_tidlpreproc on IPU1_1? I saw the usage of IPU1_1 only 2%, so if I run the function on it, will fps increase?

    Thank you,

    Gary

  • Hi

    No of input buffer is set in every usecase file, generally it will be 4

    You can run alg_tidlpreproc on IPU1_1 but this link is not creating issue & ALG_ISS_AEWB link is taking around 212 ms this consuming more CPU cycle, So the load is almost 100 on IPU1_1.

    Please chaeck why it's taking this much time.

    Have added any new link in the chain?

    Can you share usecase source code ?

    Thanks

    Gaviraju

  • Hi Gaviraju,

    1. I checked  the time consuming in AlgorithmLink_issAewb1Process().
        It sometimes took 3-4 secs at below section,

    if ((UInt32)TRUE == pLinkCreatePrms->runAewbOnlyForOneCh)
    {
    	for (cnt = 0U; cnt < pAlgObj->inQueInfo.numCh; cnt ++)
    	{
    		((AlgorithmLink_IssAewbOutParams*)
    			pOutMetaBuf->bufAddr[0U])->channelId = cnt;
    		pIspCfg->channelId = cnt;
    		pLinkCreatePrms->cfgCbFxn(
    			(AlgorithmLink_IssAewbOutParams *)
    				pOutMetaBuf->bufAddr[0U],
    			pIspCfg, pLinkCreatePrms->appData);
    	}
    }
    else
    {
    	pLinkCreatePrms->cfgCbFxn(
    		(AlgorithmLink_IssAewbOutParams *)
    			pOutMetaBuf->bufAddr[0U],
    		pIspCfg, pLinkCreatePrms->appData);
    }
    Utils_updateLatency(&linkStatsInfo->linkLatency,
    					pSysOutBuffer->linkLocalTimestamp);
    Utils_updateLatency(&linkStatsInfo->srcToLinkLatency,
    					pSysOutBuffer->srcTimestamp);
    
    linkStatsInfo->linkStats.chStats
    			[pSysInBuffer->chNum].inBufProcessCount++;
    linkStatsInfo->linkStats.chStats
    			[pSysInBuffer->chNum].outBufCount[0]++;

    Does it normal? Can you suggest what to do?

    2. When I tried to remove iss_aewb link from usecase, "procId < SYSTEM_PROC_MAX : failed" happend again.
    As you mentioned before, I checked the procId was 15 < SYSTEM_PROC_MAX(10).
    How can I know which link owned this Id from my usecase?

    Thank you,
    Gary

  • Hi,

    Can you suggest how to low the IPU usage for my usecase?

    Thank you,
    Gary

  • Hi

    You can run alg_tidlpreproc on Algorithm link on IPU1_1 & this will increase your FPS

    Thanks 

    Gaviraju

  • Hi Gaviraju,

    I got this error msg when setting alg_tidlpreporc on IPU1_1.

    "Error: Link [Alg_tidlpreproc] cannot be assigned to CPU [IPU1_1] (Valid CPUs:[A15, IPU1_0]) !!!"

    It looks Alg_tidlpreproc can't be run on IPU1_1.

    Have any suggestions?

    Thank you,
    Gary

  • Hi,

    By default, it's not supported.

    So you have to do the below change.

    File: vision_sdk/apps/tools/vision_sdk_usecase_gen/processor.cpp

    case cAlg_tidlpreproc:
    if(!(pType == A15 || pType == IPU1_0 || pType == DSP1))  replace this line with below one.

    if(!(pType == A15 || pType == IPU1_0 || pType == IPU1_1 || pType == DSP1)) 

    After changing this you have the build code as follow.

    Run the below command from the vision_sdk/apps/tools/vision_sdk_usecase_gen/  directory.

    make clean

    make.

    Now you can generate the autogenerated .c & .h file using auto-generation tool.

    By Default Algorithm build only for IPU1_0, A15, DSP1 cores, So you have to add below line in the makefile.

    SRCS_ipu1_1 += tidlpreprocLink_algPlugin.c

    After adding the above changes, clean & rebuild the vision-SDK.

    Thanks

    Gaviraju 

  • Hi Gaviraju ,

    When doing make clean & make, I met follow error.

    Can you suggest how to fix it?

    $ gmake clean
    rm -rf objs
    rm scan.cpp parse.tab.cc parse.tab.hh parse.output location.hh position.hh stack.hh
    rm: cannot remove 'scan.cpp': No such file or directory
    rm: cannot remove 'parse.tab.cc': No such file or directory
    rm: cannot remove 'parse.tab.hh': No such file or directory
    rm: cannot remove 'parse.output': No such file or directory
    rm: cannot remove 'location.hh': No such file or directory
    rm: cannot remove 'position.hh': No such file or directory
    rm: cannot remove 'stack.hh': No such file or directory
    gmake: [clean] Error 1 (ignored)
    
    -----
    $ gmake
    mkdir -p objs
    mkdir -p bin
    bison -vd parse.yy
    process_begin: CreateProcess(NULL, bison -vd parse.yy, ...) failed.
    make (e=2): ▒t▒Χ䤣▒▒▒▒w▒▒▒ɮסC
    gmake: *** [parse.tab.cc] Error 2
    

    Thank you,
    Gary

  • Hi

    GCC compiler & Bison, flex, etc these tools are needed if you are building from windows.

    Make sure these are available in your system environment.

    or 

    Build from Linux OS.

    Thanks

    Gaviraju

  • Hi Gaviraju ,

    As you mentioned, "...you have to add below line in the makefile", which makefile should I add this line.

    When I added in alg_plugins's makefile, it still not work.

    Thank you,
    Gary

  • Hi

    SRCS_ipu1_1 += tidlpreprocLink_algPlugin.c

    file: vision_sdk/apps/src/rtos/alg_plugins/tidl/SRC_FILES.MK

    Thanks

    Gaviraju

  • Hi Gaviraju,

    When I ran alg_tidlpreproc on IPU1_1, there was an "out of memory" error.
    Here is the debug log,


    [IPU1-0]     21.251204 s:  ### XDC ASSERT - ERROR CALLBACK START ###
    [IPU1-0]     21.251265 s:
    [IPU1-0]     21.251540 s: out of memory: handle=0x8208b2fc, size=64920576
    [IPU1-0]     21.251631 s:
    [IPU1-0]     21.251662 s:  ### XDC ASSERT - ERROR CALLBACK END ###
    [IPU1-0]     21.251753 s:
    [IPU1-0]     21.252180 s: ti.sysbios.heaps.HeapMem: line 221: ti.sysbios.heaps.HeapMem: line 221: out of memory: handle=0x8208b2fc, size=64920576
    [IPU1-1]     21.252455 s:  Assertion @ Line: 460 in dmaSwMs/dmaSwMsLink_algPlugin.c: pSystemVideoFrameBuffer->bufAddr[0] != NULL : failed !!!
    [IPU1-1]     21.253187 s:  Assertion @ Line: 460 in dmaSwMs/dmaSwMsLink_algPlugin.c: pSystemVideoFrameBuffer->bufAddr[0] != NULL : failed !!!

    Here is the related code.

         pSystemVideoFrameBuffer->bufAddr[0] =
                            Utils_memAlloc(
                                    UTILS_HEAPID_DDR_CACHED_SR,
                                    ( pDmaSwMsObj->outBufSize ),
                                    ALGORITHMLINK_FRAME_ALIGN
                                );

    and
         outBufSize = pDmaSwMsObj->outPitch[0] * maxHeight * 2;

    Can you suggest what maxHeight should be and where can I find it?

    Thank you,
    Gary

  • Hi,

    Please print the "outBufSize" variable & see the value is valid or not.

    This value depends on the width, & height set in the use-case. So check what value are you set in the use-case.

    Refer below usecase file for setting 

    vision_sdk\apps\src\rtos\usecases\iss_mult_capture_isp_simcop_stereo_tda3xx\chains_issMultCaptIspSimcop_Stereo.c

    #define REMAP_WIDTH 800
    #define REMAP_HEIGHT 384 these 2 macro used to set "dmaSwMsLink" width & hieght

    Thanks

    Gaviraju