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.

GstOmxCamera can not get buffer

Hi,all!

      I  have  the ics 4.0.3  and  omap4 platform。First  i want  to use the gstomxcamera ,and  the surfacesink  will send buffer to it  by  event. I get the buffer pointer  in the handle_event()(gstomx_base_src.c),but the other function(gstomx_camera.c)  can not get it.  secoed the gstomxcamera  will  interrupt  when  the g_omx_port_enable  function ,i find,in the g_omx_port_allocate_buffers function,the g_return_if_fail (port->buffers[i])  failed  after OMX_UseBuffer, so where  are  the buffer of port set  and the what  is the source of the buffer ?

BR

Aaron

  • which SW release and which HW (board + sensor) are you using?

  • Hi,Mayank:

        The  os is android 4.0.3  ,gstreamer is 0.10.6 and openmax  is 1.1. the board  is omap4430. I got  the native buffer from  display  ,and  how  to  contact  the native buffer and the  OMX_UseBuffer , how  do  the native buffer   will be passed  to the struct used by OMX_UseBuffer? Thank you.

    BR

    Aaron

  • Please refer to the code in the folder mydroid/hardware/ti/omap4xxx/camera/OMXCameraAdapter

  • Hi,Mayank!

        I  have  read the code in OMXCameraAdapter  and  set the parameters about the camert .I  have  some questions  .

     First  i find  the omx  change from load to idle state failed  in the gstomx_camera.what should be setup in the camera? 

    Second the parameters of gstomx_camera which  i  set  is

      Output Port = {

     nBufferCountActual = 6

    nBufferCountMin = 3

     nBufferSize = 663552

    cMIMEType = (null)

    pNativeRender = 0x0

    nBitrate = 0

    nFrameWidth = 768

     nFrameHeight = 576

    nStride = 4096

     nSliceHeight = 0

     xFramerate = 1638400

    eCompressionFormat = OMX_VIDEO_CodingUnused

    eColorFormat = 0x15, OMX_COLOR_FormatYUV420SemiPlanar

    pNativeWindow = 0x0

     }

    The  parameters  of camerahal  is

     *** PRV Width = 768
     *** PRV Height = 576
     *** PRV IMG FMT = 15
     *** PRV portCheck.nBufferSize = 748800
      *** PRV portCheck.nBufferCountMin = 3
      *** PRV portCheck.nBufferCountActual = 6
     ***PRV portCheck.format.video.nStride = 4096

    now  most parameters  are same except buffer size. but the buffer size can not setup.

    the camerahal  will  dequeue  buffer  from  surfaceflinger  and the parameters is

     stride=4096
     width=800
     height=624
     usage=2818
     pixelformat=256
     nativebuffer=0x1360e44

    The  gstomx_camera got the buffer from surfaceflinger  and the parameters are same  too.

    but the gstomx_camera have the error : ** (gst-launch-0.10:773): CRITICAL **: g_omx_port_allocate_buffers: assertion `port->buffers[i]' failed.

    so excetp the parameters of omx port and buffer, what parameter can i setup  and the flow ?

    the files are gstomx_camera log  and camera app.4572.camera app.log

    3107.gstomx_camera.log

    BR

    Aaron

  • Please share Ducati logs (/d/remoteproc/omap-rproc.1/trace1) from Android app and gst-omx.

  • Hi,Mayank

        The files are android camera app  and gstomx_camera   6378.camera_trace1.txt    7827.gstomx_trace1.txt   thank you!

    BR

    Aaron

  • Here is the difference between Android and GST:

    Android:

    [    147.214] [ERR=468] src/new_sensor_MSP.c:[533]:Sen Read ID: 9600, expected ID:9600
    [    184.920] [ERR=958] src/msp_camera_api.c:[1462]:video start Sensor - w:1280 h:960!!!

    GST

    [    147.214] [ERR=468] src/new_sensor_MSP.c:[533]:Sen Read ID: 9600, expected ID:9600
    [    147.699] [ERR=472] src/msp_camera_api.c:[1462]:video start Sensor - w:800 h:600!!!

    In case gst-omx, looks like you are setting up a different sensor which is configured to output 800x600. Since preview resolution (1280x720) is bigger than sensor resolution, OMX camera reports an error.

    Solutions:

    1. Make gst-omx pick the right sensor

    2. Try with lower preview resolution



  • Hi,Mayank

       Hi, the camera preview is ok.but  when  i  use the omx  camera  and encode ,find  the wait_for_state()  is  time out  and  the omx core is wrong state .and the buffer  is ok and do not have  other error message.

       The command is  "gst-launch omx_camera mode=1 device=secondary name=cam cam.src ! queue ! surfaceflingersink cam.vidsrc ! queue ! omx_h264enc profile=8 bitrate=1024000 ! filesink location=/mnt/sdcard/ttt  --gst-debug=omx:5". the log is 2100.putty6.log

    Thank you!

    Aaron

  • Aaron;

    One idea I got after checking the log is that timeout could be caused by not allocating/freeing the buffers when one state change is pending or when port is being enabled/disabled. GST works in some cases using one thread, could that be the case here? that the same thread is waiting for the state change or command and used to allocate/free buffers?