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.

codecServer Buffer error

Other Parts Discussed in Thread: DM3730, OMAP3530, TVP5146M2

[DSP] @34,441,922tk: [+0 T:0x87c37684] ti.sdo.ce.video1.VIDENC1 - VIDENC1_process> Enter (handle=0x87c36560, inBufs=0x87c3d57c, outBufs=0x87c3d64c, inArgs=0x85907a04, outArgs=0x85907a10)
[DSP] @34,442,043tk: [+5 T:0x87c37684] CV - VISA_enter(visa=0x87c36560): algHandle = 0x87c36598
[DSP] @34,442,110tk: [+0 T:0x87c37684] ti.sdo.ce.alg.Algorithm - Algorithm_activate> Enter(alg=0x87c36598)
[DSP] @34,442,174tk: [+0 T:0x87c37684] ti.sdo.ce.alg.Algorithm - Algorithm_activate> Exit
[DSP] @34,505,321tk: [+5 T:0x87c37684] CV - VISA_exit(visa=0x87c36560): algHandle = 0x87c36598
[DSP] @34,505,461tk: [+0 T:0x87c37684] ti.sdo.ce.alg.Algorithm - Algorithm_deactivate> Enter(alg=0x87c36598)
[DSP] @34,505,538tk: [+0 T:0x87c37684] ti.sdo.ce.alg.Algorithm - Algorithm_deactivate> Exit
[DSP] @34,505,592tk: [+0 T:0x87c37684] ti.sdo.ce.video1.VIDENC1 - VIDENC1_process> Exit (handle=0x87c36560, retVal=0x0)
[DSP] @34,505,671tk: [+0 T:0x87c37684] OM - Memory_cacheWb> Enter(addr=0x83af8000, sizeInBytes=29803)
[DSP] @34,505,788tk: [+0 T:0x87c37684] OM - Memory_cacheWb> return
[DSP] @34,505,840tk: [+5 T:0x87c37684] CN - NODE> returned from call(algHandle=0x87c36560, msg=0x85907880); messageId=0x00031eaf
@15,355,865us: [+0 T:0x43bae490] CE - Engine_fwriteTrace> returning count [1331]
@15,355,896us: [+0 T:0x43bae490] CV - VISA_call Completed: messageId=0x00031eaf, command=0x0, return(status=0)
@15,355,957us: [+7 T:0x43bae490] OM - Memory_getVirtualAddress> Error: buffer (physAddr=0x85d343a5, size=0x78180) not found in translationcache

Ensure that you have registered this buffer with Memory_registerContigBuf()
@15,355,987us: [+7 T:0x43bae490] OM - Memory_getVirtualAddress> Error: buffer (physAddr=0x85db139b, size=0x1df40) not found in translationcache

Ensure that you have registered this buffer with Memory_registerContigBuf()
@15,355,987us: [+7 T:0x43bae490] OM - Memory_getVirtualAddress> Error: buffer (physAddr=0x85dd111b, size=0x1df40) not found in translationcache

 

 

dm3730 mem set

=======================================================================

# Default Memory Map for DM3730 EVM
#
# Start Addr    Size    Description
# -------------------------------------------
# 0x80000000     55 MB  Linux
# 0x83700000     34 MB  CMEM
# 0x85900000     39 MB  CODEC SERVER

