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.

VIDENC1_process halt problem

Hello,

    I have some problems about MPEG4 encode process. The system is in av server structure and works fine after initiation with MPEG4 stream. But encode process will hang after ALG_vidEncSetFramerate() that calls ALG_vidEncSetDynamicParams() is executed. The hang point is fxns->process() in VIDENC1_process() that observed by enabling Codec Engine debug messages. The first time to execute VIDENC1_process() is works fine after calling ALG_vidEncSetDynamicParams(), but the system hangs in the second time to execute VIDENC1_process().

Following are the parameters of MPEG4 codec creating with indicated values:

create->width = 1280
create->height = 720
create->offsetH = 1280
create->offsetV = 736
create->rateControlType = ALG_VID_ENC_RATE_CONTROL_VBR

pObj->params.maxHeight = create->height;
pObj->params.maxWidth = create->width;
pObj->params.maxFrameRate = ALD_VID_ENC_MAX_FRAMERATE ;
pObj->params.maxBitRate = ALD_VID_ENC_MAX_BITRATE;
pObj->params.inputChromaFormat = XDM_YUV_420SP;
pObj->params.dataEndianness = XDM_BYTE;
pObj->params.maxInterFrameInterval = 1;
pObj->params.inputContentType = IVIDEO_PROGRESSIVE;
pObj->params.reconChromaFormat = XDM_YUV_420SP;

pObj->params.size = sizeof(IMP4VENC_Params);
pObj->params.encodingPreset = XDM_USER_DEFINED;
pObj->params.maxHeight = create->height;
pObj->params.maxWidth = (create->offsetH>create->width)?create->offsetH:create->width;
pObj->params_mpeg4.subWindowHeight = create->height;
pObj->params_mpeg4.subWindowWidth = create->width;
pObj->params_mpeg4.rotation = 0;
pObj->params_mpeg4.vbvSize = 0;
pObj->params_mpeg4.svhMode = 0;
pObj->params_mpeg4.IFrameBitRateBiasFactor = 256;
pObj->params_mpeg4.PFrameBitRateBiasFactor = 256;
pObj->params_mpeg4.peakBufWindow = 2;
pObj->params_mpeg4.minBitRate = 64000;
 pObj->params.rateControlPreset = IVIDEO_STORAGE;

Following are Codec Engine debug messages in CE_DEBUG=2 and there is no "Exit" after "Enter" of VIDENC1_process in the end:

