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 with TIViddec2 element

hi!

I am trying to send video encoded with mpeg4 encoder using udp and rtp

this is the pipeline in the sender side : gst-launch -v videotestsrc ! TIVidenc1 codecName=mpeg4enc engineName=encode  ! rtpmp4vpay pt=96 ! udpsink host=127.0.0.1 port=5000

in the receiver side the pipeline is : gst-launch -v udpsrc port=5000 caps="application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)MP4V-ES, profile-level-id=(string)1, config=(string)000001010000012000845d4c285020f0a21f, payload=(int)96, ssrc=(guint)3234477890, clock-base=(guint)926512074, seqnum-base=(guint)59095" ! rtpmp4vdepay ! TIViddec2 codecName=mpeg4dec engineName=decode  ! TIDmaiVideoSink videoStd=D1_PAL videoOutput=composite

and this is the error message :

Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
/GstPipeline:pipeline0/GstRtpMP4VDepay:rtpmp4vdepay0.GstPad:src: caps = video/mpeg, mpegversion=(int)4, systemstream=(boolean)false, codec_data=(buffer)000001010000012000845d4c285020f0a21f
/GstPipeline:pipeline0/GstRtpMP4VDepay:rtpmp4vdepay0.GstPad:sink: caps = application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)MP4V-ES, profile-level-id=(string)1, config=(string)000001010000012000845d4c285020f0a21f, payload=(int)96, ssrc=(guint)3234477890, clock-base=(guint)926512074, seqnum-base=(guint)59095
/GstPipeline:pipeline0/GstTIViddec2:tividdec20.GstPad:sink: caps = video/mpeg, mpegversion=(int)4, systemstream=(boolean)false, codec_data=(buffer)000001010000012000845d4c285020f0a21f
CMEM Error: getPool: Failed to get a pool fitting a size 829440
Failed to allocate memory.
gst-launch-0.10: BufTab.c:440: BufTab_getNumBufs: Assertion `hBufTab' failed.
Aborted

 

when opened the loadmodules.sh script i found that there is 7 pools of 829440

i didn't found how ti solve this problem

any help will bel welcome !!

regards

  • Hi,

    It seems like your CMEM configuration doesn't have enough memory pools configured. To see how many your application is trying to use you can use:

    CE_DEBUG=2 ./yourcommand | grep Memory_contigAlloc

    This will show you the call made to allocate CMEM memory. After you have done this you need to adjust your CMEM pools and memory map to accomodate these memory requirements, and this wiki topic should help you get there: http://wiki.davincidsp.com/index.php/Changing_the_DVEVM_memory_map

    Regards, Niclas

  • hi Nicolas,

    thank you for the reply.

    I tested this command and i have the following message

    Encoder side :

    CE_DEBUG=2 ./gst-launch -v videotestsrc num-buffers=5 !  TIVidenc1 codecName=mpeg4enc engineName=encode ! queue min-threshold-bytes=17500 ! udpsink host=127.0.0.1 port=5000 | grep Memory_contigAlloc


    @1,020,287us: [+6 T:0x41ed6490] OM - Memory_contigAlloc> Warning: non-default alignment not supported for pool-based allocations, using default 0xffffffff.
    @1,020,673us: [+4 T:0x41ed6490] OM - Memory_contigAlloc> CMEM_alloc(11352) = 0x41ed7000.
    @1,020,924us: [+4 T:0x41ed6490] OM - Memory_contigAlloc> CMEM_getPhys(0x41ed7000) = 0x87814000.
    @1,021,286us: [+6 T:0x41ed6490] OM - Memory_contigAlloc> Warning: non-default alignment not supported for pool-based allocations, using default 0xffffffff.
    @1,021,642us: [+4 T:0x41ed6490] OM - Memory_contigAlloc> CMEM_alloc(512) = 0x40023000.
    @1,021,859us: [+4 T:0x41ed6490] OM - Memory_contigAlloc> CMEM_getPhys(0x40023000) = 0x8769d000.
    @1,022,098us: [+6 T:0x41ed6490] OM - Memory_contigAlloc> Warning: non-default alignment not supported for pool-based allocations, using default 0xffffffff.
    @1,022,600us: [+4 T:0x41ed6490] OM - Memory_contigAlloc> CMEM_alloc(374784) = 0x41f56000.
    @1,022,859us: [+4 T:0x41ed6490] OM - Memory_contigAlloc> CMEM_getPhys(0x41f56000) = 0x87af4000.
    @1,027,114us: [+6 T:0x41ed6490] OM - Memory_contigAlloc> Warning: non-default alignment not supported for pool-based allocations, using default 0xffffffff.
    @1,027,491us: [+4 T:0x41ed6490] OM - Memory_contigAlloc> CMEM_alloc(1920) = 0x400ea000.
    @1,027,711us: [+4 T:0x41ed6490] OM - Memory_contigAlloc> CMEM_getPhys(0x400ea000) = 0x87812000.
    @1,027,962us: [+6 T:0x41ed6490] OM - Memory_contigAlloc> Warning: non-default alignment not supported for pool-based allocations, using default 0xffffffff.
    @1,028,314us: [+4 T:0x41ed6490] OM - Memory_contigAlloc> CMEM_alloc(4) = 0x400ec000.
    @1,028,534us: [+4 T:0x41ed6490] OM - Memory_contigAlloc> CMEM_getPhys(0x400ec000) = 0x876a0000.
    @1,028,758us: [+6 T:0x41ed6490] OM - Memory_contigAlloc> Warning: non-default alignment not supported for pool-based allocations, using default 0xffffffff.
    @1,029,211us: [+4 T:0x41ed6490] OM - Memory_contigAlloc> CMEM_alloc(81920) = 0x42021000.
    @1,029,660us: [+4 T:0x41ed6490] OM - Memory_contigAlloc> CMEM_getPhys(0x42021000) = 0x87bbf000.
    @1,030,869us: [+6 T:0x41ed6490] OM - Memory_contigAlloc> Warning: non-default alignment not supported for pool-based allocations, using default 0xffffffff.
    @1,031,327us: [+4 T:0x41ed6490] OM - Memory_contigAlloc> CMEM_alloc(2400) = 0x40695000.
    @1,031,560us: [+4 T:0x41ed6490] OM - Memory_contigAlloc> CMEM_getPhys(0x40695000) = 0x8769e000.
    @1,041,790us: [+4 T:0x41ed6490] OM - Memory_contigAlloc> CMEM_alloc(307200) = 0x42141000.
    @1,042,072us: [+4 T:0x41ed6490] OM - Memory_contigAlloc> CMEM_getPhys(0x42141000) = 0x8795e000.
    @1,042,692us: [+6 T:0x41ed6490] OM - Memory_contigAlloc> Warning: non-default alignment not supported for pool-based allocations, using default 0xffffffff.
    @1,043,155us: [+4 T:0x41ed6490] OM - Memory_contigAlloc> CMEM_alloc(115200) = 0x4220c000.
    @1,043,409us: [+4 T:0x41ed6490] OM - Memory_contigAlloc> CMEM_getPhys(0x4220c000) = 0x87a29000.
    @1,043,828us: [+6 T:0x41ed6490] OM - Memory_contigAlloc> Warning: non-default alignment not supported for pool-based allocations, using default 0xffffffff.
    @1,044,250us: [+4 T:0x41ed6490] OM - Memory_contigAlloc> CMEM_alloc(115200) = 0x422d7000.
    @1,044,513us: [+4 T:0x41ed6490] OM - Memory_contigAlloc> CMEM_getPhys(0x422d7000) = 0x87893000.
    @1,044,939us: [+6 T:0x41ed6490] OM - Memory_contigAlloc> Warning: non-default alignment not supported for pool-based allocations, using default 0xffffffff.
    @1,045,444us: [+4 T:0x41ed6490] OM - Memory_contigAlloc> CMEM_alloc(115200) = 0x423a2000.
    @1,045,705us: [+4 T:0x41ed6490] OM - Memory_contigAlloc> CMEM_getPhys(0x423a2000) = 0x876a2000.

     

    Decoder side :

    CE_DEBUG=2 ./gst-launch -v udpsrc port=5000 caps="video/mpeg, mpegversion=(int)4, framerate=(fraction)30/1, width=(int)320, height=(int)240" ! queue min-threshold-bytes=7900 ! TIViddec2 codecName=mpeg4dec engineName=decode numOutputBufs=3 ! TIDmaiVideoSink videoStd=D1_PAL videoOutput=composite sync=false | grep Memory_contigAlloc


    CMEM Error: getPool: Failed to get a pool fitting a size 1505280
    @41,259,205us: [+6 T:0x41e1c490] OM - Memory_contigAlloc> Warning: non-default alignment not supported for pool-based allocations, using default 0xffffffff.
    @41,260,064us: [+4 T:0x41e1c490] OM - Memory_contigAlloc> CMEM_alloc(4948) = 0x41e1d000.
    @41,260,329us: [+4 T:0x41e1c490] OM - Memory_contigAlloc> CMEM_getPhys(0x41e1d000) = 0x87c8a000.
    @41,260,628us: [+6 T:0x41e1c490] OM - Memory_contigAlloc> Warning: non-default alignment not supported for pool-based allocations, using default 0xffffffff.
    @41,266,062us: [+4 T:0x41e1c490] OM - Memory_contigAlloc> CMEM_alloc(1505280) = 0x0.
    @41,266,255us: [+7 T:0x41e1c490] OM - Memory_contigAlloc> ERROR: CMEM alloc failed
    gst-launch-0.10: BufTab.c:440: BufTab_getNumBufs: Assertion `hBufTab' failed

     

    1- I didn't understand what the warning "non-default alignment not supported for pool-based allocations, using default 0xffffffff"  mean.

    2- The memory allocated for cmem in dm355 is 12MO, but in this example the sum of buffer size doesn't reach 3 MO so i think it does seem a problem of total size of cmem memory.

    have you any idea about this

    Regards,


     

  • Hello,

    Regarding #1, you can disregard this message. All allocations on Linux using CMEM will be allocated on aligned on a page boundary (4096 bytes).

    Regarding #2, you need to look at how the CMEM pools are configured. This is done in "loadmodules.sh". If you need more buffers, and have it available as you suggest, you can simply increase the number of buffers in the pool for the size you need (or create a new pool if it doesn't exist). If there is no more space for CMEM you will have to repartition your memory map as per the wiki topic above (changing the DVEVM memory map).

    Regards, Niclas

     

  • You may also want to review this article:  http://tiexpressdsp.com/index.php/CMEM_Overview

    There are some debugging techniques, including 'cat /proc/cmem', for determining how your CMEM memory is configured/utilized at runtime.

    Chris

  • hi,

    thank you Nicolas and Chris for your help.

    I solved the problem by increasing the size of memory allocated for cmem to 18 mo and reconfigure the loadmodule.sh script by changing the number of pools and and the physical start adress.

    But the problem now is that the TIViddec2 can't decode its buffer's data, this is error message : 

    gst-launch -v udpsrc port=5000 caps="application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)MP4V-ES, profile-level-id=(string)1, config=(string)000001010000012000845d4c285020f0a21f, payload=(int)96, ssrc=(guint)1269468342, clock-base=(guint)1375305076, seqnum-base=(guint)10160" ! rtpmp4vdepay ! queue min-threshold-bytes=7900 ! TIViddec2 codecName=mpeg4dec engineName=decode  ! TIDmaiVideoSink videoStd=D1_PAL videoOutput=composite sync=false

    Setting pipeline to PAUSED ...

    Pipeline is live and does not need PREROLL ...

    Setting pipeline to PLAYING ...

    New clock: GstSystemClock

    /GstPipeline:pipeline0/GstRtpMP4VDepay:rtpmp4vdepay0.GstPad:src: caps = video/mpeg, mpegversion=(int)4, systemstream=(boolean)false, codec_data=(buffer)000001010000012000845d4c285020f0a21f

    /GstPipeline:pipeline0/GstRtpMP4VDepay:rtpmp4vdepay0.GstPad:sink: caps = application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)MP4V-ES, profile-level-id=(string)1, config=(string)000001010000012000845d4c285020f0a21f, payload=(int)96, ssrc=(guint)1269468342, clock-base=(guint)1375305076, seqnum-base=(guint)10160

    /GstPipeline:pipeline0/GstQueue:queue0.GstPad:sink: caps = video/mpeg, mpegversion=(int)4, systemstream=(boolean)false, codec_data=(buffer)000001010000012000845d4c285020f0a21f

    /GstPipeline:pipeline0/GstQueue:queue0.GstPad:src: caps = video/mpeg, mpegversion=(int)4, systemstream=(boolean)false, codec_data=(buffer)000001010000012000845d4c285020f0a21f

    /GstPipeline:pipeline0/GstTIViddec2:tividdec20.GstPad:sink: caps = video/mpeg, mpegversion=(int)4, systemstream=(boolean)false, codec_data=(buffer)000001010000012000845d4c285020f0a21f

    ERROR: from element /GstPipeline:pipeline0/GstTIViddec2:tividdec20: failed to decode video buffer


    Additional debug info:

    gsttividdec2.c(1371): gst_tividdec2_decode_thread (): /GstPipeline:pipeline0/GstTIViddec2:tividdec20

    Execution ended after 6133383125 ns

     

    I don't know if it is a problem a memory or a question of incompatibility between rtpmp4vdepay and TIViddec2 

     

    Reagards