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.

DM365 h264enc_02_00_00_09 H264 create error?

Hi,

Now we want to update DM365 H264 codec from h264enc_01_20_00_05 to h264enc_02_00_00_09, but i meet create error problem. But the error number is 0.

my source code is blow:

    VIDENC1_Params *params;
    VIDENC1_DynamicParams *dynParams;
    IH264VENC_Params *eparams;
    IH264VENC_DynamicParams *edynParams;

    if (!dmaienc->params){
        dmaienc->params = g_malloc0(sizeof (IH264VENC_Params));
        memset(dmaienc->params, 0, sizeof(IH264VENC_Params));
    }
    if (!dmaienc->dynParams){
        dmaienc->dynParams = g_malloc0(sizeof (IH264VENC_DynamicParams));
        memset(dmaienc->dynParams, 0, sizeof(IH264VENC_DynamicParams));
    }
    *(VIDENC1_Params *)dmaienc->params     = Venc1_Params_DEFAULT;
    //*(IH264VENC_Params *)dmaienc->params     = IH264VENC_PARAMS;
    *(IH264VENC_DynamicParams *)dmaienc->dynParams  = H264VENC_TI_IH264VENC_DYNAMICPARAMS;
    params = (VIDENC1_Params *)dmaienc->params;
    dynParams = (VIDENC1_DynamicParams *)dmaienc->dynParams;
    eparams = (IH264VENC_Params *)dmaienc->params;
    edynParams = (IH264VENC_DynamicParams *)dmaienc->dynParams;

    GST_INFO("Configuring the codec with the TI HDVICP H264 Video encoder settings");

    dynParams->targetBitRate = params->maxBitRate;

    params->size = sizeof (IH264VENC_Params);
    dynParams->size = sizeof (IH264VENC_DynamicParams);

    params->encodingPreset        = XDM_HIGH_SPEED;
    params->rateControlPreset     = IVIDEO_STORAGE;
    params->maxFrameRate          = 30000 ;
    params->maxBitRate            = 2000000;
    params->inputChromaFormat     = XDM_YUV_420SP;
    params->dataEndianness        = XDM_BYTE;
    params->maxInterFrameInterval = 0;
    params->inputContentType      = IVIDEO_PROGRESSIVE;
    params->reconChromaFormat     = XDM_YUV_420SP;

    eparams->videncParams = *params;
    eparams->profileIdc = 100;
    eparams->levelIdc = 31;
    eparams->entropyMode = 0;
    eparams->transform8x8FlagIntraFrame = 1;
    eparams->transform8x8FlagInterFrame = 1;
    eparams->aspectRatioX = 1;
    eparams->aspectRatioY = 1;
    eparams->pixelRange = 1;

    eparams->timeScale = 60;
    eparams->numUnitsInTicks = 1;
    eparams->enableVUIparams = 1;
    //eparams->resetHDVICPeveryFrame = 0;

    eparams->disableHDVICPeveryFrame = 0;
    eparams->meAlgo = 0;
    eparams->unrestrictedMV = 0;
    eparams->seqScalingFlag = 0;
#if 1
    eparams->encQuality = 1;
#else
 eparams->encQuality = 0;
#endif
    eparams->enableARM926Tcm = 0;
    eparams->enableDDRbuff = 1;

    edynParams->sliceSize = 0;
    edynParams->airRate = 0;
#if 1
    edynParams->intraFrameQP = 51;
    edynParams->interPFrameQP = 51;
    edynParams->initQ = 51;
    edynParams->rcQMax = 51;
#else
    edynParams->intraFrameQP = 28;
    edynParams->interPFrameQP = 28;
    edynParams->initQ = 28;
    edynParams->rcQMax = 45;
#endif
    edynParams->rcQMin = 0;
    edynParams->rcAlgo = 1;

    edynParams->maxDelay = 2000;
    edynParams->intraSliceNum = 0;
    edynParams->lfDisableIdc = 0;

    edynParams->meMultiPart = 0;
    edynParams->enableBufSEI = 0;
    edynParams->enablePicTimSEI = 0;
    edynParams->intraThrQF = 5;
    edynParams->perceptualRC = 1;
    edynParams->idrFrameInterval = 0;
    edynParams->mvSADoutFlag = 0;
    edynParams->resetHDVICPeveryFrame = 0;
    edynParams->enableROI = 0;
    edynParams->metaDataGenerateConsume = 0;

and configure file is blow:

/*
 * Copyright (C) $year Texas Instruments Incorporated - http://www.ti.com/
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation version 2.1 of the License.
 *
 * This program is distributed #as is# WITHOUT ANY WARRANTY of any kind,
 * whether express or implied; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 */

prog.build.platform = "ti.platforms.evmDM365";

/* Load support for the Codec Engine OSAL */
var osalGlobal = xdc.useModule('ti.sdo.ce.osal.Global');

/* Configure CE to use it's DSP Link Linux version */
osalGlobal.runtimeEnv = osalGlobal.LINUX;

/*
 *  ======== Engine Configuration ========
 */
