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.

integration of fastcopy example form framework_component to OMX DSP component

Other Parts Discussed in Thread: SYSBIOS

Hi TI experts,

I have integrated fastcopy example form framework_component to OMX DSP component, compilation was finished successfully, but the example is waiting endlessly to EDMA transfer to end any idea what might be the problem?

Gabi

  • Hi Gabi,

    I did exactly the same thing, and also my application hangs when I start the memory copy. Did you get any feedback on this issue? What did you use to implement the DMA for the DSP?

    Thanks,

    Danillo

  • Hi Danillo,

    I have used edma_lld library, it took a lot of effort to add this package to my project, add it to makefiles for compilation linkage etc.., i also had to write my EDMA driver, based on the edma_lld, for that i had used the example DAT_copy in edma_lld examples. Needless to say that i didn't get any help/support from TI regarding this issue.

    Good luck,
    Gabi

  • Hi Gabi,

    thank you so much for your valuable advice. I was finally able to incorporate the DMA into my OMX component.

    For anyone who might be looking for a similar development, here is what I did.

    I added the source files of the CLS_DAT_DEMO (can be found in ezsdk/component-sources/edma3lld_xx_xx_xx_xx/examples) to my project. Then in order to compile the files, I had to add them to my OMX component makefile

    SRCDIR = src src/dat_edma3LLD src/bios6_adapter
    INCDIR = . src src/dat_edma3LLD src/csl2_legacy_include

    INCLUDE_EXERNAL_INTERFACES = bios xdc omx omxcore omxbase timmosal fc xdais \
                                 ce true3ddec edma3_lld

    I had to create the variable edma3_lld, to add the libraries for my OMX component. In order to do that, I modified the file omx_xx_xx_xx_xx/makerules/env.mk: (I added the following lines, in bold)

    # EDMA3LLD
    edma3_lld_PATH = $(EXTERNAL_SW_ROOT)/edma3lld_02_11_05_02
    edma3_lld_INCLUDE = $(edma3_lld_PATH)/packages

    XDCPATH = $(bios_PATH)/packages;$(edma3_lld_PATH)/packages;$(fc_PATH)/packages;$(ipc_PATH)/packages;$(syslink_PATH)/packages;$(xdc_PATH)/packages;$(ce_PATH)/packages;$(omx_PATH);$(omx_PATH)/ti/omx/interfaces/openMaxv11;$(h264enc_PATH)/packages;$(h264dec_PATH)/packages;$(mpeg2dec_PATH)/packages;$(mp3dec_PATH)/packages;$(aaclcdec_PATH)/packages;$(mpeg2enc_PATH)/packages;$(omx_PATH)/ti/omx/comp/omxbase;$(omx_PATH)/ti/omx/omxcore;$(hdvicp20api_PATH)/packages;$(osal_PATH)/packages;$(xdais_PATH)/packages;$(linuxutils_PATH)/packages;$(uia_PATH)/packages;$(mpeg4enc_PATH)/packages;$(mpeg4dec_PATH)/packages;$(vc1dec_PATH)/packages;$(mjpegdec_PATH)/packages;$(aaclcenc_PATH)/packages;$(true3ddec_PATH)/packages;
    export XDCPATH

    To use the EDMA on my OMX component, I added the following code to the OMX component initialization function

    #include <csl_dat.h>
    #include <csl2_dat_edma3lld.h>
    extern EDMA3_DRV_Handle hEdma;
    extern EDMA3_DRV_Handle DAT_EDMA3LLD_hEdma;

        //INITIALIZING THE DMA
        if (!DAT_EDMA3LLD_init(NULL))
        {
            Log_print0(Diags_USER1,"Error initializing EDMA3 low level driver");
            eError = OMX_ErrorInsufficientResources;
            goto EXIT;
        }
        else
        {
            Log_print1(Diags_USER1,"DAT_EDMA3LLD_init Successful (0x%x)",hEdma);
            DAT_EDMA3LLD_hEdma = hEdma;
        }
        if (0 != DAT_open(0,0,0))
        {
            Log_print0(Diags_USER1,"DAT_open Successful");
        }
        else
        {
            Log_print0(Diags_USER1,"ERROR in DAT_open");
            eError = OMX_ErrorInsufficientResources;
            goto EXIT;
        }

    Then, all memcpy functions can be substituted by DAT_copy()

    To compile the executable for the DSP, I had to modify two files, the makefile (where I also included the edma3_lld external interface as described above) and also the DspAppMain.cfg file. I added the following configuration:

    /* USE EDMA3 Sample App */
    var EDMA3 = xdc.loadPackage('ti.sdo.edma3.drv.sample');
    var ECM   = xdc.useModule ("ti.sysbios.family.c64p.EventCombiner");
    ECM.eventGroupHwiNum[0] = 7;
    ECM.eventGroupHwiNum[1] = 8;
    ECM.eventGroupHwiNum[2] = 9;
    ECM.eventGroupHwiNum[3] = 10;

    There might be some other details that I am forgetting right now, but I think that is basically it. Hope this helps someone in the future.

    Again, thanks for your help!

    Best regards,

    Danillo

  • Hi Gabi,

    I added DMA transfer to the VLPB example based on this post. I got it working, but the copy does not appear to be any faster than a regular mempcy. I'm trying to copy a 800x600 buffer and would like to get a 60 fps, but I appear to be very far from that now. Have you been able to get faster copies to/from the DSP?

    Bernard

  • Hi Bernard,

    If you were using EDMA correctly you would have seen big improvement in performances compare to memcpy. 

    Gabi

  • Hi Gabi,

    I am now seeing much faster DMA transfers, but I still have an issue.

    If I initiate a DAT_copy from an OMX buffer (which is in the IPC_SR_FRAME_BUFFERS region) to another OMX buffer from the DSP, all works great and fast. 

    If I initiate a DAT_copy from an OMX buffer to a DSP allocated buffer (using TIMM_OSAL_MalloxExtern), and then from that buffer back to a second OMX buffer, my data makes it to the second OMX buffer, but I can't see the data in the intermediate buffer (the DSP buffer). It's as if the DMA and DSP were disagreeing on the location of the DSP allocated buffer. Based on the address of that buffer it is in DSP_DATA (0x99500000-0x9A100000).

    In your dealings with DMA and DSP, have you copied data to the DSP_DATA region using DMA? If not, where have you copied it?

    Bernard

  • Hi Bernard,

    Bernard Vachon said:
    If I initiate a DAT_copy from an OMX buffer to a DSP allocated buffer (using TIMM_OSAL_MalloxExtern), and then from that buffer back to a second OMX buffer, my data makes it to the second OMX buffer, but I can't see the data in the intermediate buffer (the DSP buffer).

    From the scenario you are describing it is obvious that the data is moving via the buffer in the DSP_DATA segment. You just don't "see" it for some reason. Can you please explain what do you do in order to "see" the data in the DSP buffer?

    Gabi