diff --git a/camera/QCamera2/stack/mm-camera-interface/src/mm_camera_interface.c b/camera/QCamera2/stack/mm-camera-interface/src/mm_camera_interface.c index 2d26c83..f955db3 100644 --- a/camera/QCamera2/stack/mm-camera-interface/src/mm_camera_interface.c +++ b/camera/QCamera2/stack/mm-camera-interface/src/mm_camera_interface.c @@ -1704,6 +1704,7 @@ void sort_camera_info(int num_cam) uint8_t get_num_of_cameras() { int rc = 0; + int i = 0; int dev_fd = -1; struct media_device_info mdev_info; int num_media_devices = 0; @@ -1782,7 +1783,15 @@ uint8_t get_num_of_cameras() cfg.cfgtype = CFG_SINIT_PROBE_WAIT_DONE; cfg.cfg.setting = NULL; if (ioctl(sd_fd, VIDIOC_MSM_SENSOR_INIT_CFG, &cfg) < 0) { - LOGE("failed"); + LOGI("failed...Camera Daemon may not up so try again"); + for(i = 0; i < MM_CAMERA_EVT_ENTRY_MAX; i++) { + if (ioctl(sd_fd, VIDIOC_MSM_SENSOR_INIT_CFG, &cfg) < 0) { + LOGI("failed...Camera Daemon may not up so try again"); + continue; + } + else + break; + } } close(sd_fd); dev_fd = -1;