Hello,
I try to use the function ASIStartExposure to make a snaphot,
ASI_SUCCESS is returned after the call but the exposure status stays ASI_EXP_IDLE.
Resulting a ASI_ERROR_TIMEOUT, when I call ASIGetDataAfterExp.
All the camera parameters are set to the default value and all automatic controls are disabled.
Is there a code example with the camera2 apk to do that? To try/compare with my code.
void test(int camres_x, int camres_y){
ASI_CAMERA_INFO asiCam;
ASI_CONTROL_CAPS acc;
ASI_ERROR_CODE aec;
ASI_EXPOSURE_STATUS exp_status=ASI_EXP_SUCCESS;
int nb_control, i;
unsigned char* image;
//open the camera
ASIGetCameraProperty(&asiCam, ASIGetNumOfConnectedCameras()-1);
ASIOpenCamera(asiCam.CameraID);
ASIInitCamera(asiCam.CameraID);
//set all the parameters to default/non automatic
ASIGetNumOfControls(asiCam.CameraID, &nb_control);
for(i=0; i<nb_control; i++){
ASIGetControlCaps(asiCam.CameraID, i, &acc);
if(acc.IsWritable)
aec=ASISetControlValue(asiCam.CameraID, acc.ControlType, acc.DefaultValue, ASI_FALSE);
}
//create a ROI of the image size at the top left corner
ASISetROIFormat(asiCam.CameraID, camres_x, camres_y, 0, ASI_IMG_RAW8);
ASISetStartPos(asiCam.CameraID, 0, 0);
//create memory for the image
image=(unsigned char*)malloc(camres_x*camres_y);
/*problematic part*/
aec=ASIStartExposure(asiCam.CameraID, ASI_FALSE);// here the funcion success
ASIGetExpStatus(asiCam.CameraID, &exp_status); // here the status is set to IDLE
while(exp_status==ASI_EXP_WORKING) //the loop is not reached
ASIGetExpStatus(asiCam.CameraID, &exp_status);
aec=ASIGetDataAfterExp(asiCam.CameraID, image, camres_x*camres_y);//the funcion return a time out
}
Edit: I have the same kind of error when I try the video mode, all the functions success expect the timeout when I want to get the image data.