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.

Loading CMEMK question...



Is there any way to decypher this line?  And I don't mean the modprobe part.

modprobe cmemk phys_start=0x85000000 phys_end=0x88000000 pools=2x384,1x16384,1x2688,1x20480,3x74,1x60288,2x28,1x147048,1x10240,1x896,1x65536,1x663552,1x9175376,4x24,1x282624,2x5984,1x58144,1x1024,1x48952,1x464,2x16768,1x1251264,1x30720,1x65792,8x774144,1x173712,1x146,1x98,2x296,50x56,2x86,1x624,1x3328,2x518912,4x62,1x242,4x663552,1x1637824

How do all of these numbers get decided?  If I want to encode and/or decode multiple simultaneous streams don't I need to know what sort of buffers to allocate?  Maybe we could get a discussion going to document what each buffer pool is used for.

John A

  • Hi John,

    the main buffers used here are memTab buffers required , input , output buffers, and capture buffer.

    you can find out the buffer details in your codec specific document.

    basically memtab buffer sizes are decided based upon the codec requirement and for what pupose the buffer has been created.

    if you are and codec developer you need to know how to allocate and its size etc.

    otherwise you just need to to know how much CMEM size you are allocating and all these buffer sizes must fit in to your CMEM.

     

  • John,

    This wiki page has more information: http://processors.wiki.ti.com/index.php/CMEM_Overview.

    Regards, Niclas

  • Unfortunately that link doesn't help answer the question posed.  That's why I made this thread. 

    Sujit's answer is really more right on the money.  The data sheet for the codec lists the "memtab buffer sizes" used to create the parameters.  Funny thing about Sujit's post is that my email notification claims the source of his post was "Jeff Hayes".

    The CMEM Overview should direct the reader to the codec data sheet.

    John A

  • John,

    The codec data sheet and memTab does help explain the pools used by CMEM, but it's not a comprehensive answer. CMEM allocates all contiguous memory in a system, not just for codecs. Some applications use contiguous memory for other purposes, such as DMA access which also requires physically contiguous buffers. The best way to analyse the CMEM requirements of an application is to execute:

    CE_DEBUG=2 ./myapp | grep Memory_contigAlloc

    This will show all calls to CMEM allocation from your application, it may or may not be more than for the codec.

    Regards, Niclas

  • Do you mean the application or the higher level APIs?  I get a lot of info printed out using your method, but I'm not using CMEM_Alloc in my application.  Nor are the applications in the DVSDK using it.  I did find it used in the drivers located in the Linux kernel and many of the lower level test applications.  But nothing at the application level or the DMAI level.

    John A

  • John,

    DMAI is cross platform and uses the Memory OSAL API from Codec Engine to allocate contiguous memory. The Memory OSAL API on Linux uses CMEM_Alloc() to allocate contiguous memory. E.g. when you call BufTab_create() in DMAI it will eventually call CMEM_Alloc() a bunch of times to get you a table of contiguous buffers to use with the codec and/or display etc.

    Regards, Niclas