Author: AlexP
Date: 12-27-2009
The Sony PS3Eye is a great USB camera. Besides high resolution and image quality, this camera features unusually high frame capture rate for the device of this kind. This device is made to be used in various real-time image processing and tracking...
Introduction
The Sony PS3Eye is a great USB camera. Besides high resolution and image quality, this camera features unusually high frame capture rate for the device of this kind. This device is made to be used in various real-time image processing and object tracking applications. Therefore, I wouldn't call it your typical a webcam.
USB Protocol
While USB 1.0 was introduced in the early 1996 and it was able to transfer around 1.5MB/s, manufacturers soon realized that due to higher bandwidth requirements, the industry needed something better.
The USB 2.0 was released in April 2000 and was standardized by the USB-IF at the end of 2001. This new protocol was now able to transfer data at theoretical maximum of 60MB/s. In practice this number is lower due to some inherent USB communication overheads and it is more like two thirds of that number, so somewhere around 40MB/s. The USB 2.0 provides four data transfer types:
- Isochronous transfers - guaranteed transfer speed (high priority), but not reliable delivery, mainly used by audio and video streaming devices.
- Interrupt transfers - guarantees delivery latency time, but provides small data packet sizes, mainly used by keyboards, pointing devices and game controllers
- Bulk transfers - guarantees data delivery by using all available data bandwidth and large data transfers, but does not guarantee latency or transfer speed, mainly used by data storage devices
- Control transfers - very short data transfers (often a few bytes) with guaranteed delivery, mainly used to send device control packets and receive the device status information
From the above information, you can see that the most suitable USB data transfer type for the camera type device is isochronous transfers.
PS3Eye Camera
Now, lets take a look at some of the design decisions Sony has made with their PS3Eye device. The PS3Eye uses bulk transfers to send its image data to the USB host. This is unfortunate, since as you saw these kinds of transfers do not provide any guaranteed latency or speed. On the other hand, their decision is understandable because of the following:
- The camera is designed to run on PS3 console for which Sony has a full control of both hardware and software.
- The camera data stream requires high transfer bandwidth that is more suitable for bulk transfers (uses all available USB bandwidth).
This is all fine if you run the camera on your PS3 console. On the other hand, if you want to use this camera on your PC, you may possibly encounter some problems especially if the camera is shared with some other devices that reside on the same USB bus.
PS3Eye Data Requirements
Lets take a look at some simple data transfer numbers. The PS3Eye is
strictly a high-speed USB 2.0 device, meaning that if you have USB 1.0 port on your computer, the camera simply won't be able to transfer images to your machine. The camera provides the highest quality image sensor data (uncompressed raw data). As such, the amount of data to be transfered can easily saturate USB 2.0 bus!
For example lets take a look at the 640x480 24bit RGB image captured at 30fps:
Required Bandwidth = 640*480*30*3 = 27648000 bytes/s = 26.36 MB/s - Which is about 66% of total usable USB 2.0 bandwidth!!!
The 640x480 24bit RGB image captured at 60fps results in:
Required Bandwidth = 640*480*60*3 = 55296000 bytes/s = 52.73 MB/s - Which exceeds the total usable USB 2.0 bandwidth!!!
Other Webcams
Because of all this, most manufacturers in the webcam industry resort to all kinds of tricks when it comes to webcam data transfers. Many use specialized chips on the camera that will compress the image before sending it out to the USB host (using MJPEG for example). Because the image is often compressed by factors of 5, 10 or more (in order to achieve USB 1.0/1.1 compliance), this kind of compression is lossy by nature thus resulting in various unavoidable image artifacts. As a side effect, your computer needs to decompress the received data in order to do display and further processing, all resulting in higher CPU usage than it should be. Some manufacturers claim that their cameras can capture at 60 fps, but in fact what they do is a temporal interpolation in software on the computer end to simulate this high capture frame rate. Some manufacturers simply instruct the camera to capture at say 320x240 pixels and then do spatial interpolation in software resulting in the 640x480 image size. Yet, some manufacturers might use both methods listed above at the same time.
CL-Eye Driver
Now when it comes to the PS3Eye camera none of these tricks apply. With this camera it is
what you see is what you get and I made sure in our driver that this is really the case. The CL-Eye driver configures the camera to send the raw data directly from the image sensor, turning off any data processing that might exist in between. While the transfer type Sony chose is somehow hindering, once the camera works it provides unparalleled image quality and capture rates. As I said earlier due to the nature of the camera data transfers and Windows, there are many factors in making this camera perform rock solid on your system. A good starting point is checking the DPC latency of your system. This will help pinpoint any bad behaving driver (some WiFi drivers) and devices that might cause PS3Eye data stream to drop USB packets.
While I spent great deal of time and effort in making sure that the Windows driver is as optimized and streamlined as possible, it is practically impossible to account for all usage cases and scenarios. Please visit our
technical support forum page if you have a problem or further questions.
Research Home