Wednesday, April 17, 2013

[android help] About powering USB device on Linux: Android camera app recognizes USB camera but Ubuntu doesn't


On my notebook, I have a USB camera, 32-bit Ubuntu 10.04running on SD Card and Android Jelly Bean on flash memory.


Ubuntu doesn't recognize the camera (even the USB port), cause it doesn't offer any power supply to it, for some reason. If I connect a wire between a powered USB port and the camera USB port, then dmesg recognizes my the USB port and camera.


However, if I remove my SD Card, my laptop boots Android JB. It also doesn't recognize the USB port where the camera is connected. But as I launch the camera application, somehow the USB gets power supply and starts working! There is some trick on Android's camera service that powers the USB Port.


Does anyone know anything about this?


(If possible, where could I find the source code containing the operations executed by the camera app?)


EDIT:


This is the lsusb output when the USB camera port gets a power supply through the wire I connect



$ 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


Here is the normal lsusb output, without the USB camera/port being recognized



$ 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


This is dmesg when I connect the wire. Notice it disconnects cause it's not easy to stand still holding the wire :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


.

stackoverflow.comm

No comments:

Post a Comment

Google Voice on T-Mobile? [General]

Google Voice on T-Mobile? So I recently switched from a GNex on Verizon to a Moto X DE on T-Mobile. I had always used Google Voice for my v...