Hi,
I am implementing DM365 TVP5158 -> CCDC-> Capture-> Display. Capture resolution is 720 x 576 PAL.
I am running it on a message thread so that I can add additional tasks later.
Currently I have modified the working IPIPE in accordance to my requirement. My capture and display thread uses only AVSERVER_bufputFull and AVSEREVER_bufGet Empty functions.
AVSERVER_bufGetNextTskInfo() is modified in the following way.
int AVSERVER_bufGetNextTskInfo(int tskId, int streamId, OSA_BufHndl **pBufHndl, OSA_TskHndl **pTskHndl)
{
VIDEO_CaptureStream *pCaptureStream=NULL;
VIDEO_EncodeStream *pEncodeStream=NULL;
VIDEO_DisplayStream *pDisplayStream=NULL;
int nextTskId;
*pTskHndl=NULL;
*pBufHndl=NULL;
if(streamId<0 || streamId >= AVSERVER_MAX_STREAMS) {
OSA_ERROR("Incorrect streamId (%d)\n", streamId);
return OSA_EFAIL;
}
/* if(tskId <=VIDEO_TSK_NONE || tskId >= VIDEO_TSK_STREAM) {
OSA_ERROR("Incorrect tskId (%d)\n", tskId);
return OSA_EFAIL;
}*/
if(tskId <= VIDEO_TSK_RESIZE) {
pCaptureStream = &gVIDEO_ctrl.captureStream[streamId];
pDisplayStream = &gVIDEO_ctrl.displayStream;
nextTskId = VIDEO_TSK_NONE;
if(tskId==VIDEO_TSK_CAPTURE) {
nextTskId = pCaptureStream->captureNextTsk;
}
if(nextTskId==VIDEO_TSK_NONE) {
*pBufHndl= &gVIDEO_ctrl.displayStream.bufDisplayIn;
*pTskHndl = &gVIDEO_ctrl.displayTsk;
//*pBufHndl = &pDisplayStream->bufDisplayIn;
//*pTskHndl = &pCaptureStream->displayCopyTsk;
// return OSA_EFAIL;
}
}
When I run the code I see that buffers not being allocated for CAPTURE OUT which is mainly because of AVSERVER_getemptybuf() function. Could anyone please look into it and let me know if anything more needs to be changed ? or some patch which does just capture and display but in threads. I have tried modifying for a real long time and stuck here right now.
Also, I was just checking of at least capture happens and to validate it I tried opening dumping the frame into a file using fwrite but it says " Read only filesystem". I have changed the folder permissions also but in vain!
Please anyone out there help me with this or let me know if I'm missing something!
Attached is the application log!
AVSERVER API: Creating TSKs...DONE SYSTEM.MSTPRI0 value changed to 00440011 CONFIGURING AVSERVER FOR DM365 ..... queue id:98307 AVSERVER API: Sending START. AVSERVER MAIN: Recevied CMD = 0x0400, state = 0x0000 AVSERVER MAIN: AVS[ 10.466752] mt9p031 1-0048: No MT9P031 chip detected, register read ffffff87 ERVER_tskConnectInit() ... *** WARNING FD: exceeded max input size for FD, disabling FD (current input 720x576)!!! AVSERVER MAIN: Create captureTsk ... Inside capture main function cmd = 0x300 CAPTURE: Recevied CMD = 0x0300 CAPTURE: Create... CAPTURE: Opening capture on imager TVP515X. SENSOR FPS VALUE = 25 Sensor Mode Info, Width = 704 Height = 288 fps = 25 Bin Enable = 0 Sensor Frame Timing Info, fps = 25 t_frame (ns) = 40000000.000000 t_row (ns) = 25062.500000 t_pclk (ns) = 15.625000 W = 704 H = 576 SW = 1595 SD = 0 HB = 450 VB = 1020 HBmin = 450 VBmin = 9 f_pclk = 64000000 shutterOverhead (ns) = 6656.250000 col_size = 703 row_size = 575 col_skip = 0 row_skip = 0 col_bin = 0 row_bin = 0 col_start = 8 row_start = 0 pll_M = 16 pll_N = 1 pll_DIV = 2 ######Imager Id Check succes Common Setting Applied CAPTURE: Create...DONE AVSERVER MAIN: Create displayTsk ... DISPLAY: Recevied CMD = 0x0300 DISPLAY: Create... prm->dstVirtAddr=1081470976, prm->copyWidth=720, prm->copyHeight=480, prm->dstOffsetH = 736, prm->dstoffsetV=480, prm->dstStartX=0,dstStartY=0,srcStartX=0,srcStartY=0 INvalid parameters passed DRV_DATA_FORMAT_YUV420 prm->dstVirtAddr=1083244544, prm->copyWidth=720, prm->copyHeight=480, prm->dstOffsetH = 736, prm->dstoffsetV=480, prm->dstStartX=0,dstStartY=0,srcStartX=0,srcStartY=0 INvalid parameters passed DRV_DATA_FORMAT_YUV420 prm->dstVirtAddr=1085374464, prm->copyWidth=720, prm->copyHeight=480, prm->dstOffsetH = 736, prm->dstoffsetV=480, prm->dstStartX=0,dstStartY=0,srcStartX=0,srcStartY=0 INvalid parameters passed DRV_DATA_FORMAT_YUV420 AVSERVER MAIN: Allocing Buffers ... AVSERVER MAIN: Allocating buffers ... ERROR (avServer.c|AVSERVER_bufGetEmpty|814): OSA_bufGetEmpty(1, 0, -1) ERROR (avServer.c|AVSERVER_bufGetEmpty|814): OSA_bufGetEmpty(1, 1, -1) AVSERVER MAIN: Assigning Display buffers: 3 of size 636032 bytes AVSERVER MAIN: Allocating buffers ...DONE AVSERVER MAIN: Start captureTsk ... CAPTURE: Start... DISPLAY: Create...DONE CAPTURE: Start...DONE AVSERVER MAIN: Start DONE AVSERVER API: Sending START...DONE mkdosfs 2.11 (12 Mar 2005) unable to get drive geometry, using default 255/63/dev/ram0 has 255 heads and 63 sectors per track, logical sector size is 512, using 0xf8 media descriptor, with 8192 sectors; file system has 2 12-bit FATs and 4 sectors per cluster. FAT size is 6 sectors, and provides 2036 clusters. Root directory contains 512 slots. Volume ID is 54168b32, no volume label. CAPTURE: Isif Buf 0 DRV_isisfGetOutBufinfo executed RAwbuf Vir address = 1122148352 Rawbufinfo != null Pbuf->Virtual address = 1081470976 displaycopytsk == tskid prm->copyWidth=0, prm->copyHeight=0,srcStartX=0,srcStartY=0 DISPLAY: Copying to Buf 0 (0, 0) prm->dstVirtAddr=1081470976, prm->copyWidth=720, prm->copyHeight=480, prm->dstOffsetH = 736, prm->dstoffsetV=480, prm->dstStartX=360,dstStartY=240,srcStartX=0,srcStartY=0 INvalid parameters passed ERROR (videoDisplayThr.c|VIDEO_displayCopyRun|83): DRV_frameCopy() dispaly copy run executed Inside file print OffsetH =736,OffserV = 576 error in opening file : Read-only file system [FILE ] Writing to file [IMG_0001.pgm] (1271808 bytes) ... ERROR AVServer_bufputfull executed DRV_isifbufoutbuf executed DISPLAY: Get Buf 0 DISPLAY: Get Buf 0 ERROR (drv_display.c|DRV_displayPutBuf|542): VIDIOC_QBUF CAPTURE: Isif Buf 1 DRV_isisfGetOutBufinfo executed RAwbuf Vir address = 1124208640 Rawbufinfo != null Pbuf->Virtual address = 1083244544 displaycopytsk == tskid prm->copyWidth=0, prm->copyHeight=0,srcStartX=0,srcStartY=0 DISPLAY: Copying to Buf 2 (0, 0) prm->dstVirtAddr=1085374464, prm->copyWidth=720, prm->copyHeight=480, prm->dstOffsetH = 736, prm->dstoffsetV=480, prm->dstStartX=360,dstStartY=240,srcStartX=0,srcStartY=0 INvalid parameters passed ERROR (videoDisplayThr.c|VIDEO_displayCopyRun|83): DRV_frameCopy() dispaly copy run executed Inside file print OffsetH =736,OffserV = 576 error in opening file : Read-only file system [FILE ] Writing to file [IMG_0001.pgm] (1271808 bytes) ... ERROR AVServer_bufputfull executed DISPLAY: Get Buf 1 DISPLAY: Get Buf 2 DRV_isifbufoutbuf executed DISPLAY: Put Buf 0 CAPTURE: Isif Buf 2 DRV_isisfGetOutBufinfo executed RAwbuf Vir address = 1126219776 Rawbufinfo != null Pbuf->Virtual address = 1085374464 displaycopytsk == tskid dispaly copy run executed Inside file print OffsetH =736,OffserV = 576 error in opening file : Read-only file system [FILE ] Writing to file [IMG_0001.pgm] (1271808 bytes) ... ERROR AVServer_bufputfull executed DISPLAY: Get Buf 2 ERROR (drv_display.c|DRV_displayPutBuf|542): VIDIOC_QBUF
Thanks & Regards,
Swathi