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.

Error in continuous memory allocation

Other Parts Discussed in Thread: TMS320DM6467

Hi,

I am using TMS320DM6467 plat form

DVSDK : 1.40

I am using Videnc_copy to build my application.

am using threads in my program to sync my application.

while building my application getting error like this.

CMEMK Error: get_phys: Unable to find phys addr for 0x00000000

CMEMK Error: get_phys: get_user_pages() failed: -14

CMEMK Error: GETPHYS: Failed to convert virtual to 0x0 to physical.

CMEMK Error: getPhys: Failed to get physical  address of 0

CEapp-> VIDENC_process () failed, status = 0xfffffffe,

am attaching log file 4861.LOG.txt

Is there any fast way to read data(approx 500KB)  from a file in single read transaction.

Help me in this.

Thanks in advance.

  • Looks like some memory allocation is not correct in your application. This problem happens when there is a virtual memory address with value NULL being sent to cmem for physical address conversion. Please check the memory allocation part of your code.

    regards

    Yashwant

  • Thanks Yashwant,

    Is there any way increase the speed of file read operation.?

    My packet size in each read operation is 691200( nearly 670 KB).

     is taking 80ms to 100ms to read each packet.

    Thanks in advance.

  • Your log shows you allocating 3 input buffers of size 542720, here is the first of those:

    CEapp-> Allocating contiguous buffer for 'input data' of size 542720...

    @1,007,296us: [+0 T:0x400176d8 S:0xbefffbe4] OM - Memory_contigAlloc> Enter(size=542720, align=-1, cached=FALSE, heap=FALSE)

    @1,007,600us: [+4 T:0x400176d8 S:0xbefffbe4] OM - Memory_contigAlloc> CMEM_alloc(542720) = 0x411c5000.

    @1,007,793us: [+4 T:0x400176d8 S:0xbefffbe4] OM - Memory_contigAlloc> CMEM_getPhys(0x411c5000) = 0x87f7b000.

    @1,007,943us: [+1 T:0x400176d8 S:0xbefffb8c] OM - Memory__addContigBuf> Enter(virtAddr=0x411c5000, size=542720, physAddr=0x87f7b000)

    @1,008,092us: [+1 T:0x400176d8 S:0xbefffb8c] OM - Memory__addContigBuf> creating new contigBuf object

    @1,008,223us: [+0 T:0x400176d8 S:0xbefffb74] OM - Memory_alloc> Enter(0x10)

    @1,008,368us: [+0 T:0x400176d8 S:0xbefffb74] OM - Memory_alloc> return (0x4cb28)

    @1,008,504us: [+1 T:0x400176d8 S:0xbefffb8c] OM - Memory__addContigBuf> returning: cb->phys=0x87f7b000, cb->size=542720, cb->virt=0x411c5000

    @1,008,647us: [+0 T:0x400176d8 S:0xbefffbe4] OM - Memory_contigAlloc> return (0x411c5000)

    Then the log shows the failure when VIDENC_process() tries to get the physical addr of virtual addr 0x0:

    @1,241,205us: [+0 T:0x423d8b60 S:0x423d82b4] OM - Memory_getBufferPhysicalAddress> Enter(virtAddr=0x0, size=271360)

    @1,241,340us: [+1 T:0x423d8b60 S:0x423d82b4] OM - Memory__getPhysicalAddress> Enter(virtAddr=0x0, size=271360)

    @1,241,474us: [+1 T:0x423d8b60 S:0x423d82b4] OM - Memory__getPhysicalAddress> returning physAddr=0x0

    @1,258,632us: [+1 T:0x423d8b60 S:0x423d82b4] OM - Memory_getBufferPhysicalAddress> CMEM_getPhys(0x0) = 0x0.

    @1,258,933us: [+0 T:0x423d8b60 S:0x423d82b4] OM - Memory_getBufferPhysicalAddress> return (0x0)

    The size of that is half of the allocated sizes (271360).  This failure is for the 2nd buffer in the inBufs->descs[] array.  Please check the inBufs->descs[1].buf and inBufs->descs[1].bufSize that you pass to VIDENC_process().  I would expect inBufs->descs[1].buf to have a value of 0x4124a000, since that is the address of the 2nd 'input_data' allocation w/ Memory_contigAlloc().

    Regards,

    - Rob

  • Thanks foryour reply Robert Tivy,

    My issue got resolved which is  related to memory allocation.

    It is due to multiple definition of same pointer.

    I have an issue working with parallel processing.

    Whether DM6467 supports parallel processing.

    Since it has both ARM + DSP. How I can bring up  multi processing in this case.?

    using threads ..?

  • Praveen Kanamarlapudi said:

    I have an issue working with parallel processing.

    Whether DM6467 supports parallel processing.

    Since it has both ARM + DSP. How I can bring up  multi processing in this case.?

    using threads ..?

    I'm not sure I understand your question.

    Your initial post said you were using the videnc_copy application.  This application does perform parallel processing.  The ARM application loads a DSP server (executable) and communicates with it through Codec Engine.  In the log that you attached in your initial post you can see statements preceded with "[DSP]", which are log statements fetched from the DSP program.

    Does this answer your question?

    Regards,

    - Rob

     

  • You are correct Robert.

    In my case, I am using two threads in ARM side. One for ARM processing and other for DSP processing.

    Is it possible achieve concurrent processing like when my algorithm processing in DSP side whether ARM can perform any other processing(like Reading large data from a  file) on ARM Side.?

  • Praveen Kanamarlapudi said:

    In my case, I am using two threads in ARM side. One for ARM processing and other for DSP processing.

    So, I assume then that your DSP processing thread has a Codec Engine call to VIDENC_process().  This thread will block until the the process call returns (which will happen after the DSP is done with its side of the VIDENC_process() call).

    Praveen Kanamarlapudi said:

    Is it possible achieve concurrent processing like when my algorithm processing in DSP side whether ARM can perform any other processing(like Reading large data from a  file) on ARM Side.?

    Your ARM thread can certainly read a file or do other processing unrelated to the DSP thread.  It will run during the times that the DSP thread is blocked waiting for the DSP to return.

    Regards,

    - Rob

     

  • Thanks Rob.

    It's working.