HOWTO: Serval Performance (SERP2) webcam

I spent a little time this evening working on getting the built-in webcam of my Serval Performance (SERP2) to function under Ubuntu Hardy (8.04).

I found a driver for the webcam here: https://groups.google.com/group/microdia.

Instructions on downloading and building the driver follow. For more thorough instructions, I’d recommend looking at Testing the Microdia driver.

Since we’ll be compiling a kernel driver, you’ll need to install the kernel source files:

$ sudo apt-get install kernel-package linux-source build-essential exuberant-ctags

Next you’ll need to install git so we can download the driver’s source code:

$ sudo apt-get install git-core gitk git-gui git-doc curl

Now we’ll download the webcam driver:

$ git clone http://repo.or.cz/r/microdia.git

Let’s compile the kernel module (webcam driver):

$ cd microdia
$ make

Load the videodev kernel module so that /dev/video0 can be created:

$ sudo modprobe videodev

Now let’s load our new kernel driver:

$ sudo insmod ./microdia.ko

Check to see that the driver loaded successfully:

$ dmesg

You should see something like this at the bottom of the output:

[107348.616179] microdia: Microdia USB2.0 webcam driver startup
[107348.616563] microdia: Microdia USB2.0 Webcam - Product ID 624F.
[107348.616570] microdia: Release: 0100
[107348.616574] microdia: Number of interfaces : 1
[107348.623570] microdia: Microdia USB2.0 Camera is now controlling video device /dev/video0
[107348.623950] usbcore: registered new interface driver usb_microdia_driver

Now we can test the driver with VLC:

$ sudo apt-get install vlc
$ vlc v4l:// :v4l-vdev="/dev/video0" :v4l-adev="/dev/dsp" :v4l-norm=3 :v4l-frequency=-1

Make sure that /dev/video0 matches the device listed in the dmesg output above). You should see a window displaying the webcam video and the microphone should be active.

If all goes well, you may wish to install the kernel module/driver so that it will be loaded automatically each time you boot your computer.

Copy the driver to the kernel tree:

$ sudo cp microdia.ko /lib/modules/`uname -r`/kernel/drivers/media/video/usbvideo/

Now add the videodev and microdia drivers to your /etc/modules file so that they get loaded automatically every time you boot your computer:

$ sudo sh -c "echo videodev >> /etc/modules"
$ sudo sh -c "echo microdia >> /etc/modules"

The biggest hurdle that I see is that you’d have to recompile the driver each time the kernel is upgraded. System76 is working on packaging it up as a System76 driver that can be updated as new kernels are released, and so that users don’t have to compile kernel drivers themselves (’cause let’s face it, no one should have to learn to do that!).

Please note that I didn’t write the driver; I just discovered it this evening and got it running.

If you run into any problems, see the Microdia kernel driver site for more details from the driver developers themselves. There is also a thread on the Ubuntu Forums covering this topic.