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 ERROR:getPool:Failed to get a pool fitting a size ....



Hi,everyone:

The platform  I am using is DM355 .And after installing ,the dvsdk is dvsdk_1_30_00_23.
Now I have some  troubles  and need  your help very much .

I wrote an application which consists of  the capture thread,display thread, control thread, video thread and the speech thread .    In the video thread ,for some reason , I need to allocate  7 contiguous    buffers ,and  every buffer's size is  829440 .
 
Other threads are the same as the demo's .

But , when I run my application, it  shows:
...
CMEM Error: getPool: Failed to get a pool fitting a size 829440
Encode Error: Failed to allocate contiguous memory block.
...


Why ?

My  loadmodules.sh is as this:

#!/bin/sh
#insmod cmemk.ko phys_start=0x87400000 phys_end=0x88000000 pools=1x2097152,1x1658880,1x1600000,6x829440,2x61440,1x10240,8x4096

# 10MB
#insmod cmemk.ko phys_start=0x87500000 phys_end=0x88000000 pools=1x2097152,2x1529856,1x524288,6x829440,1x108680,1x81920,2x8192
,6x4096
# 8.286208e+6
...


In the loadmodules.sh , there is a 6x829440 , is the problem here?  But when I modify it to 8x829440 ,and run the loadmodules.sh,
it shows:
insmod: error inserting 'cmemk.ko': -1 Cannot allocate memory

Can you tell me what's the meaning of loadmodules.sh, such as the phys_start ,and the pools ,and  how should I modify it to satisfy    my needs?

Thans a lot!!!

  • 长江货郎 said:

    # 10MB
    #insmod cmemk.ko phys_start=0x87500000 phys_end=0x88000000 pools=1x2097152,2x1529856,1x524288,6x829440,1x108680,1x81920,2x8192
    ,6x4096
    # 8.286208e+6
    ...


    In the loadmodules.sh , there is a 6x829440 , is the problem here?  But when I modify it to 8x829440 ,and run the loadmodules.sh,
    it shows:
    insmod: error inserting 'cmemk.ko': -1 Cannot allocate memory

    Can you tell me what's the meaning of loadmodules.sh, such as the phys_start ,and the pools ,and  how should I modify it to satisfy    my needs?

    Thans a lot!!!

    Your math is wrong. 

    0x88000000 - 0x87500000 = 0x00B00000 = 11MB

    Adding up all your pools as shown also comes to  11 MB (11534336 bytes).  If you increase the size or number of pools you will need more space in the memory map (i.e. phys_end will need to be larger).

    Brad