TDA2SX: How to use sw mosaic link

Part Number: TDA2SX

When using tda2sx, the customer intends to establish a link with five camera inputs and one output, which can be converted to an H.264 video file and saved.

And the customer would like to use the AlgorithmLink_DmaSwMs link implemented by TI, but not sure the way to use it.

For example, the five input channel numbers are configured, and the corresponding image data is intercepted and copied into the input memory buffer. 

The customer would like to know is it possible to provide a complete routine for reference.

Thanks!

Best Regards,

Cherry Zhou

  • Hi,

    Updates as follows:

    Try adding the link algorithm_DmaSwMs on the old link. Parameter settings, etc. refer to the code in vsdk/apps/src/hlos/adas/src/usecases/src_calibration.

    The compile can pass, but the error is reported at runtime as follows:

    ASSERT (chains_tidlOD_xxx_APA_priv.c|chains_tidlOD_xxx_APA_Create|339)
    [HOST] [IPU2  ]    363.067223 s:  ALG: ERROR: No alg create function specified  (algId = 0) !!!
    Line 338 and line339 are as follows:
     status = System_linkCreate(pObj->Alg_DmaSwMsLinkID, &pObj->Alg_DmaSwMsPrm, sizeof(pObj->Alg_DmaSwMsPrm));
           UTILS_assert(status == SYSTEM_LINK_STATUS_SOK);
    The customer found that there was an error when the link was created, and the customer would like to know is there anything to aware of when configuring the parameters?
    Thanks again!
    Best Regards,
    Cherry
  • Hi,

    May I know is there any updates?

    Thanks!

    Best Regards,

    Cherry

  • Hi Cherry Zhao,

     status = System_linkCreate(pObj->Alg_DmaSwMsLinkID, &pObj->Alg_DmaSwMsPrm, sizeof(pObj->Alg_DmaSwMsPrm));
           UTILS_assert(status == SYSTEM_LINK_STATUS_SOK);

    It looks like some configuration issue, Can you share your sw mosaic input parameters? 

    You could also refer to API AlgorithmLink_dmaSwMsCreate in the vision_sdk\apps\src\rtos\alg_plugins\dmaSwMs\dmaSwMsLink_algPlugin.c file to figure out reason for create failure. 

    Regards,

    Brijesh

  • Hi Brijesh,

    The customer would like to know what does the dmaswms input parameter mean. The configuration is written as a function in another file, with minor changes, as shown below:

    static Void desay_APA_SetAlgDmaSwMsPrm(
                        AlgorithmLink_DmaSwMsCreateParams *pPrm1,
                        //AlgorithmLink_DmaSwMsCreateParams *pPrm2,
                        UInt32 numLvdsCh,
                        UInt32 displayWidth,
                        UInt32 displayHeight
                       )
    {
        printf("enter %s, func %s, line %d \r\n",__FILE__, __FUNCTION__, __LINE__);
        UInt32 winId;
        AlgorithmLink_DmaSwMsLayoutWinInfo *pWinInfo;
        UInt32 widthFactor, heightFactor;

        //pPrm2->maxOutBufWidth     = displayWidth;
        //pPrm2->maxOutBufHeight    = displayHeight * 2;
        //pPrm2->numOutBuf          = 4;
        //pPrm2->useLocalEdma       = FALSE;
        pPrm1->maxOutBufWidth     = displayWidth;
        pPrm1->maxOutBufHeight    = displayHeight * 2;
        pPrm1->numOutBuf          = 4;
        pPrm1->useLocalEdma       = FALSE;

        //pPrm2->initLayoutParams.numWin = numLvdsCh / 2;
        //pPrm2->initLayoutParams.outBufWidth  = pPrm2->maxOutBufWidth;
        //pPrm2->initLayoutParams.outBufHeight = pPrm2->maxOutBufHeight;
        pPrm1->initLayoutParams.numWin =  numLvdsCh / 2;// - pPrm2->initLayoutParams.numWin;
        pPrm1->initLayoutParams.outBufWidth  = pPrm1->maxOutBufWidth;
        pPrm1->initLayoutParams.outBufHeight = pPrm1->maxOutBufHeight;

        switch (numLvdsCh)
        {
            case 1:
                widthFactor  = 1;
                heightFactor = 1;
                pPrm1->initLayoutParams.numWin = 1;
               // pPrm2->initLayoutParams.numWin = 0;
                break;
            case 2:
                widthFactor  = 1;
                heightFactor = 1;
                pPrm1->initLayoutParams.numWin = 1;
               // pPrm2->initLayoutParams.numWin = 1;
                break;
            case 3:
                widthFactor  = 1;
                heightFactor = 2;
                pPrm1->initLayoutParams.numWin = 2;
             //   pPrm2->initLayoutParams.numWin = 1;
                break;
            case 4:
                widthFactor  = 1;
                heightFactor = 2;
                pPrm1->initLayoutParams.numWin = 2;
             //   pPrm2->initLayoutParams.numWin = 2;
                break;
            default:
                widthFactor  = 1;
                heightFactor = 2;
                pPrm1->initLayoutParams.numWin = 2;
             //   pPrm2->initLayoutParams.numWin = 2;
                break;
        }

        /* assuming 4Ch LVDS and 2x2 layout */
        for(winId=0; winId<pPrm1->initLayoutParams.numWin; winId++)
        {
            pWinInfo = &pPrm1->initLayoutParams.winInfo[winId];

            pWinInfo->chId = winId;

            pWinInfo->inStartX = 0;
            pWinInfo->inStartY = 0;

            pWinInfo->width     =
                SystemUtils_floor(pPrm1->initLayoutParams.outBufWidth/widthFactor, 16);
            pWinInfo->height    =
                pPrm1->initLayoutParams.outBufHeight/heightFactor;

            /* winId == 0 */
            pWinInfo->outStartX = 0;
            pWinInfo->outStartY = 0;

            if(winId==1)
            {
                pWinInfo->outStartX = 0;
                pWinInfo->outStartY = pWinInfo->height;
            }
        }
    #if 0
        for(winId=0; winId<pPrm2->initLayoutParams.numWin; winId++)
        {
            pWinInfo = &pPrm2->initLayoutParams.winInfo[winId];

            pWinInfo->chId = winId;

            pWinInfo->inStartX = 0;
            pWinInfo->inStartY = 0;

            pWinInfo->width     =
                SystemUtils_floor(pPrm2->initLayoutParams.outBufWidth/widthFactor, 16);
            pWinInfo->height    =
                pPrm2->initLayoutParams.outBufHeight/heightFactor;

            /* winId == 0 */
            pWinInfo->outStartX = 0;
            pWinInfo->outStartY = 0;
            if(winId==1)
            {
                pWinInfo->outStartX = 0;
                pWinInfo->outStartY = pWinInfo->height;
            }
        }
    #endif
    }

    Also, the customer would like to know if there is a document available for reference that describes the use of DmaSwMS Link.

    Thanks!

    Best Regards,

    Cherry

  • Hi Cherry,

    DMA parameter describes how and where to put the different images in the final output buffer, like position, size etc information. 

    I am not sure if there is any documentation, can you please refer to userguide/datasheet? 

    Any further update on where create is failing?

    Regards,

    Brijesh

  • Hi Brijesh,

    Thanks for your reply!

    The latest updates are as follows:

    The customer has tried several times to call algorithm_dmaSwMs link in HLOS side but failed. and the log printed in screen is: ALG: ERROR: No alg create function specified (algId = 0, max:28) !!!
    After browsing the source code, the customer found that the function AlgorithmLink_DmaSwMs_initPlugin() hasn't been called, and the caller is AlgorithmLink_initAlgPlugins() function which located in " links_fw/src/hlos/links_a15/algorithm/algorithmLink_cfg.c ".

    Then trying to call the AlgorithmLink_DmaSwMs_initPlugin() in AlgorithmLink_initAlgPlugins() but failed again, the compiler shows that :

    " algorithmLink_cfg.c:(.text+0x36): undefined reference to `AlgorithmLink_DmaSwMs_initPlugin' "

    and after checking the source code, the header file included is

    .. apps_xxx/include/alglink_api/algorithmLink_dmaSwMs.h

    after that, the customer found this QA in TI website:

    https://e2e.ti.com/support/processors-group/processors/f/processors-forum/870149/compiler-tda2pxevm-linux-assertion-while-creating-new-plugin-in-linux

    and in this page, the TI engineer wrote:

    Please refer below alg plugin
    vision_sdk\apps\src\hlos\adas\src\alg_plugins\framecopy
    You are getting undefined reference that means you have not defined AlgorithmLink_SurroundView3d_initPlugin function in correct file.
    It seems that  when algorithm link used in hlos side, the coder should put source into vision_sdk\apps\src\hlos\adas\src\alg_plugins path.

    Issue:
    How to use the algorithm_dmaSwMs link in HLOS size?

    Could you please provide some advice on this situation? 
    Thanks!
    Best Regards,
    Cherry
  • Hi Cherry,

    There used to be a common header file (i think some system_cfg.h), which included defines macros for all algorithms. Can you please search for ALG_dmaSwMs and see if it is defined somewhere? If this is not defined, then DMA SW Ms will not be included in the build.

    Regards,

    Brijesh

  • Hi Brijesh,

    Sorry for the delay.

    The latest updates are as follows:

    The customer has tried to re-edit the system_cfg.h file, but it seems that this file is auto genergated by shell script, i.e. it would like turn back to original file after edited and saved it.  and then found a little difficult to find the shell script which generated this system_cfg.h file. could you kindly point out the shell script file or something else to auto edit the system_cfg.h file?

    Actually customer solves this issue by making a new dma mosaic link and putting it in ... links_fw/src/rtos/links_common path , now it works and produces the mosaiced images already. This link take reference on algorithm_dmaSwMS link develped by our colleagues.

    Currently the customer wanna use the algorithm_dmaSwMS link in project, since he guess it would run more fluently on the board.

    Thanks and Best Regards,

    Cherry

  • Hi Cherry,

    The customer has tried to re-edit the system_cfg.h file, but it seems that this file is auto genergated by shell script, i.e. it would like turn back to original file after edited and saved it.  and then found a little difficult to find the shell script which generated this system_cfg.h file. could you kindly point out the shell script file or something else to auto edit the system_cfg.h file?

    Actually this file is auto-generated depending on the algorithms selected for the usecase configuration.. What is the MAKECONFIG and MAKEAPPNAME you are using? Depending on the ALG_LIST, it generates this config header file. Can you please check if ALG_dmaSwMs is included in the ALG_LIST?

    Regards,

    Brijesh