Lee Maguire graded snobberies, bawdiness, hypocrisy

Posted
8 May 2005
9pm

Category
Uncategorized

Using an EyeToy under Linux

Updated: see end of entry.

One thing that has impressed me with Gnome over the past year or so has been the improvement in the ease of setup of random peripherals. The fruits of “Project Utopia” (udev/Hal/DBUS) mean that plugging in most bits of hardware seems to do something very close to an approximation of “the right thing”.

Now, anyone used to using OS X isn’t going to be impressed – but, if you’ve just woken from a coma you fell into during a particularly long kernel recompile back in 1997 (as I did), trust me – you would be.

So when I look at the USB PS2 EyeToy camera I ask “What amount of faffing about will it take to use this with Linux?”. Ostensibly because I just want it to work, so that I can get on with my life/work, but secretly hoping that it’ll be just broken enough to provide some tiny intellectual challenge.

Sadly, it isn’t recognised as a webcam when plugging it into an the PC. It is picked up by the system, but it’s recognised as a USB audio device for some reason. However, when I select the tab in the Volume Control app, there are no sliders to adjust.

A little bit of research on the web reveals that the EyeToy uses the OmniVision OV519 chipset. While the stock kernel includes support for previous OmniVision webcams (ov511) these drivers are not usable with the OV519 chipset. However there is an experimental ov51x driver which supports the OV519. So that needs to be downloaded, untarred, and (assuming appropriate build packages are installed) compiled.

When the module is compiled, I ran “insmod ov51x” and the following was reported

Linux video capture interface: v1.00
ov51x.c: USB OV519 video device found
ov51x.c: Sensor is an OV7648
ov51x.c: Device at usb-0000:00:01.2-2 registered to minor 0
usbcore: registered new driver ov51x
ov51x.c: v1.65-1.11-mark : ov51x USB Camera Driver

EyeToy in Linux Device Manager window

The device /dev/video0 was magically created, so I duly launched
Camorama and got… nothing. D’oh.

Reading the FAQ I found that the difference between the OV519 and other, supported, webcams is that, rather than outputting a video stream, the OV519 outputs a series of JPEG images. I guess that makes sense for the EyeToy, which needs to quickly compare differences between “frames” in order for its motion tracking to work.  With a combination of fast USB and image decoding, such as on the PS2, it’ll look just like a video stream.

But, since almost all webcam apps use video4linux (which doesn’t support JPEG streams), there’s not very wide application support. A simple image grabbing app, “getjpeg”, is distributed with the ov51x source, so at the very least you can grab some images with it.

Fortunately Debian distributes the “gg” fork of gqcam which, as of January, includes support for JPEG webcams.

It’s not as featured as Camorama, but it does allow you to preview the video from the camera, freeze a frame and save it as an image. You need to select “JPEG” in the filter menu to see the image. Another issue is that it defaults to checking for a camera at “/dev/video” which wasn’t created on my system. This can be worked around by adding a line into /etc/udev/rules.d/local.rules


KERNEL="video0", SYMLINK="video"

webcam shot

UPDATE: Turns out someone has hacked JPEG decompression into a kernel module – and now the EyeToy works with Camorama! Viva HackerZ!