Sony PlayStation Eye driver install instructions

From Tekkotsu Wiki

Jump to: navigation, search

Only for Ubuntu 10.04. Do not use for later releases.

For general information about the webcam, see the Sony PlayStation Eye Webcam page.


Important Notes

1. The driver is only for systems running Ubuntu 10.04. You do not need to install anything if you're running Ubuntu 12.04 or higher because they use newer drivers.

2. This corrected version of the Ubuntu 10.04 ov534 camera driver is required to access essential camera options such as HFlip, VFlip, and gain control. If you do not install this driver, you will still be able to get camera images, but on a CalliopeSP or Calliope2SP robot they will be upside-down.

3. Even if you've previously installed this driver, if you update your system software (via "apt-get dist-upgrade" or "update-manager") and receive a new release of the Linux kernel, the system will revert to the standard driver and you will have to follow these steps again. To check your kernel release, do "uname -r"; you will see a string such as 2.6.32-41-generic. If after an update the string changes to 2.6.32-42-generic, you will need to reinstall this driver.

Checking Your Driver Version

To see what version of the driver is currently installed, do:

modinfo gspca-ov534

You should see a description line that includes "Tekkotsu", e.g.,

description:    GSPCA/OV534 USB Camera Driver(kaswy mod for MT use V0.5 / bear24rw patch V0.1) / ebrahimi patch V0.1 + Tekkotsu

If you don't see this, then you are running the standard driver, not the modified one, and you will need to follow the install procedure below to get the modified driver required by Tekkotsu.

Installing the Driver

The instructions below will guide you through replacing the standard OV534 device driver with a better one, and installing it into your running kernel. Cut and paste them into a shell. Do not try to type them in by hand because a simple mistake could cause you grief.

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. Better yet, 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 build-essential kernel-package linux-source guvcview
tar --bzip2 -xvf linux-source-*.tar.bz2
ln -s `find . -maxdepth 1 -type d -name "linux-source-*"` linux

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

cd /usr/src/linux/drivers/media/video/gspca
mv ov534.c ov534.c.original
wget -N

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 /lib/modules/$(uname -r)/kernel/drivers/media/video/gspca
mv gspca_ov534.ko gspca_ov534.ko.original
mv gspca_main.ko gspca_main.ko.original
cd /usr/src/linux/drivers/media/video/gspca
cp -p gspca_main.ko /lib/modules/$(uname -r)/kernel/drivers/media/video/gspca
cp -p 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. Then to remove the old drivers and load the new ones, do:

modprobe -r gspca_ov534 gspca_main
modprobe gspca_ov534

7. To test whether the driver was installed correctly, do this:

 modinfo gspca_ov534

The result should include a "description" line that ends in "+ Tekkotsu", like this:

description:    GSPCA/OV534 USB Camera Driver(kaswy mod for MT use V0.5 / bear24rw patch V0.1) / ebrahimi patch V0.1 + Tekkotsu

Note: Tekkotsu now uses 640x480 resolution at 15 fps by default. The camera can deliver 320x240 pixel images at 125 frames per second, eliminating motion blur. If you want to experiment with this high frame rate you can either patch the driver to make the default videomode be 16 instead of 0, or set it manually by:

modprobe -r gspca_ov534
modprobe gspca_ov534 videomode=16

Installing the Udev Rules

If your netbook has a built-in webcam, it will fight with the Sony Playstation Eye for who gets to be /dev/video0 and who gets to be /dev/video1. If it has no webcam then the Eye will be /dev/video0, but Tekkotsu robots that use this camera assume it is /dev/video1. To prevent these problems you need to install udev rules to force the correct device assignment. See the article on Linux Udev Rules for instructions on downloading these rules.

A Bug

There is a bug in Linux video driver support that causes the Sony Playstation Eye to come up as an audio device instead of a video device if a udev rule is applied to it. 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. The script supplied with the Tekkotsu Linux Udev Rules fixes this problem by doing:

sudo modprobe -r gspca_ov534
sudo modprobe gspca_ov534

So be sure to install the udev rules and scripts, or you will have to do the modprobes manually each time you boot the system or unplug and replug the camera.


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

Recompiling Kernel Modules

Information about recompiling kernel modules can be found at