Camera HAL setup with UVC camera


#1

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:


#2

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:
https://git.linaro.org/people/yongqin.liu/public/hardware/linaro/common.git (branch linaro-android)

You could give it a try.


Using usb camera
#3

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