在我的笔记本上,我有一个USB摄像头,SD卡上运行32位Ubuntu 10.04,闪存上运行Android果冻豆。
Ubuntu不识别相机(甚至USB端口),因为它不提供任何电源,出于某种原因。如果我在USB端口和相机USB端口之间连接一根线,那么dmesg可以识别我的USB端口和相机。
然而,如果我取下SD卡,我的笔记本电脑启动Android JB。它也无法识别连接摄像头的USB端口。但是当我启动相机应用程序时,不知何故USB获得电源并开始工作!Android的摄像头服务在USB端口上有一些技巧。
有人知道这件事吗?
(如果可能的话,我在哪里可以找到包含相机应用程序执行的操作的源代码?)
编辑:这是当USB相机端口通过我连接的电线获得电源时的lsusb输出
$ lsusb
Bus 003 Device 002: ID 04d9:2ba0 Holtek Semiconductor, Inc.
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 013: ID 1e4e:0102
Bus 001 Device 004: ID 0bda:8176 Realtek Semiconductor Corp.
Bus 001 Device 002: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
这是正常的lsusb输出,没有识别USB相机/端口
$ lsusb
Bus 003 Device 002: ID 04d9:2ba0 Holtek Semiconductor, Inc.
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 004: ID 0bda:8176 Realtek Semiconductor Corp.
Bus 001 Device 002: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
当我连接电线时,这是dmesg。注意,它断开了,因为拿着电线不容易站着不动:P
$ dmesg | tail
[ 483.790202] uvcvideo: Found UVC 1.00 device USB2.0 Camera (1e4e:0102)
[ 483.797666] input: USB2.0 Camera as /devices/pci0000:00/0000:00:04.0/usb1/1-1/1-1:1.0/input/input4
[ 484.608278] usb 1-1: USB disconnect, device number 8
[ 486.123368] usb 1-1: new high speed USB device number 9 using ehci_hcd
[ 486.258975] usb 1-1: device descriptor read/all, error -71
[ 486.320237] hub 1-0:1.0: unable to enumerate USB device on port 1
[ 486.896696] usb 1-1: new high speed USB device number 11 using ehci_hcd
[ 487.040213] uvcvideo: Found UVC 1.00 device USB2.0 Camera (1e4e:0102)
[ 487.047682] input: USB2.0 Camera as /devices/pci0000:00/0000:00:04.0/usb1/1-1/1-1:1.0
/input/input5
[ 491.890035] usb 1-1: USB disconnect, device number 11
Camera的源代码可以在https://android.googlesource.com/platform/packages/apps/Camera/找到。