USB Camera mount and unmount, like Android
Hi. I would like to know what does Android (4.0.3) do to mount and unmount (basically offer power supply to it) camera when needed. If you do a lsusb on a terminal after booting, it says there is no camera at all. But when you launch the camera application, if you check lsusb again (and dmesg) it is mounted upon request. As soon as you close the application, it unmounts the camera, probably to save power.
Does anyone know anything about this Android trick to power devices just when it needs a specific device?
Why am I asking this:
On my single-board notebook, I have 32-bit Ubuntu 10.04 running on SD Card and Android 4.0.3 on flash memory.
Ubuntu doesn't recognize the camera, because apparently it doesn't offer any power supply to it (like Android, to save power). If I connect a wire between a powered USB port and the camera USB port, then it recognizes the camera, but if I disconect the wire, it unmounts.
If I remove the SD Card and reboot, then Android comes up. It also doesn't recognize the camera after boot. But as soon as I launch the camera application, somehow the USB gets powered and the camera is recognised.
(If possible, where could I find the source code containing the operations executed by the camera app?)
This is the lsusb output on Ubuntu when the USB camera port gets a power supply through the wire I connect
To identify your camera, with the camera unplugged, open a terminal and run this command: udevadm monitor. That will setup a monitor to watch for udev events.
Now plug in the camera. The mount event will identify the camera as a device.
You can do some research on writing udev rules, and write a rule to automount/umount the camera.
|All times are GMT -5. The time now is 04:40 PM.|