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.

Capture Encode Use Case failing if NSF is Integrated

Hi,

I am working on EZSDK 5.05. While writing the use case of Capture----->NSF----->Encode getting error in Allocate buffer. And here is the log for the error generated.

root@dm816x-evm:/usr/share/ti/ti-omx# ./capture_encode_a8host_debug.xv5T -o samp
le_test_1280_720_WODEI.h264 -m 720p -f 60 -b 1000000 -n 1000 -d 0
output file: sample_test_1280_720_WODEI.h264
bit_rate: 1000000
frame_rate: 60
num_frames: 1000
mode: 720p
display_id: 0
 Capture-Encode example
===============================
 OMX_Init completed
 UIAClient is ready to send a UIA configuration command
UIAClient received UIA_CONFIGURE_ACK
UIAClient is done sending requests
UIAClient is ready to send a UIA configuration command
UIAClient received UIA_CONFIGURE_ACK
UIAClient is done sending requests
 openeing file
 capture compoenent is created
 control TVP compoenent is created
Buffer Size computed: 0
set input port params (width = 0, height = 0)enable capture output port
got eventEnable/Disable Event
 encoder compoenent is created
Initializing Encoder Parameters
 NF component is created
set input port params (width = 0, height = 0)
set output port params (width = 0, height = 0)
set number of channels
set input resolution
set output resolution
enable NF input port
got eventEnable/Disable Event
enable NF output port
got eventEnable/Disable Event
connect call for Capture-Noise Filter
connect call for Noise Filter - Encode
 got eventState changed to: OMX_StateIdle