var videnc   = xdc.module('ti.sdo.ce.video1.IVIDENC1');
var viddec   = xdc.module('ti.sdo.ce.video2.IVIDDEC2');

var MPEG4ENC = xdc.useModule('ti.sdo.codecs.mpeg4enc.ce.MPEG4ENC');
var H264ENC  = xdc.useModule('ti.sdo.codecs.h264enc.ce.H264ENC');
var MPEG4DEC = xdc.useModule('ti.sdo.codecs.mpeg4dec.ce.MPEG4DEC');
var H264DEC  = xdc.useModule('ti.sdo.codecs.h264dec.ce.H264DEC');
var JPEGENC = xdc.useModule('ti.sdo.codecs.jpegenc.ce.JPEGENC');
var JPEGDEC = xdc.useModule('ti.sdo.codecs.jpegdec.ce.JPEGDEC');
var DEI = xdc.useModule('ti.sdo.codecs.dei.ce.DEI');

var Engine = xdc.useModule('ti.sdo.ce.Engine');
var encodeEngine = Engine.create("encode", [
/*    {name: "mpeg4enc", mod: MPEG4ENC, local: true, groupId: 1},*/
    {name: "h264enc", mod: H264ENC, local: true, groupId: 1},
    {name: "jpegenc", mod: JPEGENC, local: true, groupId: 1},
    {name: "dei", mod: DEI, local: true, groupId: 1},
]);
/*var decodeEngine = Engine.create("decode", [
    {name: "mpeg4dec", mod: MPEG4DEC, local: true, groupId: 1},
    {name: "h264dec", mod: H264DEC, local: true, groupId: 1},
    {name: "jpegdec", mod: JPEGDEC, local: true, groupId: 1},
]);*/

/* Load support for the 'Davinci Multimedia Application Interface' modules */
var DMAI = xdc.loadPackage('ti.sdo.dmai');


/* Configure RMAN */
var RMAN = xdc.useModule('ti.sdo.fc.rman.RMAN');
RMAN.useDSKT2 = false;
RMAN.persistentAllocFxn = "__ALG_allocMemory";
RMAN.persistentFreeFxn = "__ALG_freeMemory";
RMAN.semCreateFxn = "Sem_create";
RMAN.semDeleteFxn = "Sem_delete";
RMAN.semPendFxn = "Sem_pend";
RMAN.semPostFxn = "Sem_post";
RMAN.tableSize = 10;

var vicp = xdc.useModule('ti.sdo.linuxutils.vicp.VICP');
vicp.debug = false;

/* Configure VICPSYNC */
var VICPSYNC = xdc.useModule('ti.sdo.fc.vicpsync.VICPSYNC');

/* Configure HDVICPSYNC */
var HDVICPSYNC = xdc.useModule('ti.sdo.fc.hdvicpsync.HDVICPSYNC');

/* Configure MEMUTILS */
var MEMUTILS = xdc.useModule('ti.sdo.fc.memutils.MEMUTILS');

var EDMA3 = xdc.useModule('ti.sdo.fc.edma3.Settings');

var HDVICP = xdc.useModule('ti.sdo.fc.ires.hdvicp.HDVICP');

var VICP = xdc.useModule('ti.sdo.fc.ires.vicp.VICP2');

var ADDRSPACE = xdc.useModule('ti.sdo.fc.ires.addrspace.ADDRSPACE');

var EDMA3CHAN = xdc.useModule('ti.sdo.fc.ires.edma3chan.EDMA3CHAN');

var LSP = xdc.useModule('ti.sdo.linuxutils.edma.EDMA');

var CMEM = xdc.useModule('ti.sdo.linuxutils.cmem.CMEM');

/*
var MEMTCM = xdc.useModule('ti.sdo.fc.ires.memtcm.MEMTCM');
MEMTCM.cmemBlockId = 1; //Since we use _1 in our insmod command.
*/

EDMA3.globalInit = true;
EDMA3.maxQdmaChannels = [10,10,10,10];

/* Uncomment these lines if you wish to debug FC and enable FC trace */

/*
xdc.loadPackage('ti.sdo.fc.ires.vicp').profile = "debug_trace";
xdc.loadPackage('ti.sdo.fc.ires.edma3chan').profile = "debug_trace";
xdc.loadPackage('ti.sdo.fc.rman').profile = "debug_trace";
xdc.loadPackage('ti.sdo.fc.edma3').profile = "debug_trace";
EDMA3CHAN.trace = true;
EDMA3CHAN.debug = true;
*/

Blow is the Ce output:

