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.

CMEM usage

Hi all:

      Then encode demo  under "dvsdk_2_10_01_18\dvsdk_demos_2_10_00_17\dm365\encode\" only support encode one streaming at one time, I had update it to encode MPEG4/H264 or MPEG4+JPEG or MPEG4+JPEG at the same time, and i found that I need to update the "loadmodules_hd.sh"  file under different case, else we will meet CMEM error, i'm not exactly know how to allocate the pool size for each codec, Anyone who can help explain why the encode demo need these pools parameters in "loadmodules_hd.sh" ?

        insmod cmemk.ko phys_start=0x85000000 phys_end=0x88000000 pools=6x4096,2x8192,1x11908,2x13184,1x2697152,6x4096,1x30720,3x81920,1x3185664,64x56,1x320,1x640,1x81920,1x6650880,2x608,1x296,1x28,2x24,23x1548288,1x154288 allowOverlap=1 phys_start_1=0x00001000 phys_end_1=0x00008000 pools_1=1x28672

     Is there any other solution that we needn't config the CMEM modules under different settings? I had check the APPRO IPNC solution, in "av_capture_load.sh", we can't find any parameters with the pools size.

             insmod cmemk.ko phys_start=0x83800000 phys_end=0x88000000 allowOverlap=1 phys_start_1=0x00001000 phys_end_1=0x00008000 pools_1=1x28672

  • Hi Tracy,

    The pools in loadmodules_hd.sh actually correspond to the number and size of memory chunks that are needed by codecs and application. If you refer to your current loadmodules_hd.sh that came with DVSDK 2.10.01.18, you can map most of the memory chunks to the MEMTABs that MPEG4, H.264 or JPEG encoder ask for. The details of MEMTAB requests are present in the datasheet for the codecs. The application memory allocations need to be traced from the source code.

    Generally, to support a combination of codecs, you would have to add the memory pools corresponding the the new encoder MEMTABs. One simple rule of thumb is that you can double the number of pools for the codec MEMTABs.

    Tracy lee said:

         Is there any other solution that we needn't config the CMEM modules under different settings? I had check the APPRO IPNC solution, in "av_capture_load.sh", we can't find any parameters with the pools size.

                 insmod cmemk.ko phys_start=0x83800000 phys_end=0x88000000 allowOverlap=1 phys_start_1=0x00001000 phys_end_1=0x00008000 pools_1=1x28672

    Coming to your above quote of APPRO IPNC, there we use CMEM as heap instead of pools. So we need not allocate any pools av_capture_load.sh. This way during the development cycle, you need not worry about any combination of codecs or application and can just go on allocating CMEM memory. For using heap, please refer to documentation on CMEM and in the codec engine .cfg file, you need to add "algSettings.useHeap = TRUE" where algSettings is the path for your Algorithms settings component. You can refer to OSA_cmem.c file in IPNC code for using CMEM allocation as heap.

    Regards,

    Anshuman

  • What  is the maximum size we can allocate for the cmem module?

    Thanks,

    Bhargav

  • Bhargav,

    Its an open question. The size allocated to CMEM module depends on the total available memory. Out of the total memory, you need to reserve something for the OS and rest you can use for CMEM. Do you face any troubles with the CMEM allocations?

     

    Regards,

    Anshuman

    PS: Please mark the post as verified, if it answered your question. Thanks.

  • Nope, I was just curious to know that!

    Also do you know why we use 'allowOverlap=1' to overlap with kernel memory?

    Thanks for your reply,

    Bhargav

  • Bhargav,

    Please refer to the FAQ on codec engine at http://processors.wiki.ti.com/index.php/Codec_Engine_FAQ

    This has details about "allowOverlap" option and many other features of CMEM module.

    Regards,

    Anshuman

    PS: Please mark this post as verified, if you think it has answered your question. Thanks.