nBufferCountActual = 12
nBufferSize = 0
Shricharan omxproxy_alloc_buffer
Entering Utility trace Function
currentBuffer = 0       maxNumBuffers = 64
Capture: Error in OMX_AllocateBuffer() : OMX_ErrorBadParameter
*** glibc detected *** ./capture_encode_a8host_debug.xv5T: double free or corruption (out): 0x00119728 ***
======= Backtrace: =========
/lib/libc.so.6[0x4018ef3c]
/lib/libc.so.6(cfree+0xa0)[0x40190bd0]
./capture_encode_a8host_debug.xv5T[0x9e4e4]
./capture_encode_a8host_debug.xv5T[0xa0bf0]
./capture_encode_a8host_debug.xv5T[0xa1f10]
./capture_encode_a8host_debug.xv5T[0x48ae0]
./capture_encode_a8host_debug.xv5T[0x456c8]
./capture_encode_a8host_debug.xv5T[0x1e618]
./capture_encode_a8host_debug.xv5T[0x13440]
./capture_encode_a8host_debug.xv5T[0xac0c]
/lib/libc.so.6(__libc_start_main+0x120)[0x4013afd4]
======= Memory map: ========
00008000-000d0000 r-xp 00000000 00:0f 3554102    /usr/share/ti/ti-omx/capture_encode_a8host_debug.xv5T
000d0000-000d7000 rw-p 000c8000 00:0f 3554102    /usr/share/ti/ti-omx/capture_encode_a8host_debug.xv5T
000d7000-00138000 rw-p 00000000 00:00 0          [heap]
40002000-40003000 rw-s bffff000 00:11 3869       /dev/syslinkipc_Osal
40003000-40020000 r-xp 00000000 00:0f 3279885    /lib/ld-2.8.so
40020000-40021000 rw-p 00000000 00:00 0
40027000-40028000 r--p 0001c000 00:0f 3279885    /lib/ld-2.8.so
40028000-40029000 rw-p 0001d000 00:0f 3279885    /lib/ld-2.8.so
40029000-40035000 r-xp 00000000 00:0f 3279851    /lib/libgcc_s.so.1
40035000-4003c000 ---p 0000c000 00:0f 3279851    /lib/libgcc_s.so.1
4003c000-4003d000 rw-p 0000b000 00:0f 3279851    /lib/libgcc_s.so.1
40043000-40044000 rw-p 00000000 00:00 0
4004e000-40054000 r-xp 00000000 00:0f 3279855    /lib/librt-2.8.so
40054000-4005b000 ---p 00006000 00:0f 3279855    /lib/librt-2.8.so
4005b000-4005c000 r--p 00005000 00:0f 3279855    /lib/librt-2.8.so
4005c000-4005d000 rw-p 00006000 00:0f 3279855    /lib/librt-2.8.so
4005d000-4005e000 rw-p 00000000 00:00 0
4005e000-40060000 rw-s 9ecfe000 00:11 3869       /dev/syslinkipc_Osal
40060000-40061000 rw-s 9f435000 00:11 3869       /dev/syslinkipc_Osal
40061000-40077000 rw-s 9f522000 00:11 3869       /dev/syslinkipc_Osal
4009c000-4009d000 rw-p 00000000 00:00 0
4009d000-400b5000 rw-s 9f537000 00:11 3869       /dev/syslinkipc_Osal
400b5000-400b6000 rw-s 9f54e000 00:11 3869       /dev/syslinkipc_Osal
400c8000-400c9000 ---p 00000000 00:00 0
400c9000-400cc000 rw-p 00000000 00:00 0
400de000-400df000 rw-s 55020000 00:11 3869       /dev/syslinkipc_Osal
400eb000-400ff000 r-xp 00000000 00:0f 3279892    /lib/libpthread-2.8.so
400ff000-40107000 ---p 00014000 00:0f 3279892    /lib/libpthread-2.8.so
40107000-40108000 r--p 00014000 00:0f 3279892    /lib/libpthread-2.8.so
40108000-40109000 rw-p 00015000 00:0f 3279892    /lib/libpthread-2.8.so
40109000-4010b000 rw-p 00000000 00:00 0
40126000-40243000 r-xp 00000000 00:0f 3279939    /lib/libc-2.8.so
40243000-4024a000 ---p 0011d000 00:0f 3279939    /lib/libc-2.8.so
4024a000-4024c000 r--p 0011c000 00:0f 3279939    /lib/libc-2.8.so
4024c000-4024d000 rw-p 0011e000 00:0f 3279939    /lib/libc-2.8.so
4024d000-40250000 rw-p 00000000 00:00 0
40250000-40450000 rw-s 9f700000 00:11 3869       /dev/syslinkipc_Osal
40450000-4048c000 rw-s 55024000 00:11 3869       /dev/syslinkipc_Osal
4048d000-4048e000 rw-s 55020000 00:11 3869       /dev/syslinkipc_Osal
4048e000-4048f000 ---p 00000000 00:00 0
4048f000-40492000 rw-p 00000000 00:00 0
404d7000-404d8000 ---p 00000000 00:00 0
404d8000-404db000 rw-p 00000000 00:00 0
404ea000-405ea000 rw-s 9a100000 00:11 3869       /dev/syslinkipc_Osal
405ea000-4062a000 rw-s 40300000 00:11 3869       /dev/syslinkipc_Osal
4062a000-4062b000 rw-s 55020000 00:11 3869       /dev/syslinkipc_Osal
4062b000-4062c000 ---p 00000000 00:00 0
4062c000-4062f000 rw-p 00000000 00:00 0
40651000-4c251000 rw-s b3d00000 00:11 3869       /dev/syslinkipc_Osal
4c251000-4c291000 rw-s 40400000 00:11 3869       /dev/syslinkipc_Osal
4c291000-4c292000 ---p 00000000 00:00 0
4c292000-4c295000 rw-p 00000000 00:00 0
4c2bf000-4c2c0000 ---p 00000000 00:00 0
4c2c0000-4cabf000 rw-p 00000000 00:00 0
4d2ad000-4d8ac000 rw-s 9e700000Aborted

Kindly let me know if I am missing any part while writing the use case or if any information is required to address this issue.

