Error CameraService: connectHelper: Could not initialize client from HAL

cancel
Showing results for 
Search instead for 
Did you mean: 

Error CameraService: connectHelper: Could not initialize client from HAL

236 Views
Contributor II

I'm currently having trouble getting a valid image from my camera. I'm currently using Android 8, with a verified device driver (We've used this driver with a different IMX6 board/kernel in the past). When I try to open my camera application (also verified with old board/kernel) I get the following in logcat:

07-27 18:14:55.473 305 498 I Camera2ClientBase: Camera 0: Opened. Client: com.example.sampleapp (PID 2232, UID 10059)
07-27 18:14:55.478 289 1410 I FslCameraHAL: openDev:0: Opening camera device
07-27 18:14:55.478 289 1410 I FslCameraHAL: openDev
07-27 18:14:55.861 289 1410 I FslCameraHAL: setTemplate:0: Set ioctl_s_power (on=0)ting already constructed template type CAMERA3_TEMPLATE_PREVIEW(1)
07-27 18:14:55.861 289 1410 I FslCameraHAL: setTemplate:0: Setting already constructed template type CAMERA3_TEMPLATE_STILL_CAPTURE(2)
07-27 18:14:55.861 289 1410 I FslCameraHAL: setTemplate:0: Setting already constructed template type CAMERA3_TEMPLATE_VIDEO_RECORD(3)
07-27 18:14:55.861 289 1410 I FslCameraHAL: setTemplate:0: Setting already constructed template type CAMERA3_TEMPLATE_VIDEO_SNAPSHOT(4)
07-27 18:14:55.862 289 1410 I FslCameraHAL: setTemplate:0: Setting already constructed template type CAMERA3_TEMPLATE_ZERO_SHUTTER_LAG(5)
07-27 18:14:55.862 289 1410 I FslCameraHAL: setTemplate:0: Setting already constructed template type CAMERA3_TEMPLATE_MANUAL(6)
07-27 18:14:55.865 305 498 E Camera2-Parameters: generated preview size list is empty!!
07-27 18:14:55.865 305 498 E Camera2Client: initializeImpl: Camera 0: unable to build defaults: Invalid argument (-22)
07-27 18:14:55.865 305 498 E CameraService: connectHelper: Could not initialize client from HAL.
07-27 18:14:55.865 305 498 I Camera2Client: Camera 0: Closed
07-27 18:14:55.865 305 498 I Camera3-Device: disconnect: E
07-27 18:14:55.866 289 1410 I FslCameraHAL: closeDev:0: Closing camera device
07-27 18:14:55.866 289 1410 I FslCameraHAL: closeDev
07-27 18:14:55.866 289 491 I FslCameraHAL: state:0x204 can't go into stop state
07-27 18:14:55.869 305 498 I Camera3-Device: disconnect: X
07-27 18:14:55.869 305 496 I Camera3-Device: disconnect: E
07-27 18:14:55.872 305 498 I CameraService: disconnect: Disconnected client for camera 0 for PID 2232
07-27 18:14:55.872 305 498 I Camera2ClientBase: Closed Camera 0. Client was: com.example.sampleapp (PID 2232, UID 10059)
07-27 18:14:55.873 312 655 D NuPlayerDriver: reset(0xb43271c0) at state 4
07-27 18:14:55.873 312 655 D NuPlayerDriver: notifyListener_l(0xb43271c0), (8, 0, 0, -1), loop setting(0, 0)
07-27 18:14:55.873 312 2307 D NuPlayerDriver: notifyResetComplete(0xb43271c0)
07-27 18:14:55.874 312 374 D NuPlayerDriver: reset(0xb61a5310) at state 4
07-27 18:14:55.874 312 374 D NuPlayerDriver: notifyListener_l(0xb61a5310), (8, 0, 0, -1), loop setting(0, 0)
07-27 18:14:55.874 312 2309 D NuPlayerDriver: notifyResetComplete(0xb61a5310)
07-27 18:14:55.875 312 655 D NuPlayerDriver: reset(0xb61a5620) at state 4
07-27 18:14:55.875 312 655 D NuPlayerDriver: notifyListener_l(0xb61a5620), (8, 0, 0, -1), loop setting(0, 0)
07-27 18:14:55.876 312 2311 D NuPlayerDriver: notifyResetComplete(0xb61a5620)
07-27 18:14:55.877 2232 2232 W CameraBase: An error occurred while connecting to camera 0: Status(-8): '10: connectHelper:1399: Failed to initialize camera "0": No such device (-19)'



‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍
I have some simplified camera code which behaves the same it looks like this :
try{
 mCamera = Camera.open();
 Camera.Parameters params;
 params = mCamera.getParameters();
 params.setPreviewSize(1920,1080); mCamera.setPreviewDisplay(sSurfaceHolder); mCamera.startPreview();
 } catch(Exception up) {
 Log.e(TAG, "Camera didn't start! :" + up.getMessage());
 }

‍‍‍‍‍‍‍‍‍
I've also tried the native android camera application, which gives the same error. However, it tries to open the camera again by forcing some settings which does display an image. However the image is broken like so: 
IMG_20190809_205557.jpg
The image is supposed to be a test image (standard color bars) from the image sensor. It looks like the rows are all messed up. Which makes me believe the default camera app may be guessing at the row count? 
I've also checked all the mipi and ipu registers I thought were relevant. 
NUMBER OF ACTIVE DATA LANES 3
 PHY SHUTDOWN CONTROL 1
 PHY RESET 1
 CSI2 CONTROL RESET 1
 GENERAL SETTINGS FOR ALL BLOCKS 300
 DATA IDS FOR WHICH IDI REPORTS LINE BOUNDARY MATCHING ERRORS 0
 DATA IDS FOR WHICH IDI REPORTS LINE BOUNDARY MATCHING ERRORS 0
 ERROR STATE REGISTER 1 0
 ERROR STATE REGISTER 2 0
 MASKS FOR ERRORS 1 0
 MASKS FOR ERRORS 2 0
 D-PHY TEST INTERFACE CTRL 0 0
 D-PHY TEST INTERFACE CTRL 1 0
 IPU REGISTERS :
 CONFIGURATION OF IPU_CONF 10000660
 INTERUPT STATUS 1 IPU_INT_STAT_1 800000
 CSI0 DATA IDENTIFIER IPU1_CSI0_DI ffffff1e
 CSI0 SENSOR CONFIGURATION IPU1_CSI0_SENS_CONF 4008900
 CSI0 SENSE FRAME SIZE IPU1_CSI0_SENS_FRM_SIZE 437077f
 CSI0 ACTUAL FRAME SIZE IPU1_CSI0_ACT_FRM_SIZE 437077f

1E is the correct MIPI type, however is "ffffff1E" correct? Should it be "1E1E1E1E"? Or something else? The image is a 1920x1080@30 stream using 4 lanes. From what I can tell this is correct output from the Mipi and IPU registers.

My DTS file regarding the mipi looks like this : 

/{
 v4l2_cap_1 {
 compatible = "fsl,imx6q-v4l2-capture";
 ipu_id = <0>;
 csi_id = <0>;
 mclk_source = <0>;
 status = "okay";
 };
 v4l2_out {
 compatible = "fsl,mxc_v4l2_output";
 status = "okay";
 };
};

&mipi_csi {
 status = "okay";
 ipu_id = <0>;
 csi_id = <0>;
 v_channel = <0>;
 lanes = <4>;
};

I feel like something is missing in my kernel which is necessary for android to know the parameters of my camera. However, I can't seem to figure out what that is. I've read through and performed the actions in the "Debug steps for customer MIPI sensor" document, with no luck. Any help would be greatly appreciated!

Thanks, and please let me know if more information would be useful. 

Labels (3)
Tags (3)
0 Kudos
1 Reply

15 Views
NXP TechSupport
NXP TechSupport

Hello Anthony,

You are using MX6Q? the you have a none supported camera mode.

Regards

0 Kudos