Hello everyone
I want to use AEWB of TI
But My test program cause "Floating point exception" at TI AEWB (AEWB of Appro is good )
(i used 1.9 version of ipnc)
Here is GDB output
Program received signal SIGFPE, Arithmetic exception.
0x400362c8 in raise () from /lib/libpthread.so.0
(gdb) bt
#0 0x400362c8 in raise () from /lib/libpthread.so.0
#1 0x000b8658 in __div0 () at ../../gcc/config/arm/lib1funcs.asm:1128
#2 0x000b7480 in __divsi3 () at ../../gcc/config/arm/lib1funcs.asm:1022
#3 0x0002d134 in GET_AE_MEAN_VALUE (handle=0x1d3230, IAE_InArg=0x167b04,
WEIGHTING_MATRIX=0x1cf7d4 "\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205"..., rgbData=0x1d04f0) at ae_ti.c:90
#4 0x0002d804 in AE_TI_process (handle=0x1d3230, inArgs=0x167b04,
outArgs=0x167b34, rgbData=0x1d04f0,
weight=0x1cf7d4 "\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\20---Type <return> to continue, or q <return> to quit---
5\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205\205"..., customData=0x0) at ae_ti.c:204
#5 0x0000eebc in TI2AFunc ()
#6 0x0000f118 in ALG_aewbRun ()
#7 0x00000004 in ?? ()
#8 0x00000004 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
source of test is here
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include <osa_buf.h>
#include <drv_capture.h>
#include <alg_aewb.h>
#define DBG_INFO(fmt,args...) fprintf(stderr,"^[[32m[%s:%s:%d]^[[0m "fmt,__FILE__,__func__,__LINE__,##args)
#define DBG_ERR(fmt,args...) fprintf(stderr,"^[[31m^[[7m[%s:%s:%d]^[[0m "fmt,__FILE__,__func__,__LINE__,##args)
#define SENSOR_MODE DRV_IMGS_SENSOR_MODE_1280x720
#define TEST_WIDTH 1280
#define TEST_HEIGHT 720
#define FRAME_RATE 30
#define VIDEO_BUF_NUM 3
#define AEWB_MODE 3
// TI -> 2 , Appropho 1
#define AEWB_VENDOR 2
#define BUFFER_OFFSET 128
int main(int argc, char **argv)
{
int ret=0;
int count=0;
DRV_CaptureConfig captureConfig;
DRV_CaptureInfo captureInfo;
void *aewb;
ALG_AewbCreate createPrm;
ALG_AewbRunPrm runPrm;
ALG_AewbStatus aewbStatus;
int aewbBufId;
OSA_BufInfo *pBufInfo_aewb;
memset(&captureConfig,0,sizeof(DRV_CaptureConfig));
memset(&captureInfo,0,sizeof(DRV_CaptureInfo));
memset(&createPrm,0,sizeof(ALG_AewbCreate));
captureConfig.imgsConfig.sensorMode = SENSOR_MODE;
captureConfig.imgsConfig.fps = FRAME_RATE;
captureConfig.imgsConfig.binEnable = TRUE;
captureConfig.isifConfig.sensorMode = SENSOR_MODE;
captureConfig.isifConfig.vnfDemoCfg = FALSE;
captureConfig.isifConfig.alawEnable = FALSE;
captureConfig.isifConfig.dpcmEnable = FALSE;
captureConfig.isifConfig.numBuf = VIDEO_BUF_NUM;
captureConfig.h3aConfig.numBufAewb = VIDEO_BUF_NUM;
captureConfig.h3aConfig.numBufAf = VIDEO_BUF_NUM;
captureConfig.h3aConfig.sensorMode = SENSOR_MODE;
captureConfig.h3aConfig.aewbVendor = AEWB_VENDOR;
captureConfig.ipipeConfig.sensorMode = SENSOR_MODE;
captureConfig.ipipeConfig.vnfDemoCfg = FALSE;
captureConfig.ipipeConfig.inputSrc = DRV_IPIPE_INPUT_SRC_ISIF;
captureConfig.ipipeConfig.boxcarBlockSize = DRV_IPIPE_BOXCAR_BLOCK_SIZE_NONE;
captureConfig.ipipeConfig.histogramMode = DRV_IPIPE_HISTO_MODE_1_REGION ;
captureConfig.ipipeConfig.bscNumVectorsRow = 0;
captureConfig.ipipeConfig.bscNumVectorsCol = captureConfig.ipipeConfig.bscNumVectorsRow;
captureConfig.ipipeConfig.rszValidDataStartOffset = BUFFER_OFFSET;
captureConfig.ipipeConfig.rszOutConfig[0].enable = FALSE;
captureConfig.ipipeConfig.rszOutConfig[0].numBuf = 0;
captureConfig.ipipeConfig.rszOutConfig[1].enable = FALSE;
captureConfig.ipipeConfig.rszOutConfig[1].numBuf = 0;
captureConfig.ipipeConfig.rszOutConfig[0].enable = TRUE;
captureConfig.ipipeConfig.rszOutConfig[0].outFormat = DRV_DATA_FORMAT_YUV420;
captureConfig.ipipeConfig.rszOutConfig[0].width = TEST_WIDTH;
captureConfig.ipipeConfig.rszOutConfig[0].height = TEST_HEIGHT;
captureConfig.ipipeConfig.rszOutConfig[0].flipH = 0;
captureConfig.ipipeConfig.rszOutConfig[0].flipV = 0;
captureConfig.ipipeConfig.rszOutConfig[0].numBuf = VIDEO_BUF_NUM;
captureConfig.ipipeConfig.rszOutConfig[1].enable = TRUE;
captureConfig.ipipeConfig.rszOutConfig[1].outFormat = DRV_DATA_FORMAT_YUV420;
captureConfig.ipipeConfig.rszOutConfig[1].width = 720;
captureConfig.ipipeConfig.rszOutConfig[1].height = 480;
captureConfig.ipipeConfig.rszOutConfig[1].flipH = 0;
captureConfig.ipipeConfig.rszOutConfig[1].flipV = 0;
captureConfig.ipipeConfig.rszOutConfig[1].numBuf = VIDEO_BUF_NUM;
ret = DRV_init();
if( ret != OSA_SOK)
{
DBG_ERR("DRV_init Error\n");
return -1;
}
ret = ALG_sysInit();
if( ret != OSA_SOK)
{
DBG_ERR("DRV_init Error\n");
return -1;
}
ret = DRV_captureOpen(&captureConfig,&captureInfo);
if(ret != OSA_SOK)
{
DBG_ERR("DRV_captureOpen Error\n");
return -1;
}
else
DBG_INFO("DRV_captureOpen OK\n");
createPrm.algId = AEWB_VENDOR;
createPrm.sensorMode = DRV_IMGS_SENSOR_MODE_1280x720;
createPrm.pH3aInfo = &captureInfo.h3aInfo;
createPrm.vnfDemoCfg = FALSE;
createPrm.aewbType = AEWB_MODE;
createPrm.aewbVendor = AEWB_VENDOR;
createPrm.aewbPriority = 0;
aewb = ALG_aewbCreate(&createPrm);
if(aewb == NULL)
DBG_ERR("\n");
else
DBG_INFO("ALG_aewbCreate OK\n");
ret = DRV_captureStart(FALSE,TRUE);
if(ret != OSA_SOK)
{
DBG_ERR("DRV_captureStart Error\n");
return -1;
}
do
{
ret = DRV_h3aGetBuf(DRV_H3A_MOD_AEWB, &aewbBufId, OSA_TIMEOUT_FOREVER);
if(ret != OSA_SOK)
{
DBG_ERR("DRV_h3aGetBuf Error\n");
sleep(1);
continue;
}
pBufInfo_aewb = DRV_h3aGetBufInfo(DRV_H3A_MOD_AEWB, aewbBufId);
if(pBufInfo_aewb == NULL)
{
DBG_ERR("DRV_h3aGetBufInfo Error\n");
sleep(1);
continue;
}
runPrm.awbMode = ALG_AWB_MODE_INDOOR;
runPrm.aeMode = ALG_AE_MODE_DAY;
runPrm.videoMode = ALG_VIDEO_MODE_NTSC;
runPrm.autoAperture = FALSE;
runPrm.binMode = TRUE;
runPrm.sharpness = 0;
runPrm.contrast = 0;
runPrm.brightness = 0;
runPrm.backLight = 0;
runPrm.saturation = 0;
runPrm.h3aDataVirtAddr = pBufInfo_aewb->virtAddr;
runPrm.vnfDemoCfg = FALSE;
runPrm.aewbType = AEWB_MODE;
runPrm.aewbVendor = AEWB_VENDOR;
runPrm.aewbPriority = 0;
DBG_INFO("count %d start\n",count);
ret = ALG_aewbRun(aewb, &runPrm, &aewbStatus);
if(ret != OSA_SOK)
DBG_ERR("ALG_aewbRun Error\n");
DBG_INFO("count %d end\n",count);
ret = DRV_h3aPutBuf(DRV_H3A_MOD_AEWB, aewbBufId);
if(ret != OSA_SOK)
DBG_ERR("DRV_h3aPutBuf Error\n");
count ++;
}while(1);
return 0;
}
Addtional screen info is here
root@192.168.1.120:~/dm368# ./viotest
DRV_SyncRst: module = 47, domain = 0, state = 0
DRV_SyncRst: module = 47, domain = 0, state = 3
CLK Hz,
ARM Hz = 297000000
DDR Hz = 270000000
VPSS Hz = 270000000
IMCOP Hz = 270000000
DRV LDC: GetConfig 0004 0x0
CAPTURE: Opening imager MICRON_MT9P031_5MP.
SENSOR FPS VALUE = 30
CAPTURE: Opening ISIF.
CAPTURE: Opening H3A.
TI Setting Applied
H3A Settings,
AEWB Win Start H = 0
AEWB Win Start V = 2
AEWB Win Num H = 32
AEWB Win Num V = 12
AEWB Win Width = 40
AEWB Win Height = 60
AEWB Win Inc H = 6
AEWB Win Inc V = 6
AEWB Win Pixels/Color = 70
CAPTURE: Opening IPIPE.
[viotest.c:main:109] DRV_captureOpen OK
TI 2A Created
TI2A weight matrix: width = 32, height = 12
alg_aewb.c:ALG_aewbCreate:401 num 2
alg_aewb.c:ALG_aewbCreate:404 size 44
alg_aewb.c:ALG_aewbCreate:404 size 4068
alg_aewb.c:ALG_aewbCreate:420 num 2
alg_aewb.c:ALG_aewbCreate:423 size 44
alg_aewb.c:ALG_aewbCreate:423 size 4068
[viotest.c:main:124] ALG_aewbCreate OK
CAPTURE: Starting IPIPE.
CAPTURE: Starting ISIF.
CAPTURE: Starting imager.
CAPTURE: Starting H3A.
[viotest.c:main:167] count 0 start
[viotest.c:main:172] count 0 end
[viotest.c:main:167] count 1 start
[viotest.c:main:172] count 1 end
[viotest.c:main:167] count 2 start
[viotest.c:main:172] count 2 end
[viotest.c:main:167] count 3 start
[viotest.c:main:172] count 3 end
[viotest.c:main:167] count 4 start
[viotest.c:main:172] count 4 end
[viotest.c:main:167] count 5 start
Floating point exception
root@192.168.1.120:~/dm368#