From d383bd95ab8d1065a04a0a04be5feb52cf007a3f Mon Sep 17 00:00:00 2001 From: Santhosh Kumar Thimmanna Bhattar Date: Tue, 26 Sep 2017 14:19:09 +0530 Subject: [PATCH] QCamera2: Increase camera daemon start timeout Issue: Camera is not launching for the first time as camera daemon is not up. Fix: Increase camera daemon start timeout Change-Id: I2dd8ae904145ad5c067b27014cdb95c28084accf --- .../stack/mm-camera-interface/src/mm_camera_interface.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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 f955db3..0ea823f 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 @@ -40,6 +40,8 @@ #define IOCTL_H #include IOCTL_H +#define EXTRA_ENTRY 6 + // Camera dependencies #include "mm_camera_dbg.h" #include "mm_camera_interface.h" @@ -1784,7 +1786,7 @@ uint8_t get_num_of_cameras() cfg.cfg.setting = NULL; if (ioctl(sd_fd, VIDIOC_MSM_SENSOR_INIT_CFG, &cfg) < 0) { LOGI("failed...Camera Daemon may not up so try again"); - for(i = 0; i < MM_CAMERA_EVT_ENTRY_MAX; i++) { + for(i = 0; i < (MM_CAMERA_EVT_ENTRY_MAX + EXTRA_ENTRY); i++) { if (ioctl(sd_fd, VIDIOC_MSM_SENSOR_INIT_CFG, &cfg) < 0) { LOGI("failed...Camera Daemon may not up so try again"); continue; @@ -1838,7 +1840,7 @@ uint8_t get_num_of_cameras() if(entity.type == MEDIA_ENT_T_DEVNODE_V4L && entity.group_id == QCAMERA_VNODE_GROUP_ID) { strlcpy(g_cam_ctrl.video_dev_name[num_cameras], entity.name, sizeof(entity.name)); - LOGI("dev_info[id=%d,name='%s']\n", + LOGE("dev_info[id=%d,name='%s']\n", (int)num_cameras, g_cam_ctrl.video_dev_name[num_cameras]); num_cameras++; break; @@ -1853,7 +1855,7 @@ uint8_t get_num_of_cameras() sort_camera_info(g_cam_ctrl.num_cam); /* unlock the mutex */ pthread_mutex_unlock(&g_intf_lock); - LOGI("num_cameras=%d\n", (int)g_cam_ctrl.num_cam); + LOGE("num_cameras=%d\n", (int)g_cam_ctrl.num_cam); return(uint8_t)g_cam_ctrl.num_cam; }