Sony PlayStation Eye driver install instructions

From Tekkotsu Wiki

Jump to: navigation, search

Contents


In order to use the Sony PlayStation Eye webcam under Ubuntu 10.04 you must install a corrected version of the ov534 device driver or you will not be able to access essential camera options such as HFlip and VFlip. Cut and paste the commands below. These commands are designed to recompile the driver without having to recompile the entire kernel.

Installing the Driver

1. Upgrade to the latest kernel. Go to System > Administration > Update Manager and see if "kernel" or "linux-image" is listed as a pending update. If so, install that update. Or (better) just install all pending updates. Then reboot the machine.

2. Get the Linux kernel source and a video utility:

sudo -s
cd /usr/src
apt-get update
apt-get install -y kernel-package build-essential linux-source guvcview
tar --bzip2 -xvf linux-source-*.tar.bz2
ln -s `find . -type d -name "linux-source-*"` linux

3. Replace the driver source. This version of the driver has been patched to make videomode 4 (640x480 @ 60 fps) the default.

cd /usr/src/linux/drivers/media/video/gspca
mv ov534.c ov534.c.old
wget -N http://Chiara-Robot.org/download/ov534/src/ov534.c

4. Rebuild the driver modules ov534, gspca_ov534, and gspca-main:

cd /usr/src
cp -p linux-headers-$(uname -r)/Module.symvers linux

cd /usr/src/linux
make oldconfig
make modules_prepare
make SUBDIRS=drivers/media/video/gspca modules 

5. Install the new gspca_ov534 driver, which also requires replacing gspca_main:

cd /usr/src/linux
\cp -p drivers/media/video/gspca/gspca_main.ko /lib/modules/$(uname -r)/kernel/drivers/media/video/gspca
\cp -p drivers/media/video/gspca/gspca_ov534.ko /lib/modules/$(uname -r)/kernel/drivers/media/video/gspca

cd /lib/modules
depmod `uname -r`

6. Kill Tekkotsu if it's running. Unplug the camera. Remove the old drivers, then load the new ones:

modprobe -r gspca_ov534 gspca_main
modprobe gspca_ov534

The camera can deliver 320x240 pixel images at 125 frames per second, eliminating motion blur. (Note that by default Tekkotsu now uses 640x480 resolution.) In order to enable the high frame rate you can either patch the driver to make the default videomode be 16 instead of 4, or set it manually by:

modprobe -r gspca_ov534
modprobe gspca_ov534 videomode=16

A Bug

There appears to be a bug in the video driver system that causes the camera to initially come up as an audio device instead of a video device. You can check this by doing:

ls -l /dev/video*

If you see "audio 116,9" instead of "video 81,1" then the bug has struck, and the camera will not work properly with Tekkotsu. To correct the problem, do:

sudo modprobe -r gspca_ov534
sudo modprobe gspca_ov534

Note that if you unplug and replug the camera, the bug will trigger again and you will have to apply this fix again.

Testing

You can use guvcview to test the camera and display the frame rate:

apt-get -y install guvcview

guvcview -d /dev/video1 -p 1

Set the Light Frequency Filter to 60 Hz to achieve the full 125 frames per second.

Tip from colleagues at Brown University: use guvcview's graphical controls to adjust white balance and exposure balance as needed.

Video Modes

Available modes are:

00: 640x480@15
01: 640x480@30
02: 640x480@40
03: 640x480@50
04: 640x480@60
10: 320x240@30
11: 320x240@40
12: 320x240@50
13: 320x240@60
14: 320x240@75
15: 320x240@100
16: 320x240@125