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.

H264 Venc process failed with ext code 0x8006

Hello All,

    I am working with the DM365, dvsdk 2_10_01, H264 encoder/decoder ver 2.

I am passing to the encoder a 720x576 YUV_420SP buffer. The encoder fails with error 0x8006. The upper part means Fatal Error. I have some trouble in decoding the lower part since the enum is something like the code listed below.

But looking at the trace I see a suspicious huge amount of bytes:

@71,967,500us: [+2 T:0x43c1d490] ti.sdo.dmai - [Venc1] VIDENC1_process() ret -1 inId 0 outID 1073900884 generated 1073782284 bytes

Someone has some idea of the possible issue here. thank in advance. Below the last part of the trace and the codec error enum.

 

CE DEBUG:

@71,959,843us: [+2 T:0x40d8e490] ti.sdo.dmai - [Buffer] Set user pointer 0x40e6e000 (physical 0x850cf000)
@71,960,784us: [+0 T:0x43c1d490] ti.sdo.ce.video1.VIDENC1 - VIDENC1_process> Enter (handle=0x4918b8, inBufs=0x43c1cb90, outBufs=0x43c1cb84, inArgs=0x43c1cb74, outArgs=0x43c1cafc)
@71,961,267us: [+5 T:0x43c1d490] CV - VISA_enter(visa=0x4918b8): algHandle = 0x4aac18
@71,961,555us: [+0 T:0x43c1d490] ti.sdo.ce.alg.Algorithm - Algorithm_activate> Enter(alg=0x4aac18)
@71,961,989us: [+0 T:0x43c1d490] ti.sdo.fc.rman - RMAN_activateAllResources> Enter (alg=0x43ec0000, resFxns=0x36b520, scratchGroupId=1)
@71,962,846us: [+0 T:0x43c1d490] ti.sdo.fc.rman - RMAN_activateAllResources> Exit (status=0)
@71,963,376us: [+0 T:0x43c1d490] ti.sdo.ce.alg.Algorithm - Algorithm_activate> Exit
@71,963,894us: [+5 T:0x43c1d490] CV - VISA_exit(visa=0x4918b8): algHandle = 0x4aac18
@71,964,219us: [+0 T:0x43c1d490] ti.sdo.ce.alg.Algorithm - Algorithm_deactivate> Enter(alg=0x4aac18)
@71,964,481us: [+0 T:0x43c1d490] ti.sdo.fc.rman - RMAN_deactivateAllResources> Enter (alg=0x43ec0000, resFxns=0x36b520, scratchGroupId=1)
@71,965,322us: [+2 T:0x40d8e490] ti.sdo.dmai - [Buffer] Set user pointer 0x40f3d000 (physical 0x8519e000)
@71,965,909us: [+0 T:0x43c1d490] ti.sdo.fc.rman - RMAN_deactivateAllResources> Exit (status=0)
@71,966,828us: [+0 T:0x43c1d490] ti.sdo.ce.alg.Algorithm - Algorithm_deactivate> Exit
@71,967,165us: [+0 T:0x43c1d490] ti.sdo.ce.video1.VIDENC1 - VIDENC1_process> Exit (handle=0x4918b8, retVal=0xffffffff)
@71,967,500us: [+2 T:0x43c1d490] ti.sdo.dmai - [Venc1] VIDENC1_process() ret -1 inId 0 outID 1073900884 generated 1073782284 bytes
@71,967,789us: [+7 T:0x43c1d490] ti.sdo.dmai - [Venc1] VIDENC1_process() failed with error (-1 ext: 0x8006)

 

ERROR ENUM:

