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.

Dm368 DMA copy using dm365mm module

Hi,

I have a  DM368 custom board on which we are using dvsdk 2_10_01_18.We have a streaming applications which captures YUV data from VPFE and does the encoding and outputs the data.Now we had a scenario where we had to perform a memcpy of 115200 bytes in one case and 259200 bytes in another case.This took almost 3.2 ms to get executed which affected our application a lot since it was real time hence we went for DMA copy hoping that it would solve our problem.We used the dm365mm module which came along with the DVSDK in order to perform the DMA copy.Now when we profile this DM365MM_memcpy by putting a gettimeofday across this function we found that the time taken to perform this DMA copy varies drastically. ie sometimes it as less as .6ms and sometimes it is as huge 4.2 ms .What we were suspecting was that since MJCP/HDVICP also used DMA probably the DMA channels were not free hence we were seeing such a drastic variation.Is there a way that i can improve this DMA copy by assigning some kind of priority or  is this the observed behavior.Also i have read that if by using channel 0 there will be a higher priority and by using channel 64 there will be a low priority.I found out that DM365MM_memcpy always gets channel 60 sue to which the its priority is always very less.Is there a way that i can request for a particular channel say channel 10 due to which there will be a higher priority for this DMA operation compared to the other DMA operations.

Regards

Haran

  • Hi Haran,

    DM36x has 64 logical channels and 4 physical(called TCs). So getting channel number 10 instead of 60 will not help. TC0,TC1,TC2 will be used by codec, for application its advised to use TC3(this info is present in Data sheet). If you use TC3 there wont be any DMA confliction, but there might be confliction on Source and/or  Destination. What source and destination you are using?

    Thanks,

    Veeranna

  • Hi Veeranna,

    Thanks for the reply.The source is a malloced region which is a virtual address and the destination is a Cmem_alloced region.And i have one more doubt.I am currently using the module Dm365mm to copy the data using DMA.How can i send a request to the DMA telling that i want to use TC3.Because changing even a single option in the DM365mm module results to failure in the dma copy due to which my application cribs.

    Regards

    Haran

  • Hi Veeranna,

    I tried to use TC3 as you suggested but still there is no improvement.The Dma copy time always varies at each and every iteration.Is it that the dma copy cannot happen in parallel on all the four TC channels so that a dma copy in one of the TC channel will affect the dma copy in another TC channel.

    Thank you for your links.The links actually say that using EDMA for the encoding process reduces the performance of the encoder.Is it true this way and is there a way that i can increase the performance of my encoder.

    Regards

    Haran

  • Hi Haran,

    DMA copies can happen in parallel when source and destination of all transfers are independent. In your case src and dst is DDR and codec extensively uses DDR for its operation. DDR bandwidth will be bottleneck but not the DMA.

    If you uses DMA with DDR as src or dst encoder performance will get affect. And did you take system level optimization tips from above link and can you use HIGH_SPEED encoder mode to achieve better speed. 

    I have one doubt, you said that src is malloced buffer and dst is in CMEM, are you seeing correct data in CMEM after transfer?, beacuse malloced buffer may not be contiguous and DMA is not aware of this(I am not expertise in linux just got a doubt :) ).

    Thanks,

    Veeranna

  • Hi Veeranna,

    I am actually getting a correct data on my Cmem alloced buffers.

    Actually we are using high speed mode only in our configuration files.

    One more doubt is there a way that i can use any other memory other than DDR?Or this is the expected result always.

    Regards

    Haran