IPNC SDK3.8 RVM_DEMO_MODE UseCase

2015年1月5日 由 Creater 留言 »

.\ipnc_rdk\ipnc_mcfw\mcfw\src_bios6\links_c6xdsp\system\system_c6xdsp.c

Int32 System_init()中

 System_initLinks();

.\ipnc_rdk\ipnc_mcfw\mcfw\src_bios6\links_c6xdsp\system\System_c6xdsp.c

Void System_initLinks()中

 AlgLink_init();
VaLink_init();
NullLink_init();
MergeLink_init();
SelectLink_init();
RvmLink_init();

文件为.ipnc_rdk\ipnc_mcfw\mcfw\src_bios6\links_c6xdsp\rvm\rvmLink_tsk.c

Int32 RvmLink_init()中

 status = Utils_tskCreate(&pObj->tsk,
RvmLink_tskMain,
RVM_LINK_TSK_PRI,
gRvmLink_tskStack[rvmId],
RVM_LINK_TSK_STACK_SIZE, pObj, tskName);

文件为.ipnc_rdk\ipnc_mcfw\mcfw\src_bios6\links_c6xdsp\rvm\rvmLink_tsk.c

Void RvmLink_tskMain(struct Utils_TskHndl * pTsk, Utils_MsgHndl * pMsg)中

 /* create the rvm algorithm */
status = RvmLink_create(pObj, Utils_msgGetPrm(pMsg));

文件为.ipnc_rdk\ipnc_mcfw\mcfw\src_bios6\links_c6xdsp\rvm\rvmLink_tsk.c

在Int32 RvmLink_create(RvmLink_Obj * pObj, RvmLink_CreateParams * pPrm)中

/* Allocate LUT memory */
pObj->pLut = Utils_memAlloc(RVM_LINK_LUT_SIZE,32);
UTILS_assert(pObj->pLut != NULL);

/* Read LUT data into LUT memory */
//strcpy((char*)rvmLutPrm.fileName,"/mnt/mmc/lut_9j003_5mp_2nd.dat");
strcpy((char*)rvmLutPrm.fileName,"/mnt/mmc/lut_2560x1920.dat");
//strcpy((char*)rvmLutPrm.fileName,"/mnt/mmc/lut_2048x1152.dat");
//strcpy((char*)rvmLutPrm.fileName,"/mnt/mmc/RVM_lut.bin");
rvmLutPrm.lutBufAddr = (UInt32)pObj->pLut;
rvmLutPrm.lutBufSize = RVM_LINK_LUT_SIZE;

System_linkControl(SYSTEM_LINK_ID_HOST,
SYSTEM_COMMON_READ_RVM_LUT,
&rvmLutPrm,
sizeof(SystemCommon_rvmLutPrm),
TRUE);
UTILS_assert(rvmLutPrm.errorCode == 0); 

这个assert出错

[c6xdsp ]  5943: Assertion @ Line: 117 in links_c6xdsp/rvm/rvmLink_tsk.c: rvmLutPrm.errorCode == 0 : failed !!!

DSP使用System_linkControl发送了SYSTEM_COMMON_READ_RVM_LUT命令,由A8 HOST接受,以下为A8端代码
在文件:.\ipnc_rdk\ipnc_mcfw\mcfw\src_linux\mcfw_api\ti_vsys.c

Int32 Vsys_eventHandler(UInt32 eventId, Ptr pPrm, Ptr appData)
 case SYSTEM_COMMON_READ_RVM_LUT:
 pRvmLutPrm = (SystemCommon_rvmLutPrm*)pPrm;

 pRvmLutPrm->errorCode = 0;
 sdCardMounted = 0;

 memDevFd = open("/dev/mem",O_RDWR|O_SYNC);
 if(memDevFd < 0)
 {
 OSA_printf(" ERROR: /dev/mem open failed !!!\n");
 pRvmLutPrm->errorCode = -1;
 }
 else
 {
 /* Open LUT file and find the file size */
 FILE *fp = fopen(pRvmLutPrm->fileName,"rb");
 if(fp == NULL)
 {
 /* May be SD card is not mounted,try mounting it */
 if(system("mount -t vfat /dev/mmcblk0 /mnt/mmc\n") != 0)
 {
 OSA_printf(" ERROR: SD card mount failed !!!\n");
 pRvmLutPrm->errorCode = -1;
 }
 else
 {
 sdCardMounted = 1;
 fp = fopen(pRvmLutPrm->fileName,"rb");
 }
 }

 if(fp == NULL)
 {
 OSA_printf(" ERROR: LUT file open failed !!!\n");
 pRvmLutPrm->errorCode = -1;
 }
 else
 {
 /* Go to end of file */
 fseek(fp,0,SEEK_END);

 fileSize = ftell(fp);
 pRvmLutPrm->lutFileSize = fileSize;

 /* Go to beginning of file */
 fseek(fp,0,SEEK_SET);

 if(fileSize > pRvmLutPrm->lutBufSize)
 {
 OSA_printf(" ERROR: LUT buffer is insufficient !!!\n");
 pRvmLutPrm->errorCode = -1;
 }
 else
 {
 /* Map the LUT buffer */
 virtLutBufAddr = MMAP(pRvmLutPrm->lutBufAddr,fileSize);
 if(virtLutBufAddr == NULL)
 {
 OSA_printf(" ERROR: mmap of LUT buffer failed !!!\n");
 pRvmLutPrm->errorCode = -1;
 }
 else
 {
 /* Read LUT file into LUT buffer */
 if(fread(virtLutBufAddr,1,fileSize,fp) != fileSize)
 {
 OSA_printf(" ERROR: File read failed !!!\n");
 pRvmLutPrm->errorCode = -1;
 }
 else
 {
 Cache_wb((Ptr)virtLutBufAddr,fileSize,Cache_Type_ALL,TRUE);
 }

 /* Unmap the address space */
 MUNMAP((UInt32)virtLutBufAddr,fileSize);
 }
 }

 fclose(fp);
 }

 close(memDevFd); 

 if(sdCardMounted == 1)
 {
 /* Unmount SD card */
 system("umount /mnt/mmc\n");
 }
 }

 break;

其中由于打开文件

strcpy((char*)rvmLutPrm.fileName,"/mnt/mmc/lut_2560x1920.dat");失败,
同时加载SD卡,试图在SDK中寻找这个文件失败导致。
广告位

发表评论

你必须 登陆 方可发表评论.