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.

CMEMK Error: Failed to find a pool which fits

hi all, 

I want to send video from a PC to a DM365.

What do I need to do in order to increase the memory?

I'm using DM365,  DVSDK 4_02_00_06 with RidgeRun SDK.

I see the wiki about CMEM, and it explains clearly, but I don't know how to to that.

How do I do that in the make config(Memory reserved for DVSDK and Amount of reserved memory for cemek)?

  • Hi,

    Refer this liink http://processors.wiki.ti.com/index.php/CMEM_Overview#Linux_Configuration,

    ex:- insmod cmemk.ko pools=4x30000,2x500000 phys_start=0x0 phys_end=0x3000000
    This particular command creates 2 pools. The first pool is created with 4 buffers of size 30000 bytes and
    the second pool is created with 2 buffers of size 500000 bytes. The CMEM pool buffers start at 0x0 and end
    at 0x3000000 (max).

    So what you need to do is set the size what you need and number of buffers you want.

    Thanks,
    --Prabhakar Lad
  • Hi Prabhakar,

    How do I know how many pools and what size are needed for my pipeline?

    This is what I get when the kernel initializes

    Loading cmem from 0x85c00000 to 0x86000000
    CMEMK module: built on Oct 28 2014 at 16:49:52
    Reference Linux version 2.6.32
    File /opt/RidgeRun-SDK-DM36x-Turrialba-Eval/proprietary/dvsdk-4_02_00_06/dvsdk/linuxutils_2_26_01_02/packages/ti/sdo/linuxutils/cmem/src/module/cmemk.c
    allocated heap buffer 0xc9000000 of size 0x400000
    heap fallback enabled - will try heap if pool buffer is not available
    CMEM Range Overlaps Kernel Physical - allowing overlap
    CMEM phys_start (0x1000) overlaps kernel (0x80000000 -> 0x85300000)
    cmemk initialized

     

    And then when Im trying to run a pipeline PC->DM365 this is what I get:

     

    CMEMK Error: Failed to find a pool which fits 3760128
    /GstPipeline:pipeline0/GstRtpH264Depay:rtph264depay0.GstPad:sink: caps = application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, sprop-parameter-sets4
    /GstPipeline:pipeline0/dmaidec_h264:dmaidec_h2640.GstPad:sink: caps = video/x-h264
    CMEM Error: getPool: Failed to get a pool fitting a size 3760128

     

    I try to set that size (~0x400000) in the Amount of reserved memory for cemek. And when I try to run the same pipeline I get the same error, but needs more:

     

     

    CMEMK Error: Failed to find a pool which fits 8442768
    /GstPipeline:pipeline0/GstRtpH264Depay:rtph264depay0.GstPad:sink: caps = application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, sprop-parameter-sets4
    /GstPipeline:pipeline0/dmaidec_h264:dmaidec_h2640.GstPad:sink: caps = video/x-h264
    CMEM Error: getPool: Failed to get a pool fitting a size 8442768

    Is there a way to debug, and see how many pools and what size I need?

    Thanks in advance.

  • Hi,

    depends on your application which is requesting the memory from cmem

    Thanks,

    --Prabhakar Lad

  • The H.264 decoder memory pool sizes are described in the document h264_decoder_dm365_datasheet.pdf, see "Table 7. H264 Decoder DM365 Codec Usage of Memory Via CMEM"

    If you don't have the datasheet, you should be able to get it here.

  • Thanks for your response, 

    I set the pools as follow:

    POOLS=2x1408,2x17792,1x8192,1x18321120,1x282624,1x195880,1x175328,1x58144,1x384,1x10240,1x65792,1x30720
    modprobe cmemk phys_start=0x83400000 phys_end=0x88000000 pools=$POOLS
    modprobe edmak.ko
    modprobe irqk
    modprobe dm365mmap.ko

     

    But now i get this error:

     

    WARNING: from element /GstPipeline:pipeline0/dmaidec_h264:dmaidec_h2640: Could not decode stream.
    Additional debug info:
    ../../src/src/gsttividdec2.c(245): gstti_viddec2_process (): /GstPipeline:pipeline0/dmaidec_h264:dmaidec_h2640:
    Unable to decode frame with timestamp 0:00:00.000000000
    WARNING: from element /GstPipeline:pipeline0/dmaidec_h264:dmaidec_h2640: Could not decode stream.
    Additional debug info:
    ../../src/src/gsttividdec2.c(245): gstti_viddec2_process (): /GstPipeline:pipeline0/dmaidec_h264:dmaidec_h2640:
    Unable to decode frame with timestamp 0:00:00.248409997
    WARNING: from element /GstPipeline:pipeline0/dmaidec_h264:dmaidec_h2640: Could not decode stream.
    Additional debug info:
    ../../src/src/gsttividdec2.c(245): gstti_viddec2_process (): /GstPipeline:pipeline0/dmaidec_h264:dmaidec_h2640:
    Unable to decode frame with timestamp 0:00:00.586319331


    I'm using the following pipeline to receive video from a PC

    gst-launch -v udpsrc port=5000 ! 'application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, sprop-parameter-sets=(string)"Z0KAHtoCgPRA\,aM48gA\=\=", payload=(int)96, ssrc=(uint)836986607, clock-base=(uint)3991456733, seqnum-base=(uint)31144' ! rtph264depay ! dmaidec_h264 numOutputBufs=8 dispdelay=0 closedloop=1 !  queue !  TIDmaiVideoSink videoOutput=composite videoStd=D1_NTSC sync=false enable-last-buffer=false

     


    Any thoughts about it?

    Thanks in advance.

  • The error doesn't tell us much about what actually went wrong, but it could be that it started decoding P-frames without having the referenced IDR-frame, which commonly happens when you start decoding a stream already in progress.  It should be safe to ignore at the start, since the video should start decoding normally at the next IDR frame.