RK3288     Android5.1   多个品牌USB摄像头

同一块主板和代码,大部分品牌的USB摄像头可以正常使用,只有某一款USB摄像头不能使用。

插上摄像头,底层可以识别到摄像头。

<>[ 47.479515] usb -1.4: new high-speed USB device number  using usb20_host
<>[ 47.696548] usb -1.4: New USB device found, idVendor=058f, idProduct=
<>[ 47.696719] usb -1.4: New USB device strings: Mfr=, Product=, SerialNumber=
<>[ 47.696825] usb -1.4: Product: PC Camera
<>[ 47.696908] usb -1.4: Manufacturer: Alcor Micro, Corp.
<>[ 47.708510] uvcvideo: Found UVC 1.00 device PC Camera (058f:)
<>[ 47.718236] input: PC Camera as /devices/ff540000.usb/usb3/-/-1.4/-1.4:1.0/input/input5

但是每次打开摄像头app都显示“无法连接到相机”,上层 log 如下。

D/CameraHal(  ): setParameters(): setParameters(): Set preview size 800x600
... ...
D/CameraHal( ): startPreview(): startPreview177:preview_w = ,preview_h = ,drv_w = ,drv_h =
D/CameraHal( ): cameraSetSize(): cameraSetSize():IN, w = ,h =
... ...
E/CameraHal( ): getFrame(): getFrame(): VIDIOC_DQBUF Failed!!! err[I/O error]
E/CameraHal( ): getFrame(): getFrame(): camera driver or device may be error, so notify CAMERA_MSG_ERROR

最后官方的回复如下:

USB摄像头800x600分辨率输出有问题,强制使用1280x960,同时保留1280x720为录像使用,由软件剪切到1280x720

diff --git a/CameraHal/CameraUSBAdapter.cpp b/CameraHal/CameraUSBAdapter.cpp
index b88dd17..adb446b
--- a/CameraHal/CameraUSBAdapter.cpp
+++ b/CameraHal/CameraUSBAdapter.cpp
@@ -, +, @@ void CameraUSBAdapter::initDefaultParameters(int camFd) params.set(KEY_PREVIEW_W_FORCE,"");
params.set(KEY_PREVIEW_H_FORCE,"");
- params.set(CameraParameters::KEY_SUPPORTED_PREVIEW_SIZES, parameterString.string());
- params.setPreviewSize(,);
+ params.set(CameraParameters::KEY_SUPPORTED_PREVIEW_SIZES, "1280x960,1280x720");
+ params.setPreviewSize(, );
/*picture size setting*/
params.set(CameraParameters::KEY_SUPPORTED_PICTURE_SIZES, parameterString.string());
params.setPictureSize(mCamDriverFrmWidthMax, mCamDriverFrmHeightMax);

按照官方的 patch 修改后,摄像头可以正常使用。

如果出现可以预览,不能拍照的问题,还需要更改拍照的分辨率

diff --git a/CameraHal/CameraUSBAdapter.cpp b/CameraHal/CameraUSBAdapter.cpp
index b88dd17..adb446b
--- a/CameraHal/CameraUSBAdapter.cpp
+++ b/CameraHal/CameraUSBAdapter.cpp
@@ -, +, @@ void CameraUSBAdapter::initDefaultParameters(int camFd) params.set(KEY_PREVIEW_W_FORCE,"");
params.set(KEY_PREVIEW_H_FORCE,"");
params.set(CameraParameters::KEY_SUPPORTED_PREVIEW_SIZES, "1280x960,1280x720");
params.setPreviewSize(, );
/*picture size setting*/
- params.set(CameraParameters::KEY_SUPPORTED_PICTURE_SIZES, parameterString.string());
- params.setPictureSize(mCamDriverFrmWidthMax, mCamDriverFrmHeightMax);
+ params.set(CameraParameters::KEY_SUPPORTED_PICTURE_SIZES, "1280x960,1280x720");
+ params.setPictureSize(, );

