AnsweredAssumed Answered

android6.0 camera driver for imx6

Question asked by jie jia on Feb 28, 2017
Latest reply on Mar 1, 2017 by igorpadykov

Hi,

   I have a board reference to imx6q-sabresd using android_M6.0.1_2.0.0_source.tar.gz.

   There is a 1080P camera connected  to CSI0. I have finish the camera driver in linux accordding to i.MX_6Dual6Quad_BSP_Porting_Guide.pdf.  

   I write the Gv7601Csi.cpp according to hardware/imx/mx6/libcamera3/Ov5640Csi.cpp.

 

  hardware/imx/mx6/libcamera3/camera.cpp:

  Camera* Camera::createCamera(int32_t id, char* name, int32_t facing, int32_t orientation, char* path)

    else if (strstr(name, "gv7601_camera")) {          //Add 
       ALOGI("create id:%d gv7601 camera device", id);
       device = new Gv7601Csi(id, facing, orientation, path);
     }

   

device/fsl/sabresd_6dq/init.i.MX6Q.rc:

# set back camera.
setprop back_camera_name gv7601_camera

 

 

root@sabresd_6dq:/ # logcat -s "FslCameraHAL"
--------- beginning of system
--------- beginning of main
01-01 00:00:05.903 213 213 I FslCameraHAL: void CameraHAL::enumSensorSet()
01-01 00:00:05.903 213 213 I FslCameraHAL: int32_t CameraHAL::matchDevNodes()
01-01 00:00:05.903 213 213 I FslCameraHAL: getNodeName: dev path:/dev/video0
01-01 00:00:05.920 213 213 I FslCameraHAL: getNodeName: node name:mxc_v4l2
01-01 00:00:05.924 213 213 I FslCameraHAL: getNodeNames: node name:mxc_v4l2,gv7601_camera
01-01 00:00:05.926 213 213 I FslCameraHAL: getNodeName: dev path:/dev/video1
01-01 00:00:05.940 213 213 W FslCameraHAL: int32_t CameraHAL::getNodeName(const char*, char*, size_t) open dev path:/dev/video1 failed:Try again
01-01 00:00:05.940 213 213 I FslCameraHAL: getNodeName: dev path:/dev/video16
01-01 00:00:05.940 213 213 W FslCameraHAL: int32_t CameraHAL::getNodeName(const char*, char*, size_t) open dev path:/dev/video16 failed:Permission denied
01-01 00:00:05.940 213 213 I FslCameraHAL: getNodeName: dev path:/dev/video17
01-01 00:00:05.940 213 213 W FslCameraHAL: int32_t CameraHAL::getNodeName(const char*, char*, size_t) dev path:/dev/video17 is not capture
01-01 00:00:05.940 213 213 I FslCameraHAL: matchPropertyName: index:0, gv7601_camera
01-01 00:00:05.940 213 213 I FslCameraHAL: index:0, propName:gv7601_camera
01-01 00:00:05.940 213 213 I FslCameraHAL: int32_t CameraHAL::matchNodeName(const char*, nodeSet*, int32_t)
01-01 00:00:05.940 213 213 I FslCameraHAL: matchNodeName: sensor:mxc_v4l2,gv7601_camera, dev:/dev/video0, node:gv7601_camera, index:0
01-01 00:00:05.940 213 213 I FslCameraHAL: Camera ID 0: name mxc_v4l2,gv7601_camera, Facing 0, orientation 0, dev path /dev/video0
01-01 00:00:05.941 213 213 I FslCameraHAL: matchPropertyName: index:1, 0
01-01 00:00:05.941 213 213 I FslCameraHAL: create id:0 gv7601 camera device
01-01 00:00:05.941 213 213 I FslCameraHAL: Camera::Camera(int32_t, int32_t, int32_t, char*):0: new camera device
01-01 00:00:05.941 213 213 I FslCameraHAL: camera number is 1
01-01 00:00:05.953 213 213 I FslCameraHAL: int CameraHAL::getCameraInfo(int, camera_info*): camera id 0: info=0xbeea6678
01-01 00:00:05.977 213 213 I FslCameraHAL: FrameDuration is 33331760, 30000000000
01-01 00:00:05.977 213 213 I FslCameraHAL: mMaxWidth:0, mMaxHeight:0
01-01 00:00:05.977 213 213 I FslCameraHAL: gv7601Csi, mFocalLength:3.370000, mPhysicalWidth:3.628800, mPhysicalHeight 2.721600
01-01 00:00:44.760 213 808 I FslCameraHAL: int32_t Camera::openDev(const hw_module_t*, hw_device_t**):0: Opening camera device
01-01 00:00:44.760 213 808 I FslCameraHAL: int32_t VideoStream::openDev(const char*)
01-01 00:00:44.791 213 808 I FslCameraHAL: int32_t Camera::closeDev():0: Closing camera device
01-01 00:00:44.791 213 808 I FslCameraHAL: int32_t VideoStream::closeDev()
01-01 00:00:44.791 213 277 I FslCameraHAL: state:0x201 can't go into stop state

 

There is a dialog:

Camera error

can't connect to the camera

 

Is there anything wrong?

 

Outcomes