Webcam attached to Nexus 7

Update: Check for the latest version here

We managed to attach a USB webcam to a Nexus 7 and stream the content in a small app. This will be interesting for projects where stereo vision is involved. In theory two or even more cameras are possible. The Nexus 7 should also deliver enough power to make some real-time computer vision feasible. Stereo SLAM will definitely be an interesting thing to look into.

Howto

Required:

1. Plug in your Webcam to the Tablet

2. Start Terminal App and enter the following:

su
ls -l /dev/video0

This should give you root rights and show you the attached Webcam device node.

If you see something like “No such file or directory” then your Webcam is either not attached correctly or may not be supported.

3. Now enter the following to set the permissions for the device node:

chmod 666 /dev/video0

4. Start your Webcam App and see if it works.

The Downside to this approach is that as soon as the webcam is removed the device node disappears and the permissions have to be set again when the webcam is reattached.

More permanent methods would require a rule change in the ueventd.rc files.

Troubleshooting

1. Why does /dev/video0 not appear when i plug in the webcam ?

Check the output of dmesg and see if the webcam has been recognized. Type the following in the terminal app:

su
dmesg

What you should see among a lot of other output is this:

uvcvideo: Found UVC 1.00 device <unnamed> (046d:0807)
input: UVC Camera (046d:0807) as /devices/platform/tegra-ehci.0/usb2/2-1/2-1:1.0/input/input6

The 046d:0807 is the unique product and vendor ID of the camera that should be on the list of supported devices here. The ID shown is for Logitech and the C500.

Check if there are issues reported in connection with you camera. If you don’t see the above output altogether, your camera is likely not supported.