在使用tda2sx 时,想建立一个链路,其中有五路摄像头输入,一路输出,会转换成h.264视频文件并保存,想使用TI 实现的 AlgorithmLink_DmaSwMs link,但不大清楚怎么使用,比如,把五路输入通道号配置好,并且截取对应的图像数据,拷贝到输入的内存缓冲区里面去;
不清楚有没有这方面的例程可以参考,期望能够获得一个比较完整的例程,谢谢。
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.
好的,谢谢。
另外也说一下今天的进展:
尝试在原有的链路上,添加了algorithm_DmaSwMs 这个link,参数设置等,参考了
vsdk/apps/src/hlos/adas/src/usecases/src_calibration 里面的代码,编译可以通过,但运行的时候报错:
其中,line 338 和 line339是这样的:
status = System_linkCreate(pObj->Alg_DmaSwMsLinkID, &pObj->Alg_DmaSwMsPrm, sizeof(pObj->Alg_DmaSwMsPrm));
UTILS_assert(status == SYSTEM_LINK_STATUS_SOK);
所以,是在link创建的时候出错了,想了解一下,在参数配置的时候,是否也有一些需要注意的地方,谢谢。
status = System_linkCreate(pObj->Alg_DmaSwMsLinkID, &pObj->Alg_DmaSwMsPrm, sizeof(pObj->Alg_DmaSwMsPrm));
UTILS_assert(status == SYSTEM_LINK_STATUS_SOK);
我们认为这应该是配置问题,您能否分享SW 马赛克输入参数?
此外我们建议您可以在 VISION SDK \APPS\src\RTOS\ALG_plugins\dmaSwms\dmaSwMsLink_algPlugin.c 文件中引用 API AlgorithmLink_dmaSwMsCreate 来寻找创建失败的原因。
不清楚dmaswms 输入参数的含义,配置是按照另外一个文件中函数写的,略微做了些改动:
也想了解一下,有没有介绍 DmaSwMS Link使用的文档可以参考呢,谢谢了;
static Void desay_APA_SetAlgDmaSwMsPrm(
AlgorithmLink_DmaSwMsCreateParams *pPrm1,
//AlgorithmLink_DmaSwMsCreateParams *pPrm2,
UInt32 numLvdsCh,
UInt32 displayWidth,
UInt32 displayHeight
)
{
printf("enter %s, func %s, line %d \r\n",__FILE__, __FUNCTION__, __LINE__);
UInt32 winId;
AlgorithmLink_DmaSwMsLayoutWinInfo *pWinInfo;
UInt32 widthFactor, heightFactor;
//pPrm2->maxOutBufWidth = displayWidth;
//pPrm2->maxOutBufHeight = displayHeight * 2;
//pPrm2->numOutBuf = 4;
//pPrm2->useLocalEdma = FALSE;
pPrm1->maxOutBufWidth = displayWidth;
pPrm1->maxOutBufHeight = displayHeight * 2;
pPrm1->numOutBuf = 4;
pPrm1->useLocalEdma = FALSE;
//pPrm2->initLayoutParams.numWin = numLvdsCh / 2;
//pPrm2->initLayoutParams.outBufWidth = pPrm2->maxOutBufWidth;
//pPrm2->initLayoutParams.outBufHeight = pPrm2->maxOutBufHeight;
pPrm1->initLayoutParams.numWin = numLvdsCh / 2;// - pPrm2->initLayoutParams.numWin;
pPrm1->initLayoutParams.outBufWidth = pPrm1->maxOutBufWidth;
pPrm1->initLayoutParams.outBufHeight = pPrm1->maxOutBufHeight;
switch (numLvdsCh)
{
case 1:
widthFactor = 1;
heightFactor = 1;
pPrm1->initLayoutParams.numWin = 1;
// pPrm2->initLayoutParams.numWin = 0;
break;
case 2:
widthFactor = 1;
heightFactor = 1;
pPrm1->initLayoutParams.numWin = 1;
// pPrm2->initLayoutParams.numWin = 1;
break;
case 3:
widthFactor = 1;
heightFactor = 2;
pPrm1->initLayoutParams.numWin = 2;
// pPrm2->initLayoutParams.numWin = 1;
break;
case 4:
widthFactor = 1;
heightFactor = 2;
pPrm1->initLayoutParams.numWin = 2;
// pPrm2->initLayoutParams.numWin = 2;
break;
default:
widthFactor = 1;
heightFactor = 2;
pPrm1->initLayoutParams.numWin = 2;
// pPrm2->initLayoutParams.numWin = 2;
break;
}
/* assuming 4Ch LVDS and 2x2 layout */
for(winId=0; winId<pPrm1->initLayoutParams.numWin; winId++)
{
pWinInfo = &pPrm1->initLayoutParams.winInfo[winId];
pWinInfo->chId = winId;
pWinInfo->inStartX = 0;
pWinInfo->inStartY = 0;
pWinInfo->width =
SystemUtils_floor(pPrm1->initLayoutParams.outBufWidth/widthFactor, 16);
pWinInfo->height =
pPrm1->initLayoutParams.outBufHeight/heightFactor;
/* winId == 0 */
pWinInfo->outStartX = 0;
pWinInfo->outStartY = 0;
if(winId==1)
{
pWinInfo->outStartX = 0;
pWinInfo->outStartY = pWinInfo->height;
}
}
#if 0
for(winId=0; winId<pPrm2->initLayoutParams.numWin; winId++)
{
pWinInfo = &pPrm2->initLayoutParams.winInfo[winId];
pWinInfo->chId = winId;
pWinInfo->inStartX = 0;
pWinInfo->inStartY = 0;
pWinInfo->width =
SystemUtils_floor(pPrm2->initLayoutParams.outBufWidth/widthFactor, 16);
pWinInfo->height =
pPrm2->initLayoutParams.outBufHeight/heightFactor;
/* winId == 0 */
pWinInfo->outStartX = 0;
pWinInfo->outStartY = 0;
if(winId==1)
{
pWinInfo->outStartX = 0;
pWinInfo->outStartY = pWinInfo->height;
}
}
#endif
}
DMA 参数主要描述将不同图像放置在最终输出缓冲区中的方式和位置,如大小、位置等信息。
有没有介绍 DmaSwMS Link使用的文档可以参考呢,
目前不太确定是否有文档可供参考,我们建议您先参阅用户指南以及数据表。
以及关于创建失败位置,您是否有任何新的进展?
Hello, Cherry,
thanks for your kindly support.
acturally, this week I tried severy times to call algorithm_dmaSwMs link in HLOS side but failed. and the log printed in screen is: ALG: ERROR: No alg create function specified (algId = 0, max:28) !!!
after browsing the source code, I found that the function AlgorithmLink_DmaSwMs_initPlugin() hasn't been called. and the caller is AlgorithmLink_initAlgPlugins() function which located in " links_fw/src/hlos/links_a15/algorithm/algorithmLink_cfg.c ".
and I try to call the AlgorithmLink_DmaSwMs_initPlugin() in AlgorithmLink_initAlgPlugins() but failed again, the compiler told me that :
" algorithmLink_cfg.c:(.text+0x36): undefined reference to `AlgorithmLink_DmaSwMs_initPlugin' "
and after checking the source code, the header file included is
.. apps_xxx/include/alglink_api/algorithmLink_dmaSwMs.h
after that, I found this QA in TI website:
and in this page, the TI engineer wrote:
Hi,
There used to be a common header file (we think some system_cfg.h), which included defines macros for all algorithms. Can you please search for ALG_dmaSwMs and see if it is defined somewhere? If this is not defined, then DMA SW Ms will not be included in the build.
Hello, Cherry,
I've tried to re-edit the system_cfg.h file, but it seems that this file is auto genergated by shell script, i.e. it would like turn back to original file after I edited and saved it. and I found a little difficult to find the shell script which generated this system_cfg.h file. could you kindly point out the shell script file or something else to auto edit the system_cfg.h file? thanks in advance.
best rgds!
ohenry
Dear Cherry,
actually I've solve this issue by making a new dma mosaic link and putting it in ... links_fw/src/rtos/links_common path , now it works and produces the mosaiced images already. this link take reference on algorithm_dmaSwMS link develped by your colleagues.
and currently I wanna use the algorithm_dmaSwMS link in my project, since I guess it would run more fluently on the board.
anyway, thanks in advance and have a good time.
BR.
ohenry
I've tried to re-edit the system_cfg.h file, but it seems that this file is auto genergated by shell script, i.e. it would like turn back to original file after I edited and saved it. and I found a little difficult to find the shell script which generated this system_cfg.h file. could you kindly point out the shell script file or something else to auto edit the system_cfg.h file?
Actually this file is auto-generated depending on the algorithms selected for the usecase configuration.. What is the MAKECONFIG and MAKEAPPNAME you are using? Depending on the ALG_LIST, it generates this config header file. Can you please check if ALG_dmaSwMs is included in the ALG_LIST?
Dear Cherry,
currently this issue is solved, now ALG_dmaSwMs could run at ipu and dsp1 core now, and mosaic several images to one image.
Thanks for your kindly help and support and that make me feel I'm not fighting alone.
below is some tips for using rtos algorithm links in hlos side:
1,$(APPNAME)/configs/$(MAKECONFIG)/cfg.mk
set BUILD_ALGORITHMS=yes
2, $(APPNAME)/src/rtos/alg_plugins/Makefile
add : include $($(MAKEAPPNAME)_PATH)/src/rtos/alg_plugins/dmaSwMs/SRC_FILES.MK
3, build/Makefile
add: $(MAKE) -fMAKEFILE.MK -C$($(MAKEAPPNAME)_PATH)/src/rtos/alg_plugins $(TARGET)
then system_cfg.h would include "#define ALG_dmaSwMs"
thanks again and have a good night.
ohenry