TI中文支持网
TI专业的中文技术问题搜集分享网站

IPNC RDK DM8127 mcfw 中添加DSP算法报错问题,WaitStreamReady Fail. SemWait: Invalid Semaphore handler

大家好!

我在multich_tristream_fullfeature.c文件中新增了DSP算法,在Syslink中的处理流程如下,标红的link是我在源码的基础上新加的link:

merge link -> swosd link -> sclr link -> ipcm3out link -> dsp in link -> helloworld (dsp algorithm) -> dsp out link -> ipcm3 in link

另外,我在ti_vcam.c文件Vcam_start()函数中,添加了这些link的System_linkStart()代码。

程序运行起来,通过log可以看到link初始化都是成功的,就是运行到Init_StreamEnv->WaitStreamReady中报错,提示错误

"Error: WaitStreamReady Fail.

    Error: SemWait: Invalid Semaphore handler",

比较正常的运行的log发现正常情况下可以获得stream的码流60帧,添加了link后获得stream的码流为0。 烦请工程师提示一下解决思路,谢谢!


multich_tristream_fullfeature.c文件中的修改
Void MultiCh_createTriStreamFullFtr()
{
#ifdef HELLO_DSP_ONgVcamModuleContext.ipcFramesInDspId = SYSTEM_DSP_LINK_ID_IPC_FRAMES_IN_0;gVcamModuleContext.ipcFramesOutDspId = SYSTEM_DSP_LINK_ID_IPC_FRAMES_OUT_0;gVcamModuleContext.ipcHelloWorldId = SYSTEM_LINK_ID_HELLOWORLD_0;IpcFramesInLinkRTOS_CreateParams ipcInHWDspPrm;IpcFramesOutLinkRTOS_CreateParams ipcOutHWDspPrm;HelloWorldLink_CreateParams hwPrm;MULTICH_INIT_STRUCT(IpcFramesInLinkRTOS_CreateParams, ipcInHWDspPrm);MULTICH_INIT_STRUCT(IpcFramesOutLinkRTOS_CreateParams, ipcOutHWDspPrm);
#endif
.....
#ifdef HELLO_DSP_ON/* Scaler Link Params */SclrLink_CreateParams_Init(&sclrPrm);sclrPrm.inQueParams.prevLinkId= dupId[DIS_DUP_IDX];sclrPrm.inQueParams.prevLinkQueId= 0;sclrPrm.outQueParams.nextLink= ipcOutVpssId;sclrPrm.tilerEnable= FALSE;sclrPrm.enableLineSkipSc= FALSE;sclrPrm.inputFrameRate= 30;sclrPrm.outputFrameRate= 30;sclrPrm.scaleMode= DEI_SCALE_MODE_ABSOLUTE;sclrPrm.outScaleFactor.absoluteResolution.outWidth= 320;sclrPrm.outScaleFactor.absoluteResolution.outHeight  = 192;sclrPrm.outDataFormat = VF_YUV420SP_UV;sclrPrm.pathId = SCLR_LINK_SEC0_SC3;
#endif/* IPC Out VPSS link params */
#ifdef HELLO_DSP_ONipcOutVpssPrm.inQueParams.prevLinkId = gVcamModuleContext.sclrId[0];
#else
	ipcOutVpssPrm.inQueParams.prevLinkId = dupId[DIS_DUP_IDX];
#endifipcOutVpssPrm.inQueParams.prevLinkQueId = 0;ipcOutVpssPrm.numOutQue = 1;ipcOutVpssPrm.outQueParams[0].nextLink = ipcInVideoId;ipcOutVpssPrm.notifyNextLink = TRUE;ipcOutVpssPrm.notifyPrevLink = TRUE;ipcOutVpssPrm.noNotifyMode = FALSE;/* IPC In VIDEO params */ipcInVideoPrm.inQueParams.prevLinkId = ipcOutVpssId;ipcInVideoPrm.inQueParams.prevLinkQueId = 0;ipcInVideoPrm.numOutQue = 1;ipcInVideoPrm.outQueParams[0].nextLink = gVencModuleContext.encId;ipcInVideoPrm.notifyNextLink = TRUE;ipcInVideoPrm.notifyPrevLink = TRUE;ipcInVideoPrm.noNotifyMode = FALSE;

#ifdef HELLO_DSP_ONipcOutVpssPrm.outQueParams[0].nextLink= gVcamModuleContext.ipcFramesInDspId;/* IPC Frames In Link */ipcInHWDspPrm.baseCreateParams.inQueParams.prevLinkId= ipcOutVpssId;ipcInHWDspPrm.baseCreateParams.inQueParams.prevLinkQueId= 0;ipcInHWDspPrm.baseCreateParams.numOutQue= 1;ipcInHWDspPrm.baseCreateParams.outQueParams[0].nextLink= gVcamModuleContext.ipcHelloWorldId;ipcInHWDspPrm.baseCreateParams.notifyNextLink= TRUE;ipcInHWDspPrm.baseCreateParams.notifyPrevLink= TRUE;ipcInHWDspPrm.baseCreateParams.notifyProcessLink= FALSE;ipcInHWDspPrm.baseCreateParams.noNotifyMode= FALSE;ipcInHWDspPrm.baseCreateParams.inputFrameRate= 20;ipcInHWDspPrm.baseCreateParams.outputFrameRate= 20;/* HelloWorld DSP Algorithm for test*/HelloWorldLink_CreateParams_Init(&hwPrm);hwPrm.inQueParams.prevLinkId= gVcamModuleContext.ipcFramesInDspId;hwPrm.inQueParams.prevLinkQueId= 0;hwPrm.outQueParams.nextLink= gVcamModuleContext.ipcFramesOutDspId;/* IPC Frames Out Link */ipcOutHWDspPrm.baseCreateParams.inQueParams.prevLinkId= gVcamModuleContext.ipcHelloWorldId;ipcOutHWDspPrm.baseCreateParams.inQueParams.prevLinkQueId= 0;ipcOutHWDspPrm.baseCreateParams.numOutQue= 1;ipcOutHWDspPrm.baseCreateParams.outQueParams[0].nextLink= ipcInVideoId;ipcOutHWDspPrm.baseCreateParams.notifyNextLink= TRUE;ipcOutHWDspPrm.baseCreateParams.notifyPrevLink= TRUE;ipcOutHWDspPrm.baseCreateParams.noNotifyMode= FALSE;ipcInVideoPrm.inQueParams.prevLinkId= gVcamModuleContext.ipcFramesOutDspId;
#endif
.......
#ifdef HELLO_DSP_ONSystem_linkCreate(gVcamModuleContext.sclrId[0], &sclrPrm, sizeof(sclrPrm));System_linkCreate(gVcamModuleContext.ipcFramesInDspId, &ipcInHWDspPrm, sizeof(ipcInHWDspPrm));System_linkCreate(gVcamModuleContext.ipcHelloWorldId, &hwPrm, sizeof(hwPrm));System_linkCreate(gVcamModuleContext.ipcFramesOutDspId, &ipcOutHWDspPrm, sizeof(ipcOutHWDspPrm));
#endif
ti_vcam.c文件中的修改
Int32 Vcam_start()
{
#ifdef HELLO_DSP_ON/* start can happen in any order, except its recommended to start camera* Link the last */if (gVcamModuleContext.ipcHelloWorldId != SYSTEM_LINK_ID_INVALID){if (gVcamModuleContext.sclrId[0] != SYSTEM_LINK_ID_INVALID){System_linkStart(gVcamModuleContext.sclrId[0]);}if (gVcamModuleContext.ipcFramesInDspId != SYSTEM_LINK_ID_INVALID){System_linkStart(gVcamModuleContext.ipcFramesInDspId);}System_linkStart(gVcamModuleContext.ipcHelloWorldId);if (gVcamModuleContext.ipcFramesOutDspId != SYSTEM_LINK_ID_INVALID){System_linkStart(gVcamModuleContext.ipcFramesOutDspId);}}
#endif
....
}
Chris Meng:

你好,

你设计的chain有点问题。vpssm3采集的数据你给vidoem3拿去编码了。在你的设计中还有一路是video M3给DSP的,这不对吧。我认为你应该是在vpssM3上dup两路,一路给video M3,一路给DSP。在你的代码里面没有看到vpss M3 输出数据给DSP。

wei zhou7:

回复 Chris Meng:

您好,非常感谢您的回复!

现在我已经对multich_tristream_fullFeature.c文件做了修改,将源码中的va link(dsp) 替换成了alg algorithm link(dsp) 是可以运行的。

现在我想在DSP 算法中进行内存分配和调用,所以在alg algorithm link中我打开了SCD"AlgDspPrm.enableSCDAlg = TRUE;"但现在程序跑到scdLink_alg.c的AlgLink_ScdalgCreate函数中就锁死了。烦请指点一下,解决思路和方向。 谢谢! 

以下是打印的log信息和代码程序

打印的log信息:[host]********** FULL FEATURE USECASE ********[host] ********* Entered Tri Streaming usecase - H264 1080p @60fps + H264 D1 @30fps + MJPEG 1080p @5fps ********[m3vpss ] VPS_DCTRL_INST_0[m3vpss ] IOCTL_VPS_DCTRL_SET_VENC_OUTPUT SYSTEM_DC_VENC_DVO2[m3vpss ] IOCTL_VPS_DCTRL_SET_VENC_OUTPUT SYSTEM_DC_VENC_HDMI[m3vpss ] IOCTL_VPS_DCTRL_SET_VENC_OUTPUT SYSTEM_DC_VENC_SD[m3vpss ] IOCTL_VPS_DCTRL_SET_VENC_CLK_SRC VPS_DC_VENC_HDMI | VPS_DC_VENC_DVO2[host]167: MCFW: CPU Revision [ES2.1] !!![host]167: MCFW: Detected [UNKNOWN] Board !!![host]167: MCFW: Base Board Revision [REV A] !!![m3vpss ]12984: CAMERA: Create in progress !!![m3vpss ]12984: CAMERA: VIP0 PortA camera mode is [ 8-bit, Non-mux Embedded Sync] !!![m3vpss ]I2C2: DEV 0x27: ERROR !!![m3vpss ]I2C2: DEV 0x27:[m3vpss ] .........ar0331/src/issdrv_ar0331Api.c:Iss_Ar0331Create:310 !!![m3vpss ] .........ar0331/src/issdrv_ar0331Api.c:Iss_Ar0331AllocObj:1336 !!![m3vpss ] .........ar0331/src/issdrv_ar0331Api.c:Iss_Ar0331Lock:1273 !!![m3vpss ] .........ar0331/src/issdrv_ar0331Api.c:Iss_Ar0331Unlock:1302 !!![m3vpss ] .........ar0331/src/issdrv_ar0331Api.c:Iss_Ar0331Lock:1273 !!![m3vpss ] .........ar0331/src/issdrv_ar0331Api.c:Iss_Ar0331Unlock:1302 !!![m3vpss ]12986: CAMERA: VIP 0: VID DEC 268436737 (0x10): 8e131a98:ffff0000:8e133f4c, AUD_STATUS -1911334464[m3vpss ] Stream ID 0: chId = 0 VpsUtils_queCreate.[m3vpss ] Stream ID 1: chId = 0 VpsUtils_queCreate.[m3vpss ]13238: CAMERA: Create Done !!![m3vpss ]13345: CAMERA: Detect video in progress !!![m3vpss ]13346: CAMERA: Detect video Done !!![m3vpss ]13440: NSF: Create in progress !!![m3vpss ] NSF::HEAPID:0	USED:128[m3vpss ] NSF::HEAPID:1	USED:4928[m3vpss ]13562: NSF: Create Done !!![m3vpss ]13569: DUP: Create Done !!![m3vpss ]13577: DUP: Create Done !!![m3vpss ]13578: MERGE: Create Done !!![m3vpss ] DCC server task running[m3vpss ] {SWOSD} edma3Handle->tccVal = 36[m3vpss ] {SWOSD} edma3Handle->chId= 36[m3vpss ] {SWOSD} edma3Handle->tccVal = 37[m3vpss ] {SWOSD} edma3Handle->chId= 37[m3vpss ] {SWOSD} edma3Handle->tccVal = 38[m3vpss ] {SWOSD} edma3Handle->chId= 38[m3vpss ]13553: SWOSD: Create Done !!![m3vpss ]13654: DUP: Create Done !!![m3vpss ]13655: SCLR: Create in progress !!![m3vpss ]13661: SCLR: Loading Up-scaling Co-effs ...[m3vpss ]13661: SCLR: Co-effs Loading ... DONE !!![c6xdsp ]11382: IPC_FRAMES_IN: Create in progress !!![m3vpss ] SCLR:HEAPID:0	USED:64[c6xdsp ]11382: SYSTEM: Opening ListMP [VPSS-M3_IPC_OUT_23] ...[m3vpss ] SCLR:HEAPID:1	USED:5952[c6xdsp ]11383: SYSTEM: Opening ListMP [VPSS-M3_IPC_IN_23] ...[m3vpss ]13662: SCLR: Create Done !!![c6xdsp ]11384: SYSTEM: Opening MsgQ [VPSS-M3_MSGQ] ...[m3vpss ]13669: DUP: Create Done !!![c6xdsp ] IpcFramesInLink_setOutQueInfo: pObj->inQueInfo.queInfo[0].numCh = 1[m3vpss ]13670: IPC_FRAMES_OUT: Create in progress !!![c6xdsp ] IPC_FRAMES_IN:HEAPID:0	USED:304[m3vpss ]13673: IPC_FRAMES_OUT: Create Done !!![c6xdsp ]11386: IPC_FRAMES_IN: Create Done !!![c6xdsp ]11386: ALG : Create in progress !!![c6xdsp ]11398: SCD: Create in progress !!![c6xdsp ]11398: SCD: Max WxH = 352 x 288, Max CH = 0, FPS = 5 !!![c6xdsp ] > SCD: Algorithm memory requirements queried ::[c6xdsp ] >Processing Frame Resolution = 352x288[c6xdsp ] >Number of buffers = 11[c6xdsp ] >Number of channels supported = 0[c6xdsp ] >Persistent Internal Memory= 8952 bytes[c6xdsp ] >Persistent External Memory= 0 bytes[c6xdsp ] >Scratch Internal Memory= 61248 bytes
ApproDrvInit: 7
queue id:131076root@DM8127_IPNC:~#root@DM8127_IPNC:~#root@DM8127_IPNC:~# ApproDrvExit: 7
Error: WaitStreamReady Fail.
Error: SemWait: Invalid Semaphore handler修改的代码:
multich_tristream_fullFeature.c文件
Void MultiCh_createTriStreamFullFtr()
{
..........
#ifdef ALG_DSP_ONUInt32 AlgDspId = SYSTEM_LINK_ID_ALG_0;AlgLink_CreateParams AlgDspPrm;#endif
...........
#ifdef TEST_DSP_ONdupPrm[VA_DUP_IDX].inQueParams.prevLinkId = gVcamModuleContext.sclrId[0];dupPrm[VA_DUP_IDX].inQueParams.prevLinkQueId = 0;dupPrm[VA_DUP_IDX].numOutQue = 2;dupPrm[VA_DUP_IDX].outQueParams[0].nextLink = gVsysModuleContext.fdId;dupPrm[VA_DUP_IDX].outQueParams[1].nextLink = ipcFramesOutVpssId;dupPrm[VA_DUP_IDX].notifyNextLink = TRUE;/* IPC Frames Out VPSS for VA link params */ipcFramesOutVpssPrm.baseCreateParams.inQueParams.prevLinkId= dupId[VA_DUP_IDX];ipcFramesOutVpssPrm.baseCreateParams.inQueParams.prevLinkQueId= 1;ipcFramesOutVpssPrm.baseCreateParams.outQueParams[0].nextLink= ipcFramesInDspId;ipcFramesOutVpssPrm.baseCreateParams.numOutQue= 1;ipcFramesOutVpssPrm.baseCreateParams.processLink= SYSTEM_LINK_ID_INVALID;ipcFramesOutVpssPrm.baseCreateParams.inputFrameRate= 30;ipcFramesOutVpssPrm.baseCreateParams.outputFrameRate= 30;ipcFramesOutVpssPrm.baseCreateParams.notifyPrevLink= TRUE;ipcFramesOutVpssPrm.baseCreateParams.notifyNextLink= TRUE;ipcFramesOutVpssPrm.baseCreateParams.noNotifyMode= FALSE;ipcFramesOutVpssPrm.baseCreateParams.notifyProcessLink= FALSE;/* IPC Frames in DSP for VA link params */ipcFramesInDspPrm.baseCreateParams.inQueParams.prevLinkId = ipcFramesOutVpssId;ipcFramesInDspPrm.baseCreateParams.inQueParams.prevLinkQueId = 0;ipcFramesInDspPrm.baseCreateParams.numOutQue= 1;
#ifdef ALG_DSP_ONipcFramesInDspPrm.baseCreateParams.outQueParams[0].nextLink = AlgDspId;
#endifipcFramesInDspPrm.baseCreateParams.notifyPrevLink = TRUE;ipcFramesInDspPrm.baseCreateParams.notifyNextLink = TRUE;ipcFramesInDspPrm.baseCreateParams.noNotifyMode= FALSE;#ifdef ALG_DSP_ONAlgLink_CreateParams_Init(&AlgDspPrm);AlgDspPrm.inQueParams.prevLinkId = ipcFramesInDspId;AlgDspPrm.inQueParams.prevLinkQueId = 0;AlgDspPrm.enableSCDAlg = TRUE;
#endif
#endif
......
#ifdef TEST_DSP_ONSystem_linkCreate(dupId[VA_DUP_IDX], &dupPrm[VA_DUP_IDX], sizeof(dupPrm[VA_DUP_IDX]));System_linkCreate(ipcFramesOutVpssId, &ipcFramesOutVpssPrm, sizeof(ipcFramesOutVpssPrm));System_linkCreate(ipcFramesInDspId, &ipcFramesInDspPrm, sizeof(ipcFramesInDspPrm));
#ifdef ALG_DSP_ONSystem_linkCreate(AlgDspId, &AlgDspPrm, sizeof(AlgDspPrm));
#endif
#endif

赞(0)
未经允许不得转载:TI中文支持网 » IPNC RDK DM8127 mcfw 中添加DSP算法报错问题,WaitStreamReady Fail. SemWait: Invalid Semaphore handler
分享到: 更多 (0)