Enabling a USB Camera in Ubuntu 14.04

In theory, the USB camera should work as plug-in play, but I found when I upgraded to Ubuntu 14.04 that something was not working. This post assumes that your hardware is supportable with the uvcvideo driver. To start off, please confirm the following (In truth, there is more confirmation than actual work).

1. The USB Camera is recognized. The good old ‘dmesg’ should do the trick:

$ dmesg | grep -i usb

After digging in the output, found the following:

[ 1.774055] usb 2-3: new high-speed USB device number 3 using ehci-pci
[ 1.951988] usb 2-3: New USB device found, idVendor=056e, idProduct=700e
[ 1.951995] usb 2-3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 1.952000] usb 2-3: Product: UCAM-DLE300T series
[ 1.952004] usb 2-3: Manufacturer: ELECOM

Yup, there is my cheap USB camera.

2. That the uvcvideo driver is loaded

$ lsmod | grep uvcvideo
uvcvideo 80885 0
videobuf2_vmalloc 13216 1 uvcvideo
videobuf2_core 40664 1 uvcvideo
videodev 134688 2 uvcvideo,videobuf2_core

If nothing shows up, you can try loading it:

$ sudo modprobe uvcvideo

3. The device is actually recognized

The video should be under /dev, but the number may depend on how many devices you have hooked-up.

$ ls /dev/video*
/dev/video0

Only one for me.

4. Your user is in the video group.

This should be added by default, but just in case.

$ grep dave /etc/group | grep video
video:x:44:dave

If your user is not there, you can add if you have root permissions.

$ sudo usermod -a -G video $USER

 


 

So all should be well if you are up to here. Now for the crux of the problem. Take a look at the permissions of your ‘/dev/video*’.

$ ls -l /dev/video*
crw------- 1 root root 81, 0 May 6 00:58 /dev/video0

Hey, only root has access to this device! To resolve, we need two steps:

1. Change the group ownership to video

$ sudo chown root:video /dev/video0

2. Add read/write permissions for the group.

$ sudo chmod g+rw /dev/video0

Now that the permissions are corrected, take a deep breath and test (I use ‘mplayer’ for command line testing, but you can use ‘cheese’, ‘skype’, etc)

mplayer tv:// -tv driver=v4l2:width=640:height=480:device=/dev/video0 -fps 30

It’s about time.

When it comes to being lazy, I must say that it is something I take pride in. Why? Because all engineers are lazy. If we were not, no one would consider how we could use technology to make even easy tasks easier. Why go to the store when I can order of the web from my bath tub? I could write a letter, but email would be easier, and so forth.

I am writing this blog as an engineer living in Japan. I have been living in Japan for almost 10 years, and it has been an amazing experience. At the same time, I am also working as a System Administrator, which has also been a very interesting experience (when I am not under stress).

The purpose of this blog is two prong. For one, I would like to share my technical experience (or lack there of) as a way of giving back. I am a firm supporter of Open Software, and community has been one of the strongest methods in keeping technology safe, secure and open. As I have depended on a vast amount of web content, it is time to take part in the conversation as well. Second, I would like to share those crazy things that I see everyday living in Japan. They made me laugh, so I hope someone else might get a chuckle as well.

Let’s see how it goes…

Top