[ps4eye] In case anyone is interested, here is a link to ps4 camera usb comm dump: drive.google.com/file/d/0B52YoWIKRvZ-MWl2Yk1MSVhkQTA/edit?usp=sharing, am looking for people to help develop a gspca driver and contribute to github.com/ps4eye/ps4eye
[marshallh] this is the sw to view the logs btw totalphase.com/products/data-center/
[PUNIETA] Data Center Software V6.61 - Total Phase
[ps4eye] thanks again marshallh for your help with that!
From his blog: Experimental PS4 Camera Tools
WARNING: These tools are still in development and may not allow for complete, if any, functionality of the camera. The PS4 camera is USB 3.0 only and is not compatible with USB 2.0 systems.
Pyusb 1.0 is required and may not be available through the package manager of some systems. Python-pip may help in installing the most recent version of pyusb:
The two cameras can be used together for depth-sensing of objects in its field of vision, akin to the Xbox 360’s Kinect peripheral. Alternatively, one of the cameras can be used for generating the video image, with the other used for motion tracking.
PS4 camera cable on the left in black, and a USB 3.0 cable on the right in blue. There is a green/white wire pair missing on the PS4 cable, this is the USB 2.0 differential pair for backwards compatibility, it is not necessary for connecting the PS4 camera to a USB 3.0 port.
Front and back views of the PS4 camera board, with microphone array attached. Back chip connected to special USB 3.0 port is labeled OV00580-B21G-1C PPU889 1322 09. Front chip connected to microphone array is labeled 5703 324A. The rear external port appears very similar to a micro USB 2.0 socket, except slightly larger and with additional connections.
Circled in red are screw holes beneath the front lens cover, if you are so inclined to disassemble your PS4 camera.
Official PS4 Camera Specifications
External Dimensions: Approx. 186mm x 27mm x 27mm (width x height x depth)
Weight: Approx. 183g
Video Pixel: (Maximum) 1280 x 800 pixel x 2
Video Frame Rate:
1280x800 pixel @ 60fps
640x400 pixel @ 120fps
320x192 pixel @ 240fps
Video Format: RAW YUV (uncompressed)
Lens: Dual Lenses, F value/F2.0 fixed focus
Capture Range: 30cm~
Field-of-View: 85 degrees
Microphone: 4 Channel Microphone Array
Connection Type: PS4 dedicated connector (AUX connector)
Cable Length: Approx. 2m
I had released the first public version of PS4EYECam driver. You can get full information in my PS4EYECam repository.
It is the first public driver for PlayStation 4 Camera licensed under gpl. I have free afternoons available if someone is interested to offer me a partial job
Enjoy and remember the best is yet to come...
What is PS4EYECam?
PS4EYECam is a Sony PlayStation 4 Camera driver implementation reference.
The driver is using libusb (github.com/libusb/libusb) to handle USB communications.
Part of code was based on PS3EYEDriver (github.com/inspirit/PS3EYEDriver).
Payload parsing stuff parts from Linux kernel source (gspca).
UVC video control from libuvc (github.com/ktossell/libuvc).
Boot and initialization from dumped PlayStation 4 Camera firmware ps4eye (github.com/ps4eye/ps4eye).
Other parts and research based on my experience adding support for different usb devices for Sony PlayStation 2 and Sony PlayStation 3 consoles (ps2eyetoy.irx, ps2mic.irx, ps3kinect.sprx, etc).
About PlayStation 4 Camera device
PlayStation 4 Camera has a Sony propietary connector called AUX, it is an USB 3 connector without USB 2 differential data pair(d+ and d-). If you want to use it on other platform different than PlayStation 4 console you must adapt wire and connector to USB 3.
I have been working with PlayStation 4 Camera since 2013. So i want to share with you all the things learned since then.
First of all, if device has not a public/free driver , you need to make reverse engineering and you need to look for information about its chipset and make a research about it. So you need to open the device and look for information about its different chips. After making some research we can show the next high level design diagram:
PlayStation 4 Camera is using a proprietary connector called AUX, however it is a USB 3 cable so our first goal was to cut off the AUX connector and connect it to an USB3 male connector, after this we can connect directly to Mac/PC with USB3 female ports. Next step was to get an USB sniffer capture from PlayStation 4 with a beagle device in the middle, without this we could not have learnt about how to initialize the device and their different options.
OV580. It is an asic from Omnivision a typical custom USB bridge solution to manage all other chip. No information or datasheet about it without signing a NDA with Omnivision. Other companies using it are Mantis Vision and LeapMotion. I have worked with others Omnivision USB bridge solutions included in PlayStation EyeToy (OV519) and PlayStation Eye (OV534) so basically it is the same work i made with other drivers for Omnivision.
OV9713. Two cmos sensors well documented with full datasheet available in google.
AK5703. An analogical to digital converter connected with an microphone array (4). Datasheet is available. The datasheet was very helpfull to get audio properly from PlayStation 4 Camera.
4g51A. An eeprom chip. It contains the initial configuration for PlayStation 4 Camera.
When you connect device to a Mac/PC with USB3 it is in boot mode waiting for loading firmware. Analizing sniffer capture we got the firmware and steps needed to load it to device. So after loading firmware you have and special UVC Camera device and you can learn about their different streaming modes.
Interface 1 alt setting 0 describe all video modes with these possible options:
mode 0 fps 60(default), 30, 15, 8 video left and video right frames 1280x800
mode 1 fps 120(default), 60, 30, 15, 8 video left and video right frames 640x400
mode 2 fps 240(default), 120, 60, 30 video left and video right frames 320x192
OV580 is delivering in each mode:
mode 0 3448x2x808 bytes frame each row with:
header 32 bytes
audio 64 bytes
video left 1280x2 bytes
video right 1280x2 bytes
video interleave 840x2 bytes
mode 1 1748x2x408 bytes frame each row with:
header 32 bytes
audio 64 bytes
video left 640x2 bytes
video right 640x2 bytes
video interleave 420x2 bytes
mode 2 898x2x200 bytes frame each row with
header 32 bytes
audio 64 bytes
video left 320x2 bytes
video right 320x2 bytes
video interleave 210x2 bytes
Part of Header is showed in the next screenshot:
Part of Audio is showed in the next screenshot:
Audio has 4 channel i use Audicity tool loading a 10 second capture a reproducing 4 audio channels with success. AK5703 datasheet was very helpful.
A screenshot from audicity tool:
Videl Left and Right can be converted to RGB with CV_YUV2RGB_YUY2 conversion:
cv::Mat yuv(size_y,size_x,CV_8UC2 ,in);
cv::Mat rgb(size_y,size_x,CV_8UC3, out);
cv::cvtColor(yuv, rgb, CV_YUV2RGB_YUY2);
Video interleave it is also the same video format but it is making a mix of two sensor.
A sample application made using basic PS4EYECam driver showing a 640x400 mode for two PlayStation Cameras at the same time:
Low level usb stuff is implemented and available in my repository. EyeLab is a poc of multi camera application using PS4EYECam driver and it is not in the repository, you don't need to make changes in the driver to support multi cameras you need to do it at application level.
So after this i can say that PlayStation 4 Camera is full documented and it can be supported on other platforms. All information needed is here and in my repository.
PlayStation 4 receives frames with format explained here. I suppose that secondary processor makes all the job to parse frames (video and audio) and connect with image/audio libraries from sdk (if someone want to share it with me you can contact with me ). PlayStation 4 only has 1 AUX port so a multicam solution would be hard to implement like i am doing now in Osx.