PS3 Camera Driver Howto

From Brown University Robotics

Jump to: navigation, search

Contents

Who Needs This

As of the more recent (9-ish) Ubuntus, the Playstation 3 Eye (i.e. the Eye of Judgement) is supported as a standard 640x480 30fps webcam. However, with a patch the camera's more exotic (i.e. 60,100,125) framerates and resolutions are supported. These are especially helpful in banishing motion blur from computer vision applications, hence the motivation to use a patched driver. If you've built your own kernel before, patching should not be too difficult.

Attribution

The following is a summary of the information and ancillary discussions from bear24rw's blog and blog.10100111001. The actual patched file is the work of bear24rw, M. Ebrahimi, Kaswy, Antonio Ospite, Jim Paris, Jean-Francois Moine, and—I am sure—many others.

How To

You will need

Install necessary packages
  1. sudo apt-get install kernel-package libncurses5-dev wget bzip2 build-essential linux-source
Extract kernel source code
  1. sudo su -
  2. cd /usr/src
  3. tar --bzip2 -xvf linux-source-2.6.(your version).tar.bz2
  4. ln -s linux-source-2.6.(your version) linux
Replace driver
  1. get the modified ovc534.c from File:Ov534.c (rename it so there is no capital 'O'): wget http://brown-robotics.org/images/8/86/Ov534.c & mv Ov534.c ov534.c
  2. cd linux
  3. rm drivers/media/video/gspca/ov534.c
  4. mv (wherever you downloaded the modified ov534.c) drivers/media/video/gspca/
Add driver if not already present
  1. make menuconfig (or another kernel configuration utility)
  2. Include the PS3 driver module by selecting Device Drivers -> Multimedia support -> Video capture adapters -> V4L USB devices -> GSPCA based webcams -> OV534 USB Camera Driver ('M')
  3. make & make modules & make install & make modules_install (takes a _long_ time)
  4. Reboot. You ought to be able to skip the recompilation and installation steps.
  5. It is probably possible to compile and install the module without redoing the entire kernel. http://www.cyberciti.biz/tips/compiling-linux-kernel-module.html has pointers; testing will have to wait for another installation opportunity.
Recompile driver
  1. cp /usr/src/linux-headers-$(uname -r)/Module.symvers /usr/src/linux
  2. make oldconfig
  3. make modules_prepare
  4. make SUBDIRS=drivers/media/video/gspca modules
Install new driver
  1. cp drivers/media/video/gspca/gspca_main.ko /lib/modules/$(uname -r)/kernel/drivers/media/video/gspca
  2. cp drivers/media/video/gspca/gspca_ov534.ko /lib/modules/$(uname -r)/kernel/drivers/media/video/gspca
  3. depmod
  4. modprobe -r gspca_main
  5. modprobe gspca_main

To Use The Modified Driver

Before you plugin
  1. modprobe -r gspca-ov534
  2. modprobe gspca-ov534 videomode=XX autogain=1 awb=1

XX is the video mode. 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

To load the driver with your desired videomode on startup

Add "gspca_ov534 videomode=XX" as a line in your /etc/modules file

Tips

Autogain and auto white balancing are off by default, but can be turned on when the module is loaded, as shown above. Otherwise, guvcview is a good utility to use to control this.

This page was last modified on 15 May 2011, at 00:20. This page has been accessed 406 times.