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.

DM368-IPNC cmem pool adjustment

 

 

Hi,

 

I am running ./av_server.out but i am getting errors like this:

# ./av_server.out D1

AVSERVER UI: Initializing.
 
 CLK Hz,
 ARM   Hz =  432000000
 DDR   Hz =  340000000
 VPSS  Hz =  340000000
 IMCOP Hz =  340000000
 
 DRV LDC: GetConfig 0003 0x0
 [OSA_FILE ] Reading file [/mnt/nand/IMG_Paramset.bin] ... ERROR
IMAGE TUNE: Paramset File is not available..... Setting DEFAULT parameter
CMEMK Error: Failed to find a pool which fits 28672
CMEMK Error: get_phys: Unable to find phys addr for 0x00000000
CMEM Error: getPCMEMK Error: get_phys: get_user_pages() failed: -14
ool: Failed to gCMEMK Error: GETPHYS: Failed to convert virtual 0x0 to physical.
et a pool fittinCMEMK Error: get_phys: Unable to find phys addr for 0x00000000
g a size 28672
CMEMK Error: get_phys: get_user_pages() failed: -14
CMEM Error: getPCMEMK Error: FREE: Failed to convert virtual 0x0 to physical
hys: Failed to get physical address of 0
CMEM Error: free: failed to free 0
 ERROR  (alg.c|ALG_sysInit|82): VICP Protocol regn failed
 ERROR  (avServerApi.c|AVSERVER_init|578): ALG_sysInit()
 ERROR  (avServerUi.c|UI_start|54): AVSERVER_init()

My output of cat /proc/cmem is as follows:

 

Block 0: Pool 0: 7 bufs size 4669440 (4667200 requested)

Pool 0 busy bufs:

Pool 0 free bufs:
id 0: phys addr 0x87b8c000
id 1: phys addr 0x87718000
id 2: phys addr 0x872a4000
id 3: phys addr 0x86e30000
id 4: phys addr 0x869bc000
id 5: phys addr 0x86548000
id 6: phys addr 0x860d4000

Block 0: Pool 1: 1 bufs size 4669440 (4667200 requested)

Pool 1 busy bufs:

Pool 1 free bufs:
id 0: phys addr 0x85c60000

how should i adjust pools so that i shouldn't get above errors,also how could i determine the start and end location of phsical address

for my DM368-IPNC system.How can i generalize it so that i can run demo applications without facing cmem issues in future.

Basically i am trying to adjust cmem pools using hit and trial but not getting success.

Thanks and Regards,

Mayank

 

 

  • MAYANK AGARWAL said:
    CMEMK Error: Failed to find a pool which fits 28672

    My output of cat /proc/cmem is as follows:

     

    Block 0: Pool 0: 7 bufs size 4669440 (4667200 requested)

    Pool 0 busy bufs:

    Pool 0 free bufs:
    id 0: phys addr 0x87b8c000
    id 1: phys addr 0x87718000
    id 2: phys addr 0x872a4000
    id 3: phys addr 0x86e30000
    id 4: phys addr 0x869bc000
    id 5: phys addr 0x86548000
    id 6: phys addr 0x860d4000

    Block 0: Pool 1: 1 bufs size 4669440 (4667200 requested)

    Pool 1 busy bufs:

    Pool 1 free bufs:
    id 0: phys addr 0x85c60000


    If you ran "% cat /proc/cmem" after your application fails in this way then you're not going to see any "busy" buffers since CMEM auto-frees buffers when the process that allocated them exits without freeing them explicitly.  If you want to get a snapshot of the pools at the time of the failure then you would need to somehow prevent the failing application from exiting.  Atfer the failure you would use another terminal to run "% cat /proc/cmem" and should see all your buffers as busy.

    MAYANK AGARWAL said:
    how should i adjust pools so that i shouldn't get above errors,

    It all depends on your application's needs.  CMEM contains "heap" support also, along with the ability to defer pool requests to the heap if there is no pool with sufficient buffers available.  Please read this wiki page for further information: http://processors.wiki.ti.com/index.php/CMEM_Overview about CMEM heaps.  In order to defer pool requests to the heap, you would set "useHeapIfPoolUnavailable=1" on your cmemk.ko 'insmod' or 'modprobe'.  There is cdoc support in the Linux Utils product mentioning this parameter.  With that parameter, you could configure CMEM with no pools and "useHeapIfPoolUnavailable=1" to cause all pool allocations to go to the heap.  You now need a way to view these allocations.  /proc/cmem will show only pool information, not heap information, so that doesn't help.  You can set the Codec Engine environment variable CE_DEBUG=2 to print out tracing information about CE, including the CMEM memory requests, and configure your pools accordingly.  Or, CMEM has debug tracing support, so if you build your application using the "debug" profile, CMEM trace information should become available, which is a more concise dump of your CMEM allocations (without all the other CE tracing).

    MAYANK AGARWAL said:

    also how could i determine the start and end location of phsical address for my DM368-IPNC system.How can i generalize it so that i can run demo applications without facing cmem issues in future.

    Using the CMEM heap, as suggested above, will generalize your CMEM configuration, at the cost of possible fragmentation that doesn't happen when you use just pools.  It is possible to have the CMEM memory block contain just a heap and no "pools".  To do so you will need to modify the 'insmod' or 'modprobe' of the cmemk.ko device driver.  This is typically located in a file named loadmodules.sh, or something similar that is typically executing during Linux startup.  This file is also your answer to finding out the start and end location of the physical address for the CMEM block (or blocks).

    Regards,

    - Rob

     

  • Hi Robert,

     

    Thanks for your mail.I tried the following but i am getting errors as given below:

     

    insmod cmemk.ko phys_start=0x84c00000 phys_end=0x88000000 pools=8x4667200 useHeapIfPoolUnavailable=1
    cmemk: Unknown parameter `useHeapIfPoolUnavailable'
    insmod: cannot insert `cmemk.ko': Unknown symbol in module (-1): No such file or directory

    where to define useHeapIfPoolUnavailable,i cannot find it.

     

     

    Thanks and Regards,

    Mayank

     

     

     


     

     

  • What version of Linux Utils are you using?  For that useHeapIfPoolUnavailable feature, you need to use something "new" like Linux Utils 2.26.* (released in Nov 2010).

    Here are the Linux Utils downloads - note that for DM365, you should stay with the 2.x versions (not the 3.x versions).

    http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/linuxutils/index.html

    Chris