3558
- 收藏
- 点赞
- 分享
- 举报
hi3516cv300 USB HOST 适配UVC摄像头
本帖最后由 346793103 于 2019-8-1 12:51 编辑
硬件平台:HI3516CV300
内核版本:linux 3.18.20
SDK版本:Hi3516C_V300R001C01SPC030
问题描述:
想在Hi3516cv上面集成双路摄像头,一路mipi,一路采用USB HOST的方式挂载一个UVC的USB摄像头,在使用V4L2接口采集USB摄像头数据时,发现无法获取到数据。(NOTE:程序在虚拟机下运行可以抓取到USB摄像头数据)
下面我的操作步骤:
1、配置内核,使能USB UVC摄像头
[code]
Device Drivers —>
USB support —>
<*> EHCI HCD (USB 2.0) support
Improved Transaction Translator scheduling (NEW)
<*> Generic EHCI driver for a platform device
<*> OHCI HCD (USB 1.1) support
<*> Generic OHCI driver for a platform device
PHY Subsystem —>
<*> Hisilicon Inno USB2 PHY suppor
Device Drivers —>
<*> Multimedia support —>
Cameras/video grabbers support
Media Controller API
V4L2 sub-device userspace API
<*>Media USB Adapters —>
<*> USB Video Class (UVC)
UVC input events devices support
GSPCA based webcams
<*>V4L platform devices —>
<*> Soc camera support
<*> platform camera support
[/code]
2、添加USB UVC设备支持
因为在UVC中找不到我当前的摄像头,为了能够是被该摄像头,我在driver/media/usb/uvc/uvc_driver.c下面添加了摄像头的VID和PID信息
[code]
/* LogiLink Wireless Webcam */
{ .match_flags = USB_DEVICE_ID_MATCH_DEVICE
| USB_DEVICE_ID_MATCH_INT_INFO,
.idVendor = 0x058f,
.idProduct = 0x3841,
.bInterfaceClass = USB_CLASS_VIDEO,
.bInterfaceSubClass = 1,
.bInterfaceProtocol = 0,
.driver_info = UVC_QUIRK_RESTRICT_FRAME_RATE },
/* LogiLink Wireless Webcam */
{ .match_flags = USB_DEVICE_ID_MATCH_DEVICE
| USB_DEVICE_ID_MATCH_INT_INFO,
.idVendor = 0x1bcf,
.idProduct = 0x2283,
.bInterfaceClass = USB_CLASS_VIDEO,
.bInterfaceSubClass = 1,
.bInterfaceProtocol = 0,
.driver_info = UVC_QUIRK_RESTRICT_FRAME_RATE },
[/code]
添加完成后,编译uImage,下载到hi3516cv300开发板上
3、插上USB
插上USB后显示如下日志
[code]usb usb1-port1: unable to enumerate USB device
usb 2-1: new full-speed USB device number 5 using ohci-platform
usb 1-1: new high-speed USB device number 18 using ehci-platform
usb 1-1: device descriptor read/64, error -71
usb 1-1: device descriptor read/64, error -71
usb 1-1: new high-speed USB device number 19 using ehci-platform
usb 1-1: device descriptor read/64, error -71
usb 1-1: device descriptor read/64, error -71
usb 1-1: new high-speed USB device number 20 using ehci-platform
usb 1-1: device not accepting address 20, error -71
usb 1-1: new high-speed USB device number 21 using ehci-platform
usb 1-1: device not accepting address 21, error -71
usb usb1-port1: unable to enumerate USB device
usb 1-1: new high-speed USB device number 22 using ehci-platform
usb 1-1: device descriptor read/64, error -71
usb 1-1: device descriptor read/64, error -71
usb 1-1: new high-speed USB device number 23 using ehci-platform
usb 1-1: device descriptor read/64, error -71
usb 1-1: device descriptor read/64, error -71
usb 1-1: new high-speed USB device number 24 using ehci-platform
usb 1-1: device not accepting address 24, error -71
usb 1-1: new high-speed USB device number 25 using ehci-platform
usb 1-1: device not accepting address 25, error -71
usb usb1-port1: unable to enumerate USB device
usb 2-1: new full-speed USB device number 6 using ohci-platform
usb 2-1: not running at top speed; connect to a high speed hub
usb 2-1: New USB device found, idVendor=058f, idProduct=3841
usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
usb 2-1: Product: USB HD Camera audio
usb 2-1: Manufacturer: AlcorMicroCorp
uvcvideo: Found UVC 1.00 device USB HD Camera audio (058f:3841)
input: USB HD Camera audio as /devices/soc/10110000.ohci/usb2/2-1/2-1:1.0/input/input0[/code]
使用lsusb可以看到摄像头被加载了
[code]
/mnt # lsusb
Bus 002 Device 006: ID 058f:3841
Bus 001 Device 001: ID 1d6b:0002
Bus 002 Device 001: ID 1d6b:0001
/mnt # ls /dev/video0
/dev/video0
/mnt #
[/code]
然后运行编写v4l2程序,一直抓取不到数据。
[code]
/mnt # ./v4l2-video
Open /dev/video0 successfull
Driver Name:uvcvideo
Card Name:USB HD Camera audio
Bus info:usb-10110000.ohci-1
Driver Version:3.18.20
cap.capabilities:84000001
Start capture 100 frames
[/code]
硬件平台:HI3516CV300
内核版本:linux 3.18.20
SDK版本:Hi3516C_V300R001C01SPC030
问题描述:
想在Hi3516cv上面集成双路摄像头,一路mipi,一路采用USB HOST的方式挂载一个UVC的USB摄像头,在使用V4L2接口采集USB摄像头数据时,发现无法获取到数据。(NOTE:程序在虚拟机下运行可以抓取到USB摄像头数据)
下面我的操作步骤:
1、配置内核,使能USB UVC摄像头
[code]
Device Drivers —>
<*> EHCI HCD (USB 2.0) support
<*> Generic EHCI driver for a platform device
<*> OHCI HCD (USB 1.1) support
<*> Generic OHCI driver for a platform device
PHY Subsystem —>
<*> Hisilicon Inno USB2 PHY suppor
Device Drivers —>
<*> Multimedia support —>
<*>Media USB Adapters —>
<*> USB Video Class (UVC)
<*>V4L platform devices —>
<*> Soc camera support
<*> platform camera support
[/code]
2、添加USB UVC设备支持
因为在UVC中找不到我当前的摄像头,为了能够是被该摄像头,我在driver/media/usb/uvc/uvc_driver.c下面添加了摄像头的VID和PID信息
[code]
/* LogiLink Wireless Webcam */
{ .match_flags = USB_DEVICE_ID_MATCH_DEVICE
| USB_DEVICE_ID_MATCH_INT_INFO,
.idVendor = 0x058f,
.idProduct = 0x3841,
.bInterfaceClass = USB_CLASS_VIDEO,
.bInterfaceSubClass = 1,
.bInterfaceProtocol = 0,
.driver_info = UVC_QUIRK_RESTRICT_FRAME_RATE },
/* LogiLink Wireless Webcam */
{ .match_flags = USB_DEVICE_ID_MATCH_DEVICE
| USB_DEVICE_ID_MATCH_INT_INFO,
.idVendor = 0x1bcf,
.idProduct = 0x2283,
.bInterfaceClass = USB_CLASS_VIDEO,
.bInterfaceSubClass = 1,
.bInterfaceProtocol = 0,
.driver_info = UVC_QUIRK_RESTRICT_FRAME_RATE },
[/code]
添加完成后,编译uImage,下载到hi3516cv300开发板上
3、插上USB
插上USB后显示如下日志
[code]usb usb1-port1: unable to enumerate USB device
usb 2-1: new full-speed USB device number 5 using ohci-platform
usb 1-1: new high-speed USB device number 18 using ehci-platform
usb 1-1: device descriptor read/64, error -71
usb 1-1: device descriptor read/64, error -71
usb 1-1: new high-speed USB device number 19 using ehci-platform
usb 1-1: device descriptor read/64, error -71
usb 1-1: device descriptor read/64, error -71
usb 1-1: new high-speed USB device number 20 using ehci-platform
usb 1-1: device not accepting address 20, error -71
usb 1-1: new high-speed USB device number 21 using ehci-platform
usb 1-1: device not accepting address 21, error -71
usb usb1-port1: unable to enumerate USB device
usb 1-1: new high-speed USB device number 22 using ehci-platform
usb 1-1: device descriptor read/64, error -71
usb 1-1: device descriptor read/64, error -71
usb 1-1: new high-speed USB device number 23 using ehci-platform
usb 1-1: device descriptor read/64, error -71
usb 1-1: device descriptor read/64, error -71
usb 1-1: new high-speed USB device number 24 using ehci-platform
usb 1-1: device not accepting address 24, error -71
usb 1-1: new high-speed USB device number 25 using ehci-platform
usb 1-1: device not accepting address 25, error -71
usb usb1-port1: unable to enumerate USB device
usb 2-1: new full-speed USB device number 6 using ohci-platform
usb 2-1: not running at top speed; connect to a high speed hub
usb 2-1: New USB device found, idVendor=058f, idProduct=3841
usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
usb 2-1: Product: USB HD Camera audio
usb 2-1: Manufacturer: AlcorMicroCorp
uvcvideo: Found UVC 1.00 device USB HD Camera audio (058f:3841)
input: USB HD Camera audio as /devices/soc/10110000.ohci/usb2/2-1/2-1:1.0/input/input0[/code]
使用lsusb可以看到摄像头被加载了
[code]
/mnt # lsusb
Bus 002 Device 006: ID 058f:3841
Bus 001 Device 001: ID 1d6b:0002
Bus 002 Device 001: ID 1d6b:0001
/mnt # ls /dev/video0
/dev/video0
/mnt #
[/code]
然后运行编写v4l2程序,一直抓取不到数据。
[code]
/mnt # ./v4l2-video
Open /dev/video0 successfull
Driver Name:uvcvideo
Card Name:USB HD Camera audio
Bus info:usb-10110000.ohci-1
Driver Version:3.18.20
cap.capabilities:84000001
Start capture 100 frames
[/code]
文件: v4l2-video2.rar
下载
我来回答
回答12个
时间排序
认可量排序
认可0
认可0
认可0
认可0
认可0
认可0
认可0
认可0
认可0
认可0
认可0
认可0
或将文件直接拖到这里
悬赏:
E币
网盘
* 网盘链接:
* 提取码:
悬赏:
E币
Markdown 语法
- 加粗**内容**
- 斜体*内容*
- 删除线~~内容~~
- 引用> 引用内容
- 代码`代码`
- 代码块```编程语言↵代码```
- 链接[链接标题](url)
- 无序列表- 内容
- 有序列表1. 内容
- 缩进内容
- 图片![alt](url)
相关问答
-
2019-08-10 14:19:41
-
2019-01-03 16:27:35
-
2019-01-03 16:31:43
-
2019-08-12 11:39:19
-
2019-01-18 14:57:09
-
2020-07-14 17:37:44
-
2017-08-02 09:52:05
-
2017-07-24 17:39:18
-
2018-03-13 16:57:56
-
2021-12-14 11:59:58
-
2017-01-15 20:33:08
-
02019-07-04 16:21:06
-
2020-11-11 15:04:52
-
2020-11-11 17:10:43
-
2017-09-12 09:18:45
-
2017-09-15 18:13:33
-
2017-07-15 13:12:27
-
2017-04-08 22:51:36
-
2016-10-09 16:50:34
无更多相似问答 去提问
点击登录
-- 积分
-- E币
提问
—
收益
—
被采纳
—
我要提问
切换马甲
上一页
下一页
悬赏问答
-
5cat /dev/logmpp 报错 <3>[ vi] [func]:vi_send_frame_node [line]:99 [info]:vi pic queue is full!
-
50如何获取vpss chn的图像修改后发送至vo
-
5FPGA通过Bt1120传YUV422数据过来,vi接收不到数据——3516dv500
-
50SS928 运行PQtools 拼接 推到设备里有一半画面会异常
-
53536AV100的sample_vdec输出到CVBS显示
-
10海思板子mpp怎么在vi阶段改变视频数据尺寸
-
10HI3559AV100 多摄像头同步模式
-
9海思ss928单路摄像头vio中加入opencv处理并显示
-
10EB-RV1126-BC-191板子运行自己编码的程序
-
10求HI3519DV500_SDK_V2.0.1.1
举报反馈
举报类型
- 内容涉黄/赌/毒
- 内容侵权/抄袭
- 政治相关
- 涉嫌广告
- 侮辱谩骂
- 其他
详细说明
提醒
你的问题还没有最佳答案,是否结题,结题后将扣除20%的悬赏金
取消
确认
提醒
你的问题还没有最佳答案,是否结题,结题后将根据回答情况扣除相应悬赏金(1回答=1E币)
取消
确认