@56,387,752us: [+0 T:0x44be8490] ti.sdo.ce.video1.VIDENC1 - VIDENC1_control> Enter (handle=0x5f07c8, id=5, dynParams=0x628480 (size=0x64), status=0x628554 (size=0x9c)
@56,387,914us: [+5 T:0x44be8490] CV - VISA_enter(visa=0x5f07c8): algHandle = 0x5f05a8
@56,388,019us: [+0 T:0x44be8490] ti.sdo.ce.alg.Algorithm - Algorithm_activate> Enter(alg=0x5f05a8)
@56,388,175us: [+0 T:0x44be8490] ti.sdo.ce.alg.Algorithm - Algorithm_activate> Exit
@56,388,297us: [+5 T:0x44be8490] CV - VISA_exit(visa=0x5f07c8): algHandle = 0x5f05a8
@56,388,404us: [+0 T:0x44be8490] ti.sdo.ce.alg.Algorithm - Algorithm_deactivate> Enter(alg=0x5f05a8)
@56,388,530us: [+0 T:0x44be8490] ti.sdo.ce.alg.Algorithm - Algorithm_deactivate> Exit
@56,388,626us: [+0 T:0x44be8490] ti.sdo.ce.video1.VIDENC1 - VIDENC1_control> Exit (handle=0x5f07c8, retVal=0x0)
@56,388,758us: [+0 T:0x44be8490] ti.sdo.ce.video1.VIDENC1 - VIDENC1_process> Enter (handle=0x5f07c8, inBufs=0x44be73f8, outBufs=0x44be76a8, inArgs=0x44be769c, outArgs=0x44be75e0)
@56,388,890us: [+5 T:0x44be8490] CV - VISA_enter(visa=0x5f07c8): algHandle = 0x5f05a8
@56,388,995us: [+0 T:0x44be8490] ti.sdo.ce.alg.Algorithm - Algorithm_activate> Enter(alg=0x5f05a8)
@56,389,139us: [+0 T:0x44be8490] ti.sdo.ce.alg.Algorithm - Algorithm_activate> Exit
@56,406,560us: [+5 T:0x44be8490] CV - VISA_exit(visa=0x5f07c8): algHandle = 0x5f05a8
@56,406,737us: [+0 T:0x44be8490] ti.sdo.ce.alg.Algorithm - Algorithm_deactivate> Enter(alg=0x5f05a8)
@56,406,897us: [+0 T:0x44be8490] ti.sdo.ce.alg.Algorithm - Algorithm_deactivate> Exit
@56,407,008us: [+0 T:0x44be8490] ti.sdo.ce.video1.VIDENC1 - VIDENC1_process> Exit (handle=0x5f07c8, retVal=0x0)
@56,407,333us: [+0 T:0x44be8490] ti.sdo.ce.image1.IMGENC1 - IMGENC1_control> Enter (handle=0x5f0690, id=1, dynParams=0x5f80d4 (size=0x20), status=0x5f80f4 (size=0xa0)
@56,407,516us: [+5 T:0x44be8490] CV - VISA_enter(visa=0x5f0690): algHandle = 0x628090
@56,407,638us: [+0 T:0x44be8490] ti.sdo.ce.alg.Algorithm - Algorithm_activate> Enter(alg=0x628090)
@56,407,780us: [+0 T:0x44be8490] ti.sdo.ce.alg.Algorithm - Algorithm_activate> Exit
@56,407,908us: [+5 T:0x44be8490] CV - VISA_exit(visa=0x5f0690): algHandle = 0x628090
@56,408,023us: [+0 T:0x44be8490] ti.sdo.ce.alg.Algorithm - Algorithm_deactivate> Enter(alg=0x628090)
@56,408,167us: [+0 T:0x44be8490] ti.sdo.ce.alg.Algorithm - Algorithm_deactivate> Exit
@56,408,282us: [+0 T:0x44be8490] ti.sdo.ce.image1.IMGENC1 - IMGENC1_control> Exit (handle=0x5f0690, retVal=0x0)
@56,408,395us: [+0 T:0x44be8490] ti.sdo.ce.image1.IMGENC1 - IMGENC1_control> Enter (handle=0x5f0690, id=5, dynParams=0x5f80d4 (size=0x20), status=0x5f80f4 (size=0xa0)
@56,408,520us: [+5 T:0x44be8490] CV - VISA_enter(visa=0x5f0690): algHandle = 0x628090
@56,408,663us: [+0 T:0x44be8490] ti.sdo.ce.alg.Algorithm - Algorithm_activate> Enter(alg=0x628090)
@56,408,804us: [+0 T:0x44be8490] ti.sdo.ce.alg.Algorithm - Algorithm_activate> Exit
@56,408,923us: [+5 T:0x44be8490] CV - VISA_exit(visa=0x5f0690): algHandle = 0x628090
@56,409,034us: [+0 T:0x44be8490] ti.sdo.ce.alg.Algorithm - Algorithm_deactivate> Enter(alg=0x628090)
@56,741,580us: [+0 T:0x44be8490] ti.sdo.ce.alg.Algorithm - Algorithm_deactivate> Exit
@56,741,730us: [+0 T:0x44be8490] ti.sdo.ce.image1.IMGENC1 - IMGENC1_control> Exit (handle=0x5f0690, retVal=0x0)
@56,741,882us: [+0 T:0x44be8490] ti.sdo.ce.image1.IMGENC1 - IMGENC1_process> Enter (handle=0x5f0690, inBufs=0x44be72e8, outBufs=0x44be7224, inArgs=0x44be73bc, outArgs=0x44be73ac)
@56,742,017us: [+5 T:0x44be8490] CV - VISA_enter(visa=0x5f0690): algHandle = 0x628090
@56,742,124us: [+0 T:0x44be8490] ti.sdo.ce.alg.Algorithm - Algorithm_activate> Enter(alg=0x628090)
@56,742,253us: [+0 T:0x44be8490] ti.sdo.ce.alg.Algorithm - Algorithm_activate> Exit
@56,746,982us: [+5 T:0x44be8490] CV - VISA_exit(visa=0x5f0690): algHandle = 0x628090
@56,747,151us: [+0 T:0x44be8490] ti.sdo.ce.alg.Algorithm - Algorithm_deactivate> Enter(alg=0x628090)
@56,747,304us: [+0 T:0x44be8490] ti.sdo.ce.alg.Algorithm - Algorithm_deactivate> Exit
@56,747,413us: [+0 T:0x44be8490] ti.sdo.ce.image1.IMGENC1 - IMGENC1_process> Exit (handle=0x5f0690, retVal=0x0)
@56,747,738us: [+0 T:0x44be8490] ti.sdo.ce.video1.VIDENC1 - VIDENC1_process> Enter (handle=0x5f07c8, inBufs=0x44be73f8, outBufs=0x44be76a8, inArgs=0x44be769c, outArgs=0x44be75e0)
@56,747,910us: [+5 T:0x44be8490] CV - VISA_enter(visa=0x5f07c8): algHandle = 0x5f05a8
@56,748,022us: [+0 T:0x44be8490] ti.sdo.ce.alg.Algorithm - Algorithm_activate> Enter(alg=0x5f05a8)
@56,748,183us: [+0 T:0x44be8490] ti.sdo.ce.alg.Algorithm - Algorithm_activate> Exit
MPEG4VideoStreamDiscreteFramer::afterGettingFrame1 frameize:71428

[System Information]

 DM368

 DVSDK_2_10_01_18

 codec_engine_2_24

 edma3_lld_1_06_00_01

 linux-2.6.18_pro500

  • The Linux app is simply waiting for a MSGQ message back from the remote server, containing the results of the VIDENC1_process() call.  It will sleep forever waiting for the message (which is just to say that there is no timeout).  In order to further assess what is happening in the system you will need to figure out what the remote server is doing (or, *not* doing).  The problem seems to lie with the remote code that gets invoked as a result of the ALG_vidEncSetDynamicParams() call.

    Can you hook up CCS and attach to the DSP?  This will be necessary to determine the issue.  The DSP might have "run into the weeds", or might be sitting in abort() due to an exception or assert.

    Regards,

    - Rob