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 Problems

Other Parts Discussed in Thread: STRIKE

Hi,

I have a question regarding the following error output:

CMEMK Error: Failed to find a pool which fits 884736
CMEM Error: getPool: Failed to get a pool fitting a size 884736

How do I get around this error, I have tried to adjust the shell script

   insmod cmemk.ko pools=1x2097152,2x1529856,7x829440,1x524288,1x108680,1x81920,2x8192,6x4096 phys_start=0x87400000 phys_end=0x88000000

But nothnig is working, what do I have to do to adjust this, it seems like the pools of memory are not enough?

Does anyone know what to do? Thanks in advance

  • The number and size of pool cmem uses are defined via command line when cmem.ko is loaded.  See the loadmodules.sh (load cmemk.ko) for more details.  FYI, you can change loadmodules to suit the memory pools you need.  Just keep in mind that CMEM has a predefined memory space (I belive this is 116M to 128M for DM355 EVM) so do not allocate memory buffers outside of this range.  If you need to expand this range, then we are talking much more work....

    [edit] do you get any errors when performin insmod as above?  do you know what other parts of your system are using cmem?  you may have the right buffers, but if they are already being used up, then subsequent calls will fail

  • Juan Gonzales said:
    If you need to expand this range, then we are talking much more work....

    I don't quite follow the "much more work" comment.  Unless there are other components in the system that are affected by the memory map (e.g. video drivers that need large amounts of memory - on the order of 100 MB), you should be able to give CMEM more memory by simply:

    1. decreasing the memory provided to Linux (via the MEM= command line argument, typically in uboot)
    2. modifying the CMEM insmod command line args (i.e. phys_start) to make use of that extra memory

    Chris

  • Chris,

    Maybe I should not have used the word "much".  To be honest, I was not sure if you needed to rebuild CMEM.  If it is simply reducing Linux memory space that is great.

    If you need to go the other direction though (e.g. borrow memory from DSP side), I assume this means rebuilding DSP server (which would involve more steps...), correct.  [edit] strike this comment, DM355 has no DSP.

  • I am modifying the demo "decode" to build an app. I want to mux two video streams, from two different files. So, I am using the decode demo, and have created a second hLoader which will then create a buffer for reading the second file. 

    a) So I need to allocate space for the input buffer. Which buffer pool(s) should I bump up ? <the first pool is the biggest and I guess it is used for reading the input frame. Should I jumst bump this and leave everything else as is ? I did try and got a cannot create error (which I think is due to space).

    b) another question is if I am bumping up the cmem space in total, should I take the existing phys_start (say 0x80000000) and SUBTRACT whatever extra space(say 6MB) I am giving to CMEM ? How exactly does this math work (0x80000000 - 6MB(in hex) )? any advice would be appreciated.

    c) what is the max space I can give before I have to modify bootargs ? (I suppose I would take MEM=120 down to say 110 if I wanted to get 10MB more for CMEM)

    Thanks in advance,

    Jawa