RK3288 USB UVC camera 摄像头 VIDIOC_DQBUF Failed!!! err[I/O error]的更多相关文章

  1. EasyPusher进行Android UVC外接摄像头直播推送实现方法

    最近EasyPusher针对UVC摄像头做了适配.我们结合了UVCCamera与EasyPusher,支持将UVC摄像头的视频推送到RTSP服务器上.在此特别感谢UVCCamera这个牛逼的项目! 来 ...

  2. 鏈接Redis報錯`AUTH` failed: ERR Client sent AUTH, but no password is set [tcp://127.0.0.1:6379]

    問題 鏈接Redis報錯`AUTH` failed: ERR Client sent AUTH, but no password is set [tcp://127.0.0.1:6379] 解決 啟動 ...

  3. 【err】开启Persistence-M模式-Check failed: err == CUBLAS_STATUS_SUCCESS (1 vs. 0) : Create cublas handle failed

    前言 安装好CUDA.CUDNN.NVIDIA driver之后,使用mxnet框架的时候出现该错误,本文记录该问题的解决方法. 环境 ubuntu 16.04 MxNet Cuda9.0 Nvidi ...

  4. 解决 AUTH` failed: ERR Client sent AUTH, but no password is set [tcp://127.0.0.1:6379]

    页面报错: ConnectionException In AbstractConnection.php line 155 AUTH` failed: ERR Client sent AUTH, but ...

  5. idea报错:error java compilation failed internal java compiler error

    idea下面报如下问题 error java compilation failed internal java compiler error 解决办法:Setting->Compiler-> ...

  6. idea Error:java: Compilation failed: internal java compiler error

    idea 遇到Error:java: Compilation failed: internal java compiler error 是提示说你当前使用的编译器jdk版本不对. 按住Ctrl+Alt ...

  7. Error:java:Compilation failed: internal java compiler error

    在IDEA中编译时出现这个错误:Error:java:Compilation failed: internal java compiler error! Information:Using javac ...

  8. Deployment failed due to an error in FastDev assembly synchronization.

    在编译的时候发生Assembly synchronization error,显示信息为:Deployment failed due to an error in FastDev assembly s ...

  9. iOS9 白名单问题 -canOpenURL: failed for URL: "xx" - error:"This app is not allowed to query for scheme xx"

    [iOS开发]-canOpenURL: failed for URL: "xx" - error:"This app is not allowed to query fo ...

随机推荐

  1. Mybatis Generator 扩展

    目标 修改Model的名称 修改Dao的名称 配置文件 context.targetRuntime 替换为自定义的类型 原理在:org.mybatis.generator.internal.Objec ...

  2. EBS Certifications

    Last Updated: September 29, 2017.  This summary cross-references published blog articles and the off ...

  3. oracle数据库简单的导入导出操作

    一.数据库导出 1.导出用户名/密码,,导出用户名为test_expdp.导出路径默认为oracle中的dpdump文件中 expdp test_expdp/test_expdp@orcl direc ...

  4. 【2018多校第一场】hdu6308-Time Zone(日期)

    Problem Description Chiaki often participates in international competitive programming contests. The ...

  5. 网关-zuul介绍 第一篇 网关解决的问题

    基于网关,我们可以实现 限流,认证,监控,路由 等功能,这样说,我们可能觉得很生硬,那我们反过来推一下, 假如没有网关会怎么样?1 :客户端需要访问多个后端服务,则前端得存储多个后端的地址(ip+po ...

  6. LeetCode OJ:Longest Increasing Subsequence(最长递增序列)

    Given an unsorted array of integers, find the length of longest increasing subsequence. For example, ...

  7. 【javascript基础】 原生JSON.parse解析异常问题

    [问题背景]用jQ,ajax返回json,返回的字符串如:{name:"suntiger035"},status:200,readyState:4,代码无任何问题,结果,succe ...

  8. C语言实现的矩阵乘法运算器

    需求 编写程序模拟矩阵乘法,一个m*n的矩阵,乘以一个 n*m 的矩阵, 并且输出结果. STEP 1  矩阵乘法的计算 一个m行n列的矩阵与一个n行p列的矩阵可以相乘,得到的结果是一个m行p列的矩阵 ...

  9. c# 自定义排序类(冒泡、选择、插入、希尔、快速、归并、堆排序等)

    using System; using System.Text; namespace HuaTong.General.Utility { /// <summary> /// 自定义排序类 ...

  10. postfix邮件服务器搭建03-webmail安装篇

    本文接着上文的安装进行,介绍另一个WebMail功能更加人性化的roundcube.当然也可以对已有的postfix邮件系统进行功能完善 1.下载安装roundcube cd /server/tool ...