Camera HAL setup with UVC camera

Hello, I’ve been trying to work with a usb camera on HiKey board.
After setting device drivers, I can see that UVC camera is attached with ‘/dev/video0’.

However, the camera application would keep return 0 for ‘getCameraIdList’.

https://source.android.com/devices/camera/
I followed the instruction here to setup the shared library for Camera HAL.
Even after I followed all the steps described, the camera application would still not recognize the camera. And when I modify ~/(aosp_dir)/device/linaro/hikey/camera/Android.mk and compile, there is no new system.img produced.

I understand that I’m not using the shared module ‘camera.usb.default’ correctly, but I’m a novice in this area and have no idea what I can do next.

If anybody have experiences with USB camera on Hikey, could you please guide me through this?

This is what I have in ~/(aosp_dir)/device/linaro/hikey/camera/Android.mk

Thanks in advance :slight_smile:

I think the missing piece here is the camera HAL implementation, bringing camera control to Android. In your case you need a V4L2 HAL implementation since the camera is exposed as a a V4L2 device (dev/video0). I don’t think there is any V4L2 HAL in the current android tree.
However I know that some people at Linaro have been working on:
yongqin.liu/public/hardware/linaro/common.git - Unnamed repository; edit this file 'description' to name the repository. (branch linaro-android)

You could give it a try.

1 Like

Thank you so much! That is exactly what I needed :smile:

Hello @WonnieK, @Loic

So with the linaro-android project, Camera2 APIs will work or per say getCameraIdList will return correct value ?
I need to enable WebRTC on Android N device, which need Camera/Camera2 APIs to work.

If you integrate the V4L2 camera HAL implementation, yes.