@8,097,721us: [+1 T:0x451ff490 S:0x451fe3cc] OM - Memory__removeContigBuf> Enter(virtAddr=0x45705000, size=65536)
@8,099,203us: [+1 T:0x451ff490 S:0x451fe3cc] OM - Memory__removeContigBuf> removing cb->phys=0x87d35000, cb->size=0x10000, cb->virt=0x45705000
@8,100,974us: [+0 T:0x451ff490 S:0x451fe3d4] OM - Memory_free> Enter(0x102ad8, 0x10)
@8,102,379us: [+0 T:0x451ff490 S:0x451fe3d4] OM - Memory_free> return (0x1)
@8,103,929us: [+0 T:0x451ff490 S:0x451fe3f4] OM - Memory_contigFree> return (0x1)
@8,105,392us: [+0 T:0x451ff490 S:0x451fe42c] OM - Memory_free> return (0x1)
@8,106,946us: [+0 T:0x451ff490 S:0x451fe42c] OM - Memory_free> Enter(0x438f8000, 0x200)
@8,108,341us: [+0 T:0x451ff490 S:0x451fe3f4] OM - Memory_contigFree> Enter(addr=1133477888, size=512)
@8,110,217us: [+1 T:0x451ff490 S:0x451fe3cc] OM - Memory__removeContigBuf> Enter(virtAddr=0x438f8000, size=512)
@8,111,687us: [+1 T:0x451ff490 S:0x451fe3cc] OM - Memory__removeContigBuf> removing cb->phys=0x877bb000, cb->size=0x200, cb->virt=0x438f8000
@8,113,327us: [+0 T:0x451ff490 S:0x451fe3d4] OM - Memory_free> Enter(0x102af0, 0x10)
@8,114,789us: [+0 T:0x451ff490 S:0x451fe3d4] OM - Memory_free> return (0x1)
@8,116,386us: [+0 T:0x451ff490 S:0x451fe3f4] OM - Memory_contigFree> return (0x1)
@8,117,874us: [+0 T:0x451ff490 S:0x451fe42c] OM - Memory_free> return (0x1)
@8,119,555us: [+0 T:0x451ff490 S:0x451fe42c] OM - Memory_free> Enter(0x457d0000, 0xc000)
@8,120,975us: [+0 T:0x451ff490 S:0x451fe3f4] OM - Memory_contigFree> Enter(addr=1165819904, size=49152)
@8,123,489us: [+1 T:0x451ff490 S:0x451fe3cc] OM - Memory__removeContigBuf> Enter(virtAddr=0x457d0000, size=49152)
@8,124,927us: [+1 T:0x451ff490 S:0x451fe3cc] OM - Memory__removeContigBuf> removing cb->phys=0x87c6a000, cb->size=0xc000, cb->virt=0x457d0000
@8,126,554us: [+0 T:0x451ff490 S:0x451fe3d4] OM - Memory_free> Enter(0x102b08, 0x10)
@8,127,961us: [+0 T:0x451ff490 S:0x451fe3d4] OM - Memory_free> return (0x1)
@8,129,600us: [+0 T:0x451ff490 S:0x451fe3f4] OM - Memory_contigFree> return (0x1)
@8,131,071us: [+0 T:0x451ff490 S:0x451fe42c] OM - Memory_free> return (0x1)
@8,132,631us: [+0 T:0x451ff490 S:0x451fe47c] ti.sdo.ce.alg - ALG_create> Exit (algHandle=NULL)
@8,134,052us: [+7 T:0x451ff490 S:0x451fe4c4] ti.sdo.ce.alg.Algorithm - Algorithm_create> Algorithm creation FAILED; make sure that 1) alg params are correct/appropriate, 2) there is enough internal and external algorithm memory available -- check DSKT2 settings for heap assignments and scratch allocation
@8,135,852us: [+0 T:0x451ff490 S:0x451fe4ac] ti.sdo.ce.alg.Algorithm - Algorithm_delete> Enter(alg=0x101b70)
@8,137,272us: [+0 T:0x451ff490 S:0x451fe48c] OM - Memory_free> Enter(0x101b70, 0x10)
@8,138,834us: [+0 T:0x451ff490 S:0x451fe48c] OM - Memory_free> return (0x1)
@8,140,352us: [+0 T:0x451ff490 S:0x451fe4c4] ti.sdo.ce.alg.Algorithm - Algorithm_delete> Exit
@8,141,952us: [+0 T:0x451ff490 S:0x451fe4c4] ti.sdo.ce.alg.Algorithm - Algorithm_create> return (0x0)
@8,143,483us: [+2 T:0x451ff490 S:0x451fe504] CV - VISA_create2> FAILED to create local codec.
@8,145,094us: [+0 T:0x451ff490 S:0x451fe4dc] CV - VISA_delete(0x102cf0)
@8,146,509us: [+5 T:0x451ff490 S:0x451fe4dc] CV - VISA_delete> deleting codec (localQueue=0xffff, remoteQueue=0xffff)
@8,148,147us: [+0 T:0x451ff490 S:0x451fe4bc] OM - Memory_free> Enter(0x102cf0, 0x30)
@8,149,759us: [+0 T:0x451ff490 S:0x451fe4bc] OM - Memory_free> return (0x1)
@8,151,327us: [+0 T:0x451ff490 S:0x451fe634] ti.sdo.ce.video1.VIDENC1 - VIDENC1_create> return (0x0)
ce/Venc1.c-----259
ce/Venc1.c-----264 error 0
0:00:10.020604833   669    0xfe310 WARN             TIVidenc1 gsttividenc1.c:245:gstti_videnc1_create:<h264encoder> error: failed to create video encoder: h264enc