load () {
    modprobe cmemk phys_start=0x83700000 phys_end=0x85900000 allowOverlap=1 useHeapIfPoolUnavailable=1
    modprobe dsplinkk
    modprobe lpm_omap3530
    modprobe sdmak
}

  • From the trace logs, it looks like the codec is returning pointers to buffers that are not accessible from the ARM side.  Notice from the error msgs on the ARM side that the addrs in question (e.g. 0x85d343a5) are coming from the CODEC SERVER memory section (0x85900000+), not the CMEM memory (0x83700000 - 0x858fffff).  The codec should not be returning pointers to memory that the [ARM-side, in this case] application didn't give it.

    I've moved this to the Codec Forum.  Can you provide details about which codec this is, including the version?

    Chris

  • Hi

      Chris

      Thanks!

       HW:dm3730 + tvp5146m2

       SW:dvsdk_dm3730-evm_4_02_00_06 , kernel 2.6.32

       Encoder h264enc  : Version 01.00.02.00

       Gstreamer:gstreamer-ti_svn919

       Test Pipeline:

       gst-launch  -e v4l2src always-copy=FALSE queue-size=2 ! 'video/x-raw-yuv,format=(fourcc)UYVY,width=720,height=576,framerate=(fraction)25/1' !  TIPrepEncBuf contiguousInputFrame=true numOutputBufs=2 deInterlacer=true ! queue  max-size-buffers=2 max-size-bytes=0 ! TIVidenc1 codecName=h264enc engineName=codecServer contiguousInputFrame=false  ! dmaiperf ! mpegtsmux ! queue ! rtpmp2tpay ! udpsink port=8554 host=192.168.1.3

    The gstreamer-ti_svn919 :

    encoder process before:

    gsttiprepencbuf.c

    /******************************************************************************
     * gst_tiprepencbuf_convert_gst_to_dmai
     *  This function convert gstreamer buffer into DMAI graphics buffer.
     *****************************************************************************/
    static Buffer_Handle
    gst_tiprepencbuf_convert_gst_to_dmai(GstTIPrepEncBuf * prepencbuf,
        GstBuffer * buf, gboolean reference)
    {
        BufferGfx_Attrs gfxAttrs = BufferGfx_Attrs_DEFAULT;
        Buffer_Handle   hBuf     = NULL;

        gfxAttrs.bAttrs.reference = reference;
        gfxAttrs.dim.width        = prepencbuf->srcWidth;
        gfxAttrs.dim.height       = prepencbuf->srcHeight;
        gfxAttrs.colorSpace       = prepencbuf->srcColorSpace;
        gfxAttrs.dim.lineLength   = BufferGfx_calcLineLength(gfxAttrs.dim.width,
                                        prepencbuf->srcColorSpace);

        hBuf = Buffer_create(GST_BUFFER_SIZE(buf),
            BufferGfx_getBufferAttrs(&gfxAttrs));

        if (hBuf == NULL) {
            GST_ERROR("failed to create  buffer\n");
            return NULL;
        }
        Buffer_setUserPtr(hBuf, (Int8 *) GST_BUFFER_DATA(buf));
        Buffer_setNumBytesUsed(hBuf, GST_BUFFER_SIZE(buf));
        return hBuf;
    }

     

    encoder process after:

    tsttividenc1.c

    /* Populate codec header */
        gst_tividenc1_populate_codec_header(videnc1, videnc1->hEncOutBuf);

        /* Set the source pad capabilities based on the encoded frame properties.
         */
        gst_tividenc1_set_source_caps(videnc1, videnc1->hEncOutBuf);

        /* Create a DMAI transport buffer object to carry a DMAI buffer to
         * the source pad.  The transport buffer knows how to release the
         * buffer for re-use in this element when the source pad calls
         * gst_buffer_unref().
         */
        *outBuf =
            gst_buffer_new_and_alloc(Buffer_getNumBytesUsed(videnc1->hEncOutBuf));

        memcpy(GST_BUFFER_DATA(*outBuf), Buffer_getUserPtr(videnc1->hEncOutBuf),
            Buffer_getNumBytesUsed(videnc1->hEncOutBuf));

        gst_buffer_set_caps(*outBuf, GST_PAD_CAPS(videnc1->srcpad));
       

        /* Get the metadata from the input buffer */
        gst_buffer_copy_metadata(*outBuf, videnc1->inBufMetadata,
            GST_BUFFER_COPY_FLAGS | GST_BUFFER_COPY_TIMESTAMPS);

        goto exit_ok;