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.

ECPY on DVRRDK_03.00.00.00 not work

HI everyone:

i write some code with ecpy functions and it works on  DVRRDK_02.00.00.23

but the same code on DVRRDK_03.00.00.00 is not work, and i refer to SWOSD sample code

some code about ecpy was taken off that exist inDVRRDK_02.00.00.23 , i only find some SWOSD_TI_Fast_2D1D ...etc setup code in DVRRDK_03.00.00.00

but i have no ideal to use this kind of code,  why ecpy cant use in DVRRDK_03.00.00.00?? is there any problem with ecpy in DVRRDK_03.00.00.00?

thanks for reading~

  • What is the eror you are facing ? Can you share your code that uses ECPY so that we can try out on our setup . If you have SCD enabled pls try disabling SCD and trying out.

  • Hi  :

    my code follow:

    /****************************************START****************************************************/

    ECPY_activate(muxObj->ecpyHandle[MUX_DMA_HNDL_LINKED_DMA]);

    ECPY_Params params;

    params.transferType = ECPY_2D2D;
    params.srcAddr = pIn;
    params.dstAddr = pOut;
    params.numElements = height;
    params.numFrames = 1;
    params.srcElementIndex = 704*2;
    params.dstElementIndex = 704*2;
    params.srcFrameIndex = 0;
    params.dstFrameIndex = 0;
    params.elementSize = width;

    ECPY_directConfigure(muxObj->ecpyHandle[MUX_DMA_HNDL_LINKED_DMA], &params, MUX_DMA_HNDL_LINKED_DMA + 1);

    ECPY_directSetFinal(muxObj->ecpyHandle[MUX_DMA_HNDL_LINKED_DMA], 1);

    ECPY_directStartEdma(muxObj->ecpyHandle[MUX_DMA_HNDL_LINKED_DMA]);

    /*************************do other things*********************************/

     ECPY_directWait(muxObj->ecpyHandle[MUX_DMA_HNDL_LINKED_DMA]);

    ECPY_deactivate(muxObj->ecpyHandle[MUX_DMA_HNDL_LINKED_DMA]);

    /****************************************END******************************************************/

    upon is  my ecpy copy  copy procedure ,  i learned this from SWOSD sample in  DVRRDK_02.00.00.23 

    there are no error  show on screen, but no data can copy to my dst buffer, if i marked  function  ECPY_directWait

    i can see my data copy but it slow and sometime will crash.

    thx for yuor reply

  • i find out my problem, ECPY is work but without DSKT2_activateAlg & DSKT2_deactivateAlg functions 

  • sorry, my mistake . it is still not working

  • Can you check if utils_dma APIs are working ? You can use /dvr_rdk/mcfw/src_bios6/links_c6xdsp/alg_link/scd/scdLink_alg.c for reference usage.This provides similar APIs to ECPY.

  • hi Badri Narayanan:

    i will check utils_dma  later, there is a condition ,  if i marked ECPY_directWait  , my code  works and run  correct ,  it mean dma works without dmawait

    my question is why?  basicly i need dmawait because i can not sure if data transfer done or not...

    the for ur reply ^_^

  • Do you mean if you comment out  ECPY_directWait it works fine. As you have indicated commenting out directWait is wrong. If it is stuck in directWait it indicates the ECPY is waiting for xfer complete on a different channel compared to the acutal EDMA channel used. In RDK 3.0.1 the DSP internal memory is used .You mentioned something about Dskt2_algactivate .Can you explain more about the issue .I am asking as it could be related to DSP internal memory usage.

  • HiBadri Narayanan:

    yes , i mean comment out  ECPY_directWait, my function can run and not hang on  ECPY_directWait , but the same function can be worked on dvr_rdk 2.0.0, is there any different between them?

    and i mentioned something about Dskt2_algactivate , i used Dskt2_algactivate in my alg create and Dskt2_algdeactivate in myalg delete, is that correct?

    follow is my ecpy copy function :

    int MUX_ACARD_algMemcpy2D(MUX_ACARD_Obj *muxObj, UInt8 *dest, UInt8 *src, UInt16 width, UInt16 height, UInt16 lineOffsetSrc , UInt16 lineOffsetDest)
    {
    ECPY_Params params;

    if(muxObj->ecpyHandle[MUX_DMA_HNDL_LINKED_DMA]==NULL)
    return IUNIVERSAL_EFAIL;

    ECPY_activate(muxObj->ecpyHandle[MUX_DMA_HNDL_LINKED_DMA]);
    params.transferType = ECPY_2D2D;
    params.srcAddr = src;
    params.dstAddr = dest;
    params.elementSize = width;
    params.numElements = height;
    params.numFrames = 1;
    params.srcElementIndex = lineOffsetSrc;
    params.dstElementIndex = lineOffsetDest;
    params.srcFrameIndex = 0;
    params.dstFrameIndex = 0;
    ECPY_directConfigure(muxObj->ecpyHandle[MUX_DMA_HNDL_LINKED_DMA], &params, 1);

    /* submit as no linked transfers */
    ECPY_directSetFinal(muxObj->ecpyHandle[MUX_DMA_HNDL_LINKED_DMA], 1);

    ECPY_directStartEdma(muxObj->ecpyHandle[MUX_DMA_HNDL_LINKED_DMA]);
    ECPY_directWait(muxObj->ecpyHandle[MUX_DMA_HNDL_LINKED_DMA]);

    ECPY_deactivate(muxObj->ecpyHandle[MUX_DMA_HNDL_LINKED_DMA]);

    return IUNIVERSAL_EOK;
    }

  • Can you share your ECPY handle create code as well.

  • I learned this form rdk2.0 swosd code:

    /*
    * ======== MUX_ACARD_initResources ========
    */
    static IRES_Status MUX_ACARD_initResources(IALG_Handle h,
    IRES_ResourceDescriptor *desc, IRES_YieldFxn yieldFxn,
    IRES_YieldArgs yieldArgs)
    {
    #ifdef ADD_IRES_RESOURCE
    MUX_ACARD_Obj *alg = (MUX_ACARD_Obj *)h;
    #if 0
    /*
    * Resource manager has returned a resource handle. Save it in the
    * algorithm's instance object
    */
    alg->resHandle = (IRES_Handle)desc->handle;
    #else
    MUX_DMAObj *dmaHandle = (MUX_DMAObj *)&alg->dmaHandle;
    UInt8 i;

    ECPY_init();

    /*
    * * Resource manager has returned a resource handle. Save it in the
    * * algorithm's instance object
    * */
    for(i = 0; i < MUX_DMA_CH_MAX; i++)
    {
    IRES_EDMA3CHAN2_Handle edma3Handle = (IRES_EDMA3CHAN2_Handle) desc[i].handle;

    alg->edmaHandle[i] = edma3Handle;
    alg->ecpyHandle[i] = ECPY_createHandle(edma3Handle, h);

    dmaHandle->edma3ResourceHandles[i] = edma3Handle;

    /* Initialize
    * EDMA
    * resource
    * structures
    * for
    * H264VDEC_DMAOpen()
    * call
    * */
    dmaHandle->edma_params_array[i] = (UInt32 *) edma3Handle->assignedPaRamAddresses[0];
    dmaHandle->edma_tcc_array[i] = edma3Handle->assignedTccIndices[0];
    dmaHandle->edma_phy_to_lgl_map[i] = edma3Handle->assignedEdmaChannelIndex;
    }

    dmaHandle->num_edma_channels = MUX_DMA_CH_MAX;
    dmaHandle->channel_mask_low = 0;
    dmaHandle->channel_mask_high = 0;

    #endif
    #endif

    return (IRES_OK);
    }

  • Oh~~    I used Dskt2_algactivate in my alg create and Dskt2_algdeactivate in myalg delete, is that correct?

  • No  Dskt2_algactivate and Dskt2_algdeactivate should be used only before process call..If you activate and dont deactivate it will cause some other alg to block waiting for internal memory resouce to be free. Pls fix this issue but I dont think it is related to the ECPY_directWait issue you are facing.

  • hi :

    i will fix this issue first  ,  and try out.

    thank you.

  • HI : 

    i tried two ways:

    1.Dskt2_algactive & Dskt2_algdeactive before alg process and after

    2. no any Dskt2_algactive & Dskt2_algdeactive in my alg

    i learned from mcfw/src_bios6/alg/swosd/src/sw_osd_ti_alg_if.c

    not works  ~~ 

  • Hi 

    i think you are right , you said:

    [it is stuck in directWait it indicates the ECPY is waiting for xfer complete on a different channel compared to the acutal EDMA channel used. In RDK 3.0.1 the DSP internal memory is used .]

    if problem is wait for xfer and this issue is about DSP internal memory resource,  have you any directions for me to try out?

    thx for reply

  • I will try out your ECPY changes tomorrow and update you. Are you using ECPY in OSD link or is it your own algorithm ? Without looking at why it is hanging it is difficult to suggest anything. In the meantime can you try with utilsDMA

  • Hi Badri Narayanan:

    I think utilsDMA is working because if i enable SCD it works fine (SCD link used utilsDMA )

    but i can not use utilsDMA in my alg because my alg is packed to myalg.ae674, not write code in myalgLink_priv.c, so i can not reference utilsDMA to use...

    anyway, i disable SCD but ECPY wait still stuck in ...

    PS: I only use ECPY in my alg , OSD is original code , no modification

  • HI :

    i solved this problem, i can use DMA cpy with Dskt2_algactivate &  Dskt2_algdeactivate 

    i add them in my alg and SWOSD alg both  then it works 

    thx for every body, and Badri Narayanan