iMX8QM Android 9 Automotive UVC camera

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

iMX8QM Android 9 Automotive UVC camera

Jump to solution
5,056 Views
vinothkumars
Senior Contributor IV

Hi,

       I have a problem recently. I am using USB Camera with iMX8qm-mek board for Android 9 Automotive. USB camera is not detecting and usb camera using uvc driver. I checked the kernel side,

CONFIG_MEDIA_USB_SUPPORT=y

CONFIG_USB_VIDEO_CLASS=y

Thanks & Regards,

VinothS,

Regards,
Vinothkumar Sekar
1 Solution
4,332 Views
vinothkumars
Senior Contributor IV

Hi,

finally, I fixed this problem in the lib side,

vendor/nxp-opensource/imx/libcamera3/CameraHAL.cpp

configure this mCameraCount flag as 1 in handleCameraConnected function

Thanks & Regards,

VinothS,

Regards,
Vinothkumar Sekar

View solution in original post

0 Kudos
Reply
7 Replies
4,333 Views
vinothkumars
Senior Contributor IV

Hi,

finally, I fixed this problem in the lib side,

vendor/nxp-opensource/imx/libcamera3/CameraHAL.cpp

configure this mCameraCount flag as 1 in handleCameraConnected function

Thanks & Regards,

VinothS,

Regards,
Vinothkumar Sekar
0 Kudos
Reply
4,332 Views
vinothkumars
Senior Contributor IV

Hi,

I Unable to access the camera.

FslCameraHAL: getNodeName open dev path:/dev/video0 failed:No such file or directory

Do I have to give the permission to access the device ?

Thanks & Regards,

VinothS,

Regards,
Vinothkumar Sekar
0 Kudos
Reply
4,332 Views
vinothkumars
Senior Contributor IV

Hi,

Camera detected successfully. But. I got some of the following error

mek_8q:/ $ [ 43.526628] ci_hdrc ci_hdrc.0: EHCI Host Controller
[ 43.531563] ci_hdrc ci_hdrc.0: new USB bus registered, assigned bus number 1
[ 43.555484] ci_hdrc ci_hdrc.0: USB 2.0 started, EHCI 1.00
[ 43.561159] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[ 43.567966] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 43.575204] usb usb1: Product: EHCI Host Controller
[ 43.580094] usb usb1: Manufacturer: Linux 4.14.98-dirty ehci_hcd
[ 43.586117] usb usb1: SerialNumber: ci_hdrc.0
[ 43.593894] hub 1-0:1.0: USB hub found
[ 43.597698] hub 1-0:1.0: 1 port detected
[ 43.935478] usb 1-1: new high-speed USB device number 2 using ci_hdrc
[ 44.316106] usb 1-1: New USB device found, idVendor=046d, idProduct=0825
[ 44.322846] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=2
[ 44.330558] usb 1-1: SerialNumber: 06822680
[ 44.349241] uvcvideo: Found UVC 1.00 device <unnamed> (046d:0825)
[ 44.447420] uvcvideo 1-1:1.0: Entity type for entity Extension 4 was not initialized!
[ 44.455322] uvcvideo 1-1:1.0: Entity type for entity Extension 6 was not initialized!
[ 44.463208] uvcvideo 1-1:1.0: Entity type for entity Extension 7 was not initialized!
[ 44.471080] uvcvideo 1-1:1.0: Entity type for entity Processing 2 was not initialized!
[ 44.479020] uvcvideo 1-1:1.0: Entity type for entity Extension 3 was not initialized!
[ 44.486859] uvcvideo 1-1:1.0: Entity type for entity Camera 1 was not initialized!
[ 44.495945] input: UVC Camera (046d:0825) as /devices/platform/5b0d0000.usb/ci_hdrc.0/usb1/1-1/1-1:1.0/input/input2

130|mek_8q:/ $ ls -l /dev/video0
crw-rw---- 1 system camera 81, 2 2020-01-06 05:47 /dev/video0

and detect as video0.

Thanks & Regards,

VinothS,

Regards,
Vinothkumar Sekar
0 Kudos
Reply
4,332 Views
vinothkumars
Senior Contributor IV

Hi,

USB Camera is working with this predefined application (not in AOSP build). I don't how it is possible without kernel support for UVC - USB camera.

followed for predefined APK,

GitHub - jiangdongguo/AndroidUSBCamera: Universal UVCCamera library,supporting recording,pushing,etc... 

Thanks & Regardsm

VinothS,

Regards,
Vinothkumar Sekar
0 Kudos
Reply
4,332 Views
vinothkumars
Senior Contributor IV

Hi, I got following error from framework when I try to access the default camera application and application itself crashed.

# am start -a android.media.action.VIDEO_CAPTURE

mek_8q:/ # logcat | grep CameraService
01-02 09:22:54.863 1754 1754 E CameraService: cameraIdIntToStrLocked: input id 0 invalid: valid range (0, 0)
01-02 09:22:54.864 1754 1754 I CameraService: CameraService::connect call (PID -1 "com.android.camera2", camera ID ) for HAL version default and Camera API version 1
01-02 09:22:54.864 1754 1754 E CameraService: CameraService::connect X (PID 4114) rejected (invalid camera ID )

source/frameworks/av/services/camera/libcameraservice/CameraService.cpp

Thanks & Regards,

VinothS,

Regards,
Vinothkumar Sekar
0 Kudos
Reply
4,057 Views
shabna_m
Contributor III

@vinothkumars 

I have the same issue  to access camera. 

12-17 06:39:40.246 1465 1658 E CameraService: cameraIdIntToStrLocked: input id 0 invalid: valid range (0, 0)
12-17 06:39:40.246 1465 1658 I CameraService: CameraService::connect call (PID -1 "photo.android.hd.camera", camera ID ) for HAL version default and Camera API version 1
12-17 06:39:40.247 1465 1658 E CameraService: CameraService::connect X (PID 3468) rejected (invalid camera ID )

.....................................................................................................................

I am using the same target and android 9 auto version.

I got the /dev/video* nodes.

I set the front_camera and back_camera properties.

To debug, I am not getting logs from the HAL.

I confirmed camera.imx8.so is present at /vendor/lib64/hw.

and cameraserver is running as 

mek_8q:/ # ps -ef | grep camera
cameraserver  1438     1 0 06:44:43 ?     00:00:00 android.hardware.camera.provider@2.4-service
cameraserver  1465     1 0 06:44:44 ?     00:00:00 cameraserver

 

Could you please help me on why I am not getting any logs with FslCameraHAL tag?

Is there anything else I need to do for getting those logs for debugging.

0 Kudos
Reply
4,332 Views
diegoadrian
NXP Employee
NXP Employee

Hello,

Unfortunately, Android Auto is not supported by us. However, what I suggest is to add the following configuration in the init.rc.

setprop back_camera_name uvc

Unfortunately, this is as far as we could go.

Best regards,

Diego.