typedef enum
{
    /*************************************************************************/
    /* Enumeration of all fatal and unsupported input error codes            */
    /*************************************************************************/
 
    /*H264VENC_TI_MIN_WIDTH <= maxWidth <= H264VENC_TI_MAX_WIDTH; else fatal */
    IH264VENC_ERR_MAXWIDTH =
        (0x1 << XDM_FATALERROR) + (0x1 << XDM_UNSUPPORTEDINPUT),
 
    /*H264VENC_TI_MIN_HEIGHT<=maxHeight<=H264VENC_TI_MAX_HEIGHT; else fatal */
    IH264VENC_ERR_MAXHEIGHT,
 
    /* XDM_DEFAULT <= encodingPreset <= XDM_USER_DEFINED; otherwise fatal  */
    IH264VENC_ERR_ENCODINGPRESET,
 
    /* 0 <= rateControlPreset <= IVIDEO_USER_DEFINED : otherwise fatal  */
    IH264VENC_ERR_RATECONTROLPRESET,
 
    /* 0 < maxFrameRate <= 30000 : otherwise fatal */
    IH264VENC_ERR_MAXFRAMERATE,
 
    /* 0 < maxBitRate <= 50000000 : otherwise fatal */
    IH264VENC_ERR_MAXBITRATE,
 
    /* dataEndianness shall be XDM_BYTE :otherwise  fatal  */
    IH264VENC_ERR_DATAENDIANNESS,
 
    /* inputChromaFormat shall be XDM_YUV_420SP/XDM_CHROMA_NA : else fatal */
    IH264VENC_ERR_INPUTCHROMAFORMAT,
 
    /* inputContentType to be IVIDEO_PROGRESSIVE/IVIDEO_INTERLACED:else fatal*/
    IH264VENC_ERR_INPUTCONTENTTYPE,
 
    /* reconChromaFormat shall be XDM_YUV_420SP/XDM_CHROMA_NA : else fatal */
    IH264VENC_ERR_RECONCHROMAFORMAT,
 
    /* H264VENC_TI_MIN_WIDTH <= inputWidth <= maxWidth; else fatal */
    IH264VENC_ERR_INPUTWIDTH,
 
    /* H264VENC_TI_MIN_HEIGHT <= inputWidth <= maxHeight; else fatal */
    IH264VENC_ERR_INPUTHEIGHT,
 
    /* number of MBs in frame exceeded limit : not supported and fatal */
    IH264VENC_ERR_MAX_MBS_IN_FRM_LIMIT_EXCEED,
 
    /* (0 < targetFrameRate <= maxFrameRate) and targetFrameRate shall be */
    /* multiple of 500; else fatal */
    IH264VENC_ERR_TARGETFRAMERATE,
 
    /* (0 < targetBitRate <= maxBitRate); else fatal */
    IH264VENC_ERR_TARGETBITRATE,
 
    /* profileIdc shall be 66(BP), 77(MP) or 100(HP):otherwise fatal */
    IH264VENC_ERR_PROFILEIDC,
 
    /* levelIdc shall be as in IH264VENC_Level enums: otherwise fatal */
    /* IH264VENC_LEVEL_51 is also not supported and fatal             */
    IH264VENC_ERR_LEVELIDC,
 
    /* Cabac entropyMode not supported in BP : fatal  */
    IH264VENC_ERR_ENTROPYMODE_IN_BP,
 
    /* transform8x8FlagIntraFrame supported only in HP, not BP or MP : fatal */
    IH264VENC_ERR_TRANSFORM8X8FLAGINTRA_IN_BP_MP,
 
    /* transform8x8FlagInterFrame supported only in HP, not BP or MP : fatal */
    IH264VENC_ERR_TRANSFORM8X8FLAGINTER_IN_BP_MP,
 
    /* seqScalingFlag supported only in HP, not BP or MP : fatal */
    IH264VENC_ERR_SEQSCALINGFLAG_IN_BP_MP,
 
    /* aspectRatioX < 0 not supported : fatal */
    IH264VENC_ERR_ASPECTRATIOX,
 
    /* aspectRatioY < 0 not supported : fatal */
    IH264VENC_ERR_ASPECTRATIOY,
 
    /* pixelRange shall be 0 or 1; Not supported othwerwise */
    IH264VENC_ERR_PIXELRANGE,
 
    /* timeScale<0 or (timeScale*1000<targetFrameRate) not supported,fatal */
    IH264VENC_ERR_TIMESCALE,
 
    /* numUnitsInTicks < 0 not supported : fatal */
    IH264VENC_ERR_NUMUNITSINTICKS,
 
    /* enableVUIparams shall be 0 or 1; Not supported otherwise */
    IH264VENC_ERR_ENABLEVUIPARAMS,
 
    /* resetHDVICPeveryFrame shall be 0 or 1; Not supported otherwise */
    IH264VENC_ERR_RESETHDVICPEVERYFRAME,
 
    /* meAlgo shall be 0 or 1; Not supported otherwise */
    IH264VENC_ERR_MEALGO,
 
    /* unrestrictedMV shall be 0 or 1; Not supported otherwise */
    IH264VENC_ERR_UNRESTRICTEDMV,
 
    /* encQuality shall be 0 or 1; Not supported otherwise */
    IH264VENC_ERR_ENCQUALITY,
 
    /* enableARM926Tcm shall be 0 or 1; Not supported otherwise */
    /* Also not supported if maxWidth > 1280 and enableARM926Tcm = 1 */
    IH264VENC_ERR_ENABLEARM926TCM,
 
    /* enableDDRbuff shall be 0 or 1; Not supported otherwise */
    IH264VENC_ERR_ENABLEDDRBUFF,
 
    /* sliceMode shall be 0,1,2 or 3; Not supported otherwise */
    IH264VENC_ERR_SLICEMODE,
 
    /* Output data mode shall be 0 or 1; Not supported otherwise */
    IH264VENC_ERR_OUTPUTDATAMODE,
 
    /* Slice format shall be 0 or 1; Not supported otherwise */
    IH264VENC_ERR_SLICEFORMAT,
 
    /* No matching level coressponding to input width, height, bitrate */
    /* and framerate in H264 standard : not supported and fatal.       */
    IH264VENC_ERR_LEVEL_NOT_FOUND,
 
    /* (refFrameRate != targetFrameRate) not supported : fatal */
    IH264VENC_ERR_REFFRAMERATE_MISMATCH,
 
    /* intraFrameInterval < 0 not supported : fatal */
    IH264VENC_ERR_INTRAFRAMEINTERVAL,
 
    /* (generateHeader < 0) || (generateHeader > 1) not supported : fatal */
    IH264VENC_ERR_GENERATEHEADER,
 
    /* forceFrame other than IVIDEO_NA_FRAME or IVIDEO_I_FRAME  or */
    /* IVIDEO_IDR_FRAME not supported : fatal */
    IH264VENC_ERR_FORCEFRAME,
 
    /* if rcPreset is IVIDEO_USER_DEFINED, rcAlgo shall be 0,1 or 2 */
    /* else not supported and fatal */
    IH264VENC_ERR_RCALGO,
 
    /* 0 <= intraFrameQP  <= 51; else not supported and fatal */
    IH264VENC_ERR_INTRAFRAMEQP,
 
    /* 0 <= interPFrameQP  <= 51; else not supported and fatal */
    IH264VENC_ERR_INTERPFRAMEQP,
 
    /* 0 <= rcQMax <= 51; else not supported and fatal */
    IH264VENC_ERR_RCQMAX,
 
    /* 0 <= rcQMin <= rcQMax; else not supported and fatal */
    IH264VENC_ERR_RCQMIN,
 
    /* 0 <= rcIQMax <= 51; else not supported and fatal */
    IH264VENC_ERR_RCIQMAX,
 
    /* 0 <= rcIQMin <= rcIQMax; else not supported and fatal */
    IH264VENC_ERR_RCIQMIN,
 
    /* 0 <= initQ <= 51; else not supported and fatal */
    IH264VENC_ERR_INITQ,
 
    /* 100 <= maxDelay < 10000; else not supported and fatal */
    IH264VENC_ERR_MAXDELAY,
 
    /* lfDisableIdc shall be 0,1 or 2; else not supported and fatal */
    IH264VENC_ERR_LFDISABLEIDC,
 
    /* enableBufSEI shall be 0 or 1; else not supported and fatal */
    IH264VENC_ERR_ENABLEBUFSEI,
 
    /* enablePicTimSEI shall be 0 or 1; else not supported and fatal */
    IH264VENC_ERR_ENABLEPICTIMSEI,
 
    /* sliceSize shall be atleast 1024; else not supported and fatal */
    IH264VENC_ERR_SLICESIZE,
 
    /* intraSliceNum shall be non-negative; else not supported and fatal */
    IH264VENC_ERR_INTRASLICENUM,
 
    /* airRate shall be non-negative; else not supported and fatal */
    IH264VENC_ERR_AIRRATE,
 
    /* meMultiPart shall be 0 or 1; else not supported and fatal */
    IH264VENC_ERR_MEMULTIPART,
 
    /* 0 <= intraThrQF <= 5; else not supported and fatal */
    IH264VENC_ERR_INTRATHRQF,
 
    /* perceptualRC shall be 0 or 1; else not supported and fatal */
    IH264VENC_ERR_PERCEPTUALRC,
 
    /* idrFrameInterval shall be non-negative; else not supported and fatal */
    IH264VENC_ERR_IDRFRAMEINTERVAL,
 
    /* mvSADoutFlag shall be 0 or 1; else not supported and fatal */
    IH264VENC_ERR_MVSADOUTFLAG,
 
    /* enableROI shall be 0 or 1; else not supported and fatal */
    IH264VENC_ERR_ENABLEROI,
 
    /* Pointer to putDataGetSpace function should be non zero value if*/
    /* outputDataMode chosen is IH264VENC_TI_SLICEMODE */
    IH264VENC_ERR_PUTDATAGETSPACEFUNC,
    /*************************************************************************/
    /* Enumeration of all fatal and unsupported param error codes            */
    /*************************************************************************/
 
    /* maxInterFrameInterval param not supported: fatal  */
    IH264VENC_ERR_MAXINTERFRAMEINTERVAL =
        (0x1 << XDM_FATALERROR) + (0x1 << XDM_UNSUPPORTEDPARAM),
 
    /* captureWidth to be 0 or >= inputWidth; otherwise not supported, fatal */
    IH264VENC_ERR_CAPTUREWIDTH,
 
    /* interFrameInterval shall be 0 or 1; otherwise not supported, fatal */
    IH264VENC_ERR_INTERFRAMEINTERVAL,
 
    /* mbDataFlag shall be 0; otherwise not supported, fatal */
    IH264VENC_ERR_MBDATAFLAG,
 
    /*************************************************************************/
    /* Enumeration of all fatal error codes                                  */
    /*************************************************************************/
    /* IVIDENC1_DynamicParams size not set correctly : fatal  */
    IH264VENC_ERR_IVIDENC1_DYNAMICPARAMS_SIZE_IN_CORRECT =
        (0x1 << XDM_FATALERROR),
 
    /* one or more of the arguments to process call is NULL : fatal  */
    IH264VENC_ERR_IVIDENC1_PROCESS_ARGS_NULL,
 
    /* inArgs->size is not equal to either baseparams or extnd params fatal  */
    IH264VENC_ERR_IVIDENC1_INARGS_SIZE,
 
    /* outArgs->size is not equal to either baseparams or extnd params fatal  */
    IH264VENC_ERR_IVIDENC1_OUTARGS_SIZE,
 
    /* inArgs->inputID is equal to 0 : fatal  */
    IH264VENC_ERR_IVIDENC1_INARGS_INPUTID,
 
    /* inArgs->topFieldFirstFlag is not set correctly : fatal  */
    IH264VENC_ERR_IVIDENC1_INARGS_TOPFIELDFIRSTFLAG,
 
    /* inBufs elements were not set correctly : fatal */
    IH264VENC_ERR_IVIDENC1_INBUFS,
 
    /* inBufs buffer descriptors were not set correctly : fatal */
    IH264VENC_ERR_IVIDENC1_INBUFS_BUFDESC,
 
    /* outBufs elements were not set correctly : fatal */
    IH264VENC_ERR_IVIDENC1_OUTBUFS,
 
    /* outBufs buffers are NULL */
    IH264VENC_ERR_IVIDENC1_OUTBUFS_NULL,
 
    /* In slice mode interface (low latency) mode, invalid */
    /* value supplied to numOutputDataUnits               */
    IH264VENC_ERR_IVIDENC1_INVALID_NUM_OUTDATA_UNIT,
 
    /* Interlace enabled for BASELINE_PROFILE */
    IH264VENC_ERR_INTERLACE_IN_BP,
 
    /* Reserved fatal error  */
    IH264VENC_ERR_RESERVED,
 
    /* insertUserData value is not set correctly */
    IH264VENC_ERR_INSERTUSERDATA,
 
    /* lengthUserData value is not set correctly */
    IH264VENC_ERR_LENGTHUSERDATA,
 
    /* numOfROI value is not set correctly */
    IH264VENC_ERR_ROIPARAM,
 
    /* fatal error in encode process call : fatal */
    IH264VENC_ERR_PROCESS_CALL,
 
    /* init/process/control/delete api called with NULL handle : fatal */
    IH264VENC_ERR_HANDLE_NULL,
 
    /* init/process/control/delete api called with incorrect handle : fatal */
    IH264VENC_ERR_INCORRECT_HANDLE,
 
    /* memtab null error in algInit/algFree : fatal */
    IH264VENC_ERR_MEMTAB_NULL,
 
    /* videncParams.size shall be either sizeof(IVIDENC1_Params) or  */
    /* sizeof(IH264VENC_Params) : otherwise it is a fatal error      */
    IH264VENC_ERR_IVIDENC1_INITPARAMS_SIZE,
 
    /* MemTab base pointers are NULL : fatal */
    IH264VENC_ERR_MEMTABS_BASE_NULL,
 
    /* MemTab base pointers not aligned to required sizes : fatal */
    IH264VENC_ERR_MEMTABS_BASE_NOT_ALIGNED,
 
    /* MemTabs size less than request size : fatal */
    IH264VENC_ERR_MEMTABS_SIZE,
 
    /* MemTabs attrs mismatch request value IALG_PERSIST/IALG_SCRATCH: fatal */
    IH264VENC_ERR_MEMTABS_ATTRS,
 
    /* MemTabs space mismatch request value IALG_EXTERNAL etc: fatal */
    IH264VENC_ERR_MEMTABS_SPACE,
 
    /* MemTabs are overlapping : fatal */
    IH264VENC_ERR_MEMTABS_OVERLAP,
 
    /* Fatal error if process/control api is called without prior activate() */
    IH264VENC_ERR_CODEC_INACTIVE,
 
    /*************************************************************************/
    /* Enumeration of unsupported input as warnings. Encoder would ignore    */
    /* the unsupported params and can continue process                       */
    /*************************************************************************/
    /* levelIdc not set correctly : not supported but not fatal */
    IH264VENC_WARN_LEVELIDC = (0x1 << XDM_UNSUPPORTEDINPUT),
 
    /*************************************************************************/
    /* Enumeration of unsupported param as warnings. Encoder would ignore    */
    /* the unsupported params and can continue process                       */
    /*************************************************************************/
 
    /* rateControlPreset not set correctly : not supported but not fatal */
    IH264VENC_WARN_RATECONTROLPRESET = (0x1 << XDM_UNSUPPORTEDPARAM),
 
    /* 0->Not in use, 1-> Generate Meta data, 2-> Use Metadata generated by other encoder*/
    IH264VENC_ERR_METADATAFLAG,
 
    /*************************************************************************/
    /* Enumeration of other benign errors                                    */
    /*************************************************************************/
    /* returned when videncStatus.data.buf is NULL in GETVERSION control call*/
    /* returned when videncStatus.data.bufSize is not sufficient for version */
    IH264VENC_ERR_STATUS_BUF = 0x1
 
}IH264VENC_STATUS;

 

  • The reported number of bytes decoded is undefined when an error is returned.  Arguably, the error statement shouldn't report it to avoid confusion like this.

    My best guess given the enum above is that 0x8006 is the "6th" element after the enum with value 0x8000 (which is (0x1 << XDM_FATALERROR)).  If I'm reading it right, this 6th element is:

    Peregrinus said:
    /* inBufs elements were not set correctly : fatal */
        IH264VENC_ERR_IVIDENC1_INBUFS,

    Perhaps you can sanity check the inBufs you're providing?  Maybe enabling CE_CHECK would turn up something malformed in the inBufs buffer descriptor?

    Chris

  • Hi Chris, 

      once again you are right. I was distracted by the huge size but the problem was in the buffer since the encoder was configured for a buffer of 720x288 but the buffer was 720x576. Now both encode and decode (and resizer)  are running perfectly. I found very useful the CE_CHECK since it provides all the relevant information for a possible error in few lines while the CE_DEBUG  outputs a lot of data.

    Thank you very much!!