--G.Shricharan

  • Hello,

    When you are using noisefilter: Width/pitch/height should be multiple of 32 pixels.

    You could  run ./loggerSMDump.out 0x9e400000 0x100000 all for getting more debug prints.

    It is avilable at /usr/share/ti/ti-uia folder in filesystem.

    Best Regards,

    Margarita

  • Thanks Margarita for the suggestion; I will Implement your suggestion and will let you know the result.

    Regards,

    G.Shricharan.

  • Hello,

    Please let me know if you need further details.

    Best Regards,

    Margarita

  • Hi Margarita,

    The Allocate buffer issue is solved; the fix was that; previously there were no "numInport" and "numOutport" defined for noise filter so the buffer size calculation was zero as can be seen from the above available log.

    But now I am facing another issue. It is that nothing is been written to the file (encoded output) and the below is the available log

    root@dm816x-evm:/usr/share/ti/ti-omx# ./capture_encode_a8host_debug.xv5T -o samp
    le_test_1280_720_WODEI.h264 -m 720p -f 60 -b 1000000 -n 1000 -d 0
    output file: sample_test_1280_720_WODEI.h264
    bit_rate: 1000000
    frame_rate: 60
    num_frames: 1000
    mode: 720p
    display_id: 0
     Capture-Encode example
    ===============================
     OMX_Init completed
     UIAClient is ready to send a UIA configuration command
    UIAClient received UIA_CONFIGURE_ACK
    UIAClient is done sending requests
    UIAClient is ready to send a UIA configuration command
    UIAClient received UIA_CONFIGURE_ACK
    UIAClient is done sending requests
    This pipe is used if output is directed to file write thread
     openeing file
     capture compoenent is created
     control TVP compoenent is created
    Width=1280      Height=720
    Buffer Size computed: 1382400
    set input port params (width = 1280, height = 720)enable capture output port
    got eventEnable/Disable Event
     encoder compoenent is created
    Initializing Encoder Parameters
     NF component is created
    set input port params (width = 1280, height = 720)
    set output port params (width = 1280, height = 720)
    set number of channels
    set input resolution
    set output resolution
    enable NF input port
    got eventEnable/Disable Event
    enable NF output port
    got eventEnable/Disable Event
    connect call for Capture-Noise Filter
    connect call for Noise Filter - Encode
     got eventState changed to: OMX_StateIdle
    got eventState changed to: OMX_StateIdle
    Capture is in IDLE state
     Noise Filter input port use buffer done
      Noise Filter outport buffers allocated
     got eventState changed to: OMX_StateIdle
     Noise Filter state IDLE
      encoder input port use buffer done
     got eventState changed to: OMX_StateIdle
     Encoder state IDLE and O/P buffer allocation done
     got eventState changed to: OMX_StateExecuting
     encoder state execute
     got eventState changed to: OMX_StateExecuting
     Noise Filter state execute
     got eventState changed to: OMX_StateExecuting
     capture state execute
     sendCommand Executed

    Pleas let me know if I am missing some thing to be added

    Regards,

    G.Shricharan

  • Hi,

    With respect to the above discussion the issue is solved with the suggestion of margarita to check the loggerDump. From this log it has been Identified that my input source is not at the resolution 720p it was less than that. Hence modified the input resolution and hte problem got fixed.

    Regards,

    G.Shricharan

  • Hello,

    Please check the formats. 

    The encoder supports YUV420 semi-planar.

    Check here for more information:

    ti-ezsdk_dm814x-evm_5_05_02_00/component-sources/omx-ti81xx-src_05_02_00_48

    OpenMax_UserGuide.pdf

    Best Regards,

    Margarita

  • Thanks Margarita for your timely and to the point response. The issue is solved and I have the encoded data written to the file.

    Regards,

    G.Shricharan

  • Hi Margarita Gashova,

    I have a raw YUV file and I encoded it to h264 and saved it in h264 container on DM8148 board with the help of ./encode_a8host_debug.xv5T application.

    ./encode_a8host_debug.xv5T -o sample.h264 -i sample.yuv -f 60 -b 1000000 -w 1920 -h 1080 -c h264

    I would like to do the same by replacing the .264 container to mp4 container. How can I do this.

    ./encode_a8host_debug.xv5T -o sample.mp4 -i sample.yuv -f 60 -b 1000000 -w 1920 -h 1080 -c h264

    My requirement is to generate an mp4 file with h264 codec.

    Kindly please help me.

    Regards,

    Baz