JetsonHacks

NVIDIA Jetson TK1 – Sony PlayStation 3 Eye

Several years ago, the Sony PlayStation 3 Eye webcam was the staple of DIY Computer Vision projects. I happened to have several of them lying about from past projects. Here’s a video on how to install the driver and get them running on the Jetson. Looky here:

Installation

This installation is for LT4 21.2. Installation was done after a fresh JetPack install.

Note: If you have the Grinch kernel installed, you already have PS3 Eye goodness and don’t need to do this installation.

You can find the scripts on Github: installPlayStation3Eye

The repository includes a driver compiled for LT4 21.2. The driver will only work with that release.

Why the PS3 Eye be good and people use it

Back around 2007-2008, there were a lot of people working on multi-touch surfaces, including open source groups such as the NUI Group. From Wikipedia:

Infrared acrylic projection: A translucent acrylic sheet is used as a rear projection screen to display information. The edges of the acrylic sheet are illuminated by infrared LEDs, and infrared cameras are focused on the back of the sheet. Objects placed on the sheet are detectable by the cameras. When the sheet is touched by the user the deformation results in leakage of infrared light, which peaks at the points of maximum pressure indicating the user’s touch location. Microsoft’s PixelSense tables use this technology.

At the time, “inexpensive” infrared (IR) cameras were several hundred dollars made by manufacturers such as Point Grey. The Point Grey cameras were great, they were fast, but they were beyond the reach of the average DIYer.

Enter the PlayStation 3 Eye Camera. The PS3 Eye was built for Computer Vision (CV) applications, and performs well in variable lighting, has relatively low latency USB performance, and is capable of high frame rates. These frame rates are 60 fps at 640×480 and up to 125 fps at 320×240. At the time, PS3 Eyes were selling for about $40 USD, the advantage of mass production. But PS3 Eye cameras don’t detect infrared out of the box.

If you know about imaging sensors in webcams, you probably know that the sensor itself can sense infrared. You also probably know that most of the camera imagers have an infrared filter placed over them. Some people can remember that you could see infrared on early cellphones through their cameras; that’s because the manufacturers didn’t include IR filters on the cellphone cameras.

It turns out that the PS3 Eye was just barely easy enough for hackers to crack open and remove the IR filter, thus making it an IR imager. Search YouTube to for ‘PS3 Eye infrared’ for some examples on how to hack the camera. You can also buy modified for infrared sensing PS3 Eye cameras through places such as Peau Productions, where they can also add such niceties as m12 or CS camera style lens mounts.

Add the fact that each camera has a microphone array which provides 4 channels of sound, and you can understand why it was a no-brainer to use. The camera is small enough that it can be mounted almost anywhere, and the swivel base means you can point it in almost any direction.

Which brings us to the present. Why use it now? As of this writing, you can buy a PS3 Eye for under $10 at places like Amazon: PlayStation Eye. Sure, the camera is not 1920×1080 and all that, but for a lot of computer vision applications that does not matter. Did I mention it was under $10? Binocular vision, $20. Just a great deal.

Building the Driver

I was reminded of this device by a Jetson forum post a while back:

https://devtalk.nvidia.com/default/topic/766276/embedded-systems/guide-playstation-eye-on-jetson-tk1/

In the forum post, they recompiled the entire kernel. That is unnecessary. With the advent of the UBoot in LT4 21.2, all that is needed is a driver for the PS3 Eye. I compiled the driver using steps similar to Build Modules and Drivers. You will need to download the source for the kernel, available here: Jetson Platform Software Development

Then untar the configuration file and run menuconfig.

$ make menuconfig

the Device Driver can be built by enabling the device driver. Here’s the path:

Device Drivers -> Multimedia Support -> Media USB Adapters -> GSPCA based Webcams. Scroll down to OV534 OV772x USB Camera Drive

The script in the repository mentioned above: https://github.com/jetsonhacks/installPlayStation3Eye/blob/master/buildGSPCA_ov534_Driver.sh

makes the driver and copies it over to the proper place in the /lib/modules/ hierarchy. Here’s the gist of the script:

# Before running this script, you should have used
# $ menu menuconfig
# to select the driver for the particular device(s) you are building
# Navigate to:
# Device Drivers->Multimedia Support->Media USB Adapters->GSPCA based Webcams
# In this case OV534 OV772x USB Camera Driver, and Modularize
# Save the configuration then:
cd /usr/src/kernel
make prepare
make modules_prepare
make modules SUBDIRS=drivers/media/usb/gspca

# You’ll need to copy the newly built driver
cp /usr/src/kernel/drivers/media/video/gspca/gspca_ov534.ko /lib/modules/$(uname -r)/kernel/drivers/media/usb/gspca/

Conclusion

There’s a conclusion? Why are you reading this? Go buy yourself a couple and have some fun!