Platform: RK3288
OS: Android 6.0
Kernel: 3.10.92
Kernel层:
打开UVC的宏
编译下载插上usb camera开机之后应该会有类似如下log:
[ 3.612836] usb 3-1: New USB device found, idVendor=058f, idProduct=3822
[ 3.612857] usb 3-1: New USB device strings: Mfr=0, Product=2, SerialNumber=0
[ 3.612867] usb 3-1: Product: USB 2.0 HD Camera
[ 3.614985] uvcvideo: Found UVC 1.00 device USB 2.0 HD Camera (058f:3822)
[ 3.622648] input: USB 2.0 HD Camera as /devices/ff540000.usb/usb3/3-1/3-1:1.0/input/input3
查看设备是否注册成功:
shell@rk3288:/ $ ls /dev/video*
/dev/video0
/dev/video1
/dev/video_state
video0是CIF camera, video1就是UVC Camera了.
HAL层:
系统默认只支持1颗Camera, 所以第二颗即使驱动注册成功,上层也无法识别到,
因此修改如下:
这样就可以了!
01-01 12:03:15.420 216 578 D CameraHal: CameraHal(121): it is a uvc camera!
01-01 12:03:15.420 216 578 D CameraHal: Calling process is: com.android.camera2
01-01 12:03:15.465 216 578 D CameraHal: cameraCreate(374): Camera driver: uvcvideo Driver version: 3.10.0 CameraHal version: 1.55.2
01-01 12:03:15.465 216 578 D CameraHal: cameraCreate(381): mCamDriverSupportFmt: fmt = 1448695129,index = 0
01-01 12:03:15.465 216 578 D CameraHal: cameraCreate(419): cameraCreate(419):mCamDriverPreviewFmt(YUYV) is cameraHal and camera driver is also supported!!
01-01 12:03:15.465 216 578 D CameraHal: cameraCreate(421): mCamDriverPreviewFmt = 1448695129
01-01 12:03:15.465 216 578 D CameraHal: cameraCreate(427): cameraCreate(427): Current driver is uvcvideo, v4l2 memory is V4L2_MEMORY_MMAP
OS: Android 6.0
Kernel: 3.10.92
Kernel层:
打开UVC的宏
CONFIG_USB_VIDEO_CLASS=y
CONFIG_VIDEO_V4L2_SUBDEV_API=y
CONFIG_MEDIA_USB_SUPPORT=y
CONFIG_USB_VIDEO_CLASS=y
CONFIG_V4L_PLATFORM_DRIVERS=y
编译下载插上usb camera开机之后应该会有类似如下log:
[ 3.612836] usb 3-1: New USB device found, idVendor=058f, idProduct=3822
[ 3.612857] usb 3-1: New USB device strings: Mfr=0, Product=2, SerialNumber=0
[ 3.612867] usb 3-1: Product: USB 2.0 HD Camera
[ 3.614985] uvcvideo: Found UVC 1.00 device USB 2.0 HD Camera (058f:3822)
[ 3.622648] input: USB 2.0 HD Camera as /devices/ff540000.usb/usb3/3-1/3-1:1.0/input/input3
查看设备是否注册成功:
shell@rk3288:/ $ ls /dev/video*
/dev/video0
/dev/video1
/dev/video_state
video0是CIF camera, video1就是UVC Camera了.
HAL层:
系统默认只支持1颗Camera, 所以第二颗即使驱动注册成功,上层也无法识别到,
因此修改如下:
这样就可以了!
注意:
RK3288目前不支持高清类型的也就是说mjpeg数据格式的UVC Camera,需要用YUYV格式的.
最快的区分方法是查看HAL层log, code会读取数据格式并打印出来.01-01 12:03:15.420 216 578 D CameraHal: CameraHal(121): it is a uvc camera!
01-01 12:03:15.420 216 578 D CameraHal: Calling process is: com.android.camera2
01-01 12:03:15.465 216 578 D CameraHal: cameraCreate(374): Camera driver: uvcvideo Driver version: 3.10.0 CameraHal version: 1.55.2
01-01 12:03:15.465 216 578 D CameraHal: cameraCreate(381): mCamDriverSupportFmt: fmt = 1448695129,index = 0
01-01 12:03:15.465 216 578 D CameraHal: cameraCreate(419): cameraCreate(419):mCamDriverPreviewFmt(YUYV) is cameraHal and camera driver is also supported!!
01-01 12:03:15.465 216 578 D CameraHal: cameraCreate(421): mCamDriverPreviewFmt = 1448695129
01-01 12:03:15.465 216 578 D CameraHal: cameraCreate(427): cameraCreate(427): Current driver is uvcvideo, v4l2 memory is V4L2_MEMORY_MMAP