Git Product home page Git Product logo

ps4eye's Introduction

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.

Requirements

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:

With *NIX like environments:

$ sudo easy_install pip  # hopefully pre-installed with python
$ sudo pip install --pre pyusb

Optional for OSX:

mkdir usbutils
cd usbutils
wget http://picusb.googlecode.com/files/usbutils-006_macosx_lion.zip
unzip usbutils-006_macosx_lion.zip
cd usbutils-006
./configure
make clean
make # you will have lsusb command compiled

Disabling the UVCvideo Kernel Module

It may be helpful for development purposes to disable the uvcvideo kernel module. As root simply add blacklist uvcvideo to /etc/modprobe.d/blacklist.conf and then rmmod uvcvideo to unload the already loaded module. It is then possible to initialize the PS4 camera without uvcvideo potentially interfering with the initialization process.

WARNING: This will disable uvcvideo for the entire system. Be sure to comment or remove the entry from blacklist.conf after development if you wish to re-enable the use of other cameras.

Usage

  • Ensure that the uninitialized camera is recognized:
$ lsusb -d 05a9:0580
Bus 004 Device 001: ID 05a9:0580 OmniVision Technologies, Inc. 
  • Initialize the camera with the provided script:
$ sudo ./ps4eye_init.py
PS4 camera firmware uploaded and device reset
  • The device should now be available with a new product id:
$ sudo lsusb -v -d 05a9:058a

Bus 004 Device 002: ID 05a9:058a OmniVision Technologies, Inc. 
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               3.00
  bDeviceClass          239 Miscellaneous Device
  bDeviceSubClass         2 ?
  bDeviceProtocol         1 Interface Association
  bMaxPacketSize0         9
  idVendor           0x05a9 OmniVision Technologies, Inc.
  idProduct          0x058a 
  bcdDevice            1.00
  iManufacturer           1 Omnivision Technologies, Inc.
  iProduct                2 USB Camera-OV580
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength          311
    bNumInterfaces          2
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              128mA
    Interface Association:
      bLength                 8
      bDescriptorType        11
      bFirstInterface         0
      bInterfaceCount         2
      bFunctionClass         14 Video
      bFunctionSubClass       3 Video Interface Collection
      bFunctionProtocol       0 
      iFunction               2 USB Camera-OV580
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass        14 Video
      bInterfaceSubClass      1 Video Control
      bInterfaceProtocol      0 
      iInterface              2 USB Camera-OV580
      VideoControl Interface Descriptor:
        bLength                13
        bDescriptorType        36
        bDescriptorSubtype      1 (HEADER)
        bcdUVC               1.00
        wTotalLength           77
        dwClockFrequency      125.000000MHz
        bInCollection           1
        baInterfaceNr( 0)       1
      VideoControl Interface Descriptor:
        bLength                18
        bDescriptorType        36
        bDescriptorSubtype      2 (INPUT_TERMINAL)
        bTerminalID             1
        wTerminalType      0x0201 Camera Sensor
        bAssocTerminal          0
        iTerminal               0 
        wObjectiveFocalLengthMin      0
        wObjectiveFocalLengthMax      0
        wOcularFocalLength            0
        bControlSize                  3
        bmControls           0x0000000a
          Auto-Exposure Mode
          Exposure Time (Absolute)
      VideoControl Interface Descriptor:
        bLength                 9
        bDescriptorType        36
        bDescriptorSubtype      3 (OUTPUT_TERMINAL)
        bTerminalID             2
        wTerminalType      0x0101 USB Streaming
        bAssocTerminal          0
        bSourceID               3
        iTerminal               0 
      VideoControl Interface Descriptor:
        bLength                11
        bDescriptorType        36
        bDescriptorSubtype      5 (PROCESSING_UNIT)
      Warning: Descriptor too short
        bUnitID                 3
        bSourceID               1
        wMaxMultiplier          0
        bControlSize            2
        bmControls     0x0000165f
          Brightness
          Contrast
          Hue
          Saturation
          Sharpness
          White Balance Temperature
          Gain
          Power Line Frequency
          White Balance Temperature, Auto
        iProcessing             2 USB Camera-OV580
        bmVideoStandards     0x1a
          NTSC - 525/60
          SECAM - 625/50
          NTSC - 625/50
      VideoControl Interface Descriptor:
        bLength                26
        bDescriptorType        36
        bDescriptorSubtype      6 (EXTENSION_UNIT)
        bUnitID                 4
        guidExtensionCode         {8a0f88dd-ba1c-5449-8a25-f7875967f0f7}
        bNumControl             1
        bNrPins                 1
        baSourceID( 0)          1
        bControlSize            1
        bmControls( 0)       0x01
        iExtension              2 USB Camera-OV580
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass        14 Video
      bInterfaceSubClass      2 Video Streaming
      bInterfaceProtocol      0 
      iInterface              0 
      VideoStreaming Interface Descriptor:
        bLength                            14
        bDescriptorType                    36
        bDescriptorSubtype                  1 (INPUT_HEADER)
        bNumFormats                         1
        wTotalLength                      177
        bEndPointAddress                  129
        bmInfo                              0
        bTerminalLink                       2
        bStillCaptureMethod                 0
        bTriggerSupport                     0
        bTriggerUsage                       0
        bControlSize                        1
        bmaControls( 0)                    27
      VideoStreaming Interface Descriptor:
        bLength                            27
        bDescriptorType                    36
        bDescriptorSubtype                  4 (FORMAT_UNCOMPRESSED)
        bFormatIndex                        1
        bNumFrameDescriptors                3
        guidFormat                            {59555932-0000-1000-8000-00aa00389b71}
        bBitsPerPixel                      16
        bDefaultFrameIndex                  1
        bAspectRatioX                       0
        bAspectRatioY                       0
        bmInterlaceFlags                 0x00
          Interlaced stream or variable: No
          Fields per frame: 2 fields
          Field 1 first: No
          Field pattern: Field 1 only
          bCopyProtect                      0
      VideoStreaming Interface Descriptor:
        bLength                            42
        bDescriptorType                    36
        bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)
        bFrameIndex                         1
        bmCapabilities                   0x00
          Still image unsupported
        wWidth                           3448
        wHeight                           808
        dwMinBitRate                  5571968
        dwMaxBitRate                167159040
        dwMaxVideoFrameBufferSize     5571968
        dwDefaultFrameInterval         166666
        bFrameIntervalType                  4
        dwFrameInterval( 0)            166666
        dwFrameInterval( 1)            333333
        dwFrameInterval( 2)            666666
        dwFrameInterval( 3)           1250000
      VideoStreaming Interface Descriptor:
        bLength                            46
        bDescriptorType                    36
        bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)
        bFrameIndex                         2
        bmCapabilities                   0x00
          Still image unsupported
        wWidth                           1748
        wHeight                           408
        dwMinBitRate                  1426368
        dwMaxBitRate                 42791040
        dwMaxVideoFrameBufferSize     1426368
        dwDefaultFrameInterval          83333
        bFrameIntervalType                  5
        dwFrameInterval( 0)             83333
        dwFrameInterval( 1)            166666
        dwFrameInterval( 2)            333333
        dwFrameInterval( 3)            666666
        dwFrameInterval( 4)           1250000
      VideoStreaming Interface Descriptor:
        bLength                            42
        bDescriptorType                    36
        bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)
        bFrameIndex                         3
        bmCapabilities                   0x00
          Still image unsupported
        wWidth                            898
        wHeight                           200
        dwMinBitRate                   359200
        dwMaxBitRate                 10776000
        dwMaxVideoFrameBufferSize      359200
        dwDefaultFrameInterval          41666
        bFrameIntervalType                  4
        dwFrameInterval( 0)             41666
        dwFrameInterval( 1)             83333
        dwFrameInterval( 2)            166666
        dwFrameInterval( 3)            333333
      VideoStreaming Interface Descriptor:
        bLength                             6
        bDescriptorType                    36
        bDescriptorSubtype                 13 (COLORFORMAT)
        bColorPrimaries                     1 (BT.709,sRGB)
        bTransferCharacteristics            1 (BT.709)
        bMatrixCoefficients                 4 (SMPTE 170M (BT.601))
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       1
      bNumEndpoints           1
      bInterfaceClass        14 Video
      bInterfaceSubClass      2 Video Streaming
      bInterfaceProtocol      0 
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            5
          Transfer Type            Isochronous
          Synch Type               Asynchronous
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               1
        bMaxBurst              15
        Mult                    2
Binary Object Store Descriptor:
  bLength                 5
  bDescriptorType        15
  wTotalLength           22
  bNumDeviceCaps          2
  USB 2.0 Extension Device Capability:
    bLength                 7
    bDescriptorType        16
    bDevCapabilityType      2
    bmAttributes   0x00000002
      Link Power Management (LPM) Supported
  SuperSpeed USB Device Capability:
    bLength                10
    bDescriptorType        16
    bDevCapabilityType      3
    bmAttributes         0x00
    wSpeedsSupported   0x000c
      Device can operate at High Speed (480Mbps)
      Device can operate at SuperSpeed (5Gbps)
    bFunctionalitySupport   2
      Lowest fully-functional device speed is High Speed (480Mbps)
    bU1DevExitLat          10 micro seconds
    bU2DevExitLat          32 micro seconds
Device Status:     0x0f0c
  (Bus Powered)
  U1 Enabled
  U2 Enabled

Hardware Reference

PlayStation 4 Camera has:

  • OV580 asic from Omnivision as usb bridge to control other chips
  • dual OV9713 sensors from Omnivision
  • 5703 A/D converter from AKM
  • 4g51A eeprom sop-j8 package from ROHM?
  • ...

See Also

http://ps4eye.tumblr.com/

http://www.psdevwiki.com/ps4/PlayStation_4_Camera

Contact

Mail: [email protected]

IRC: irc.freenode.net#ps4eye or irc.efnet.org#ps4dev

Credits

ps4eye/ew, marshallh, ao2, bigboss

Special Thanks

http://www.heatsynclabs.org/

ps4eye's People

Contributors

bigboss-ps3dev avatar ibtaylor avatar ps4eye avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ps4eye's Issues

Is support for the PS5 camera adaptor possible?

I have the ps4 eye camera and Sony's own USB3 camera adaptor (That is meant to be used with PS5, but it is reporting as an usb device on pc).

It reports thusly:

Bus 001 Device 005: ID 054c:0d0a Sony Corp. PlayStation(R)Camera adaptor
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.10
  bDeviceClass            9 Hub
  bDeviceSubClass         0 
  bDeviceProtocol         2 TT per port
  bMaxPacketSize0        64
  idVendor           0x054c Sony Corp.
  idProduct          0x0d0a 
  bcdDevice            1.54
  iManufacturer           1 Sony Interactive Entertainment
  iProduct                2 PlayStation(R)Camera adaptor
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0029
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower                0mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         9 Hub
      bInterfaceSubClass      0 
      bInterfaceProtocol      1 Single TT
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0001  1x 1 bytes
        bInterval              12
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       1
      bNumEndpoints           1
      bInterfaceClass         9 Hub
      bInterfaceSubClass      0 
      bInterfaceProtocol      2 TT per port
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0001  1x 1 bytes
        bInterval              12
Hub Descriptor:
  bLength               9
  bDescriptorType      41
  nNbrPorts             2
  wHubCharacteristic 0x00a9
    Per-port power switching
    Per-port overcurrent protection
    TT think time 16 FS bits
    Port indicators
  bPwrOn2PwrGood        0 * 2 milli seconds
  bHubContrCurrent    100 milli Ampere
  DeviceRemovable    0x00
  PortPwrCtrlMask    0xff
 Hub Port Status:
   Port 1: 0000.0100 power
   Port 2: 0000.0100 power
Binary Object Store Descriptor:
  bLength                 5
  bDescriptorType        15
  wTotalLength       0x002a
  bNumDeviceCaps          3
  USB 2.0 Extension Device Capability:
    bLength                 7
    bDescriptorType        16
    bDevCapabilityType      2
    bmAttributes   0x0000f41e
      BESL Link Power Management (LPM) Supported
    BESL value     1024 us 
    Deep BESL value    61440 us 
  SuperSpeed USB Device Capability:
    bLength                10
    bDescriptorType        16
    bDevCapabilityType      3
    bmAttributes         0x00
    wSpeedsSupported   0x000e
      Device can operate at Full Speed (12Mbps)
      Device can operate at High Speed (480Mbps)
      Device can operate at SuperSpeed (5Gbps)
    bFunctionalitySupport   1
      Lowest fully-functional device speed is Full Speed (12Mbps)
    bU1DevExitLat          10 micro seconds
    bU2DevExitLat        1023 micro seconds
  Container ID Device Capability:
    bLength                20
    bDescriptorType        16
    bDevCapabilityType      4
    bReserved               0
    ContainerID             {ecf5adf1-5011-4005-91ec-71ca7101b6a2}
can't get debug descriptor: Resource temporarily unavailable
Device Status:     0x0001
  Self Powered

I am not well versed when it comes to USB stuff so can't be sure if this is enough info to judge if the support is possible or not, so I am available in case any testing is needed.

not compiling for windows

windows 8.1
visual studio 2013

Error 1 error C1083: Cannot open include file: 'libusb.h': No such file or directory c:\development\ps4eye-master\record\ps4eye.h 10 1 ps4eye
Error 2 error C1083: Cannot open include file: 'libusb.h': No such file or directory c:\development\ps4eye-master\record\ps4eye.h 10 1 ps4eye
3 IntelliSense: cannot open source file "libusb.h" c:\Development\ps4eye-master\record\ps4eye.h 10 1 ps4eye
4 IntelliSense: identifier "libusb_device" is undefined c:\Development\ps4eye-master\record\ps4eye.h 39 3 ps4eye
5 IntelliSense: identifier "libusb_context" is undefined c:\Development\ps4eye-master\record\ps4eye.h 40 3 ps4eye
6 IntelliSense: identifier "libusb_device_handle" is undefined c:\Development\ps4eye-master\record\ps4eye.h 41 3 ps4eye
7 IntelliSense: identifier "uint8_t" is undefined c:\Development\ps4eye-master\record\ps4eye.h 59 38 ps4eye
8 IntelliSense: identifier "uint8_t" is undefined c:\Development\ps4eye-master\record\ps4eye.h 59 61 ps4eye
9 IntelliSense: identifier "uint16_t" is undefined c:\Development\ps4eye-master\record\ps4eye.h 59 79 ps4eye
10 IntelliSense: identifier "uint16_t" is undefined c:\Development\ps4eye-master\record\ps4eye.h 60 38 ps4eye
11 IntelliSense: identifier "uint16_t" is undefined c:\Development\ps4eye-master\record\ps4eye.h 60 55 ps4eye
12 IntelliSense: identifier "uint8_t" is undefined c:\Development\ps4eye-master\record\ps4eye.h 62 31 ps4eye
13 IntelliSense: identifier "uint8_t" is undefined c:\Development\ps4eye-master\record\ps4eye.h 62 54 ps4eye
14 IntelliSense: identifier "uint16_t" is undefined c:\Development\ps4eye-master\record\ps4eye.h 62 72 ps4eye
15 IntelliSense: identifier "uint16_t" is undefined c:\Development\ps4eye-master\record\ps4eye.h 63 31 ps4eye
16 IntelliSense: identifier "uint16_t" is undefined c:\Development\ps4eye-master\record\ps4eye.h 63 48 ps4eye

Can not stream video after firmware correctly uploaded...

Hi,

I am running Mac OS, El Captain + Parallels installed Linux 14.04 + Full USB 3.0 Support (tested independently on another 3.0 hard disk device).

parallels@ubuntu:~$ cat /proc/version
Linux version 3.17.3-031703-generic (apw@gomeisa) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) ) #201411141335 SMP Fri Nov 14 18:36:40 UTC 2014

I have all the code working. I have been able to successfully upload the firmware:

parallels@ubuntu:~/ps4eye/python$ ./ps4eye_init.py
PS4 camera already initialized

parallels@ubuntu:~/ps4eye/python$ lsusb
Bus 001 Device 003: ID 203a:fffa

Bus 001 Device 002: ID 203a:fffa

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 003: ID 05a9:058a OmniVision Technologies, Inc.
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub

I can even get the light (red light) on the ps4eye to turn on via the other code:

sudo ./ps4eye_cmd.py startup.bin
PS4 camera commands done
device 0:
endpoint 0 : 81
detaching kernel driver...
aborting camera read
attaching kernel driver...

So I can talk to it. I can even see the option for /dev/video0 when I run Cheese on ubuntu (webcam viewer) I can see the video resolutions of the device - all correctly... But when I click on the PS4Eye to stream I get a blank screen... If I restart and enable the internal HD video camera on the mac - that works fine.

Any ideas to what could be wrong ?

I really appreciate any help even if you can offer some pointers It'd be a big help.

Thank you for all your work it's great - just be really nice to have a clean system running with the PS4Eye in ROS.

Also in El Captain if I JUST connect the ps4eye to the mac local machine (not the visualised machine). I can see in "Photo Booth & VLC" a second video option USB Camera-OV580 but no video comes out, no errors, just no video...

I'm so close to getting this going, really don't want to give up as it'd be great to have all this running.

I was thinking of the next step being just cutting the wires shorter and re-soldering as maybe it's a cable length / quality of connection issue....

kind regards,
eVorta

PS4eye_init.py does not work

I have tried using the scrip in windows 8.1 it exited without any print out and the ps4 is not reset

I then tried it in ubuntu 14.14 desktop the script runs and 'PS4 camera firmware uploaded and device reset'
but when i run lsusb the Product ID is still the same it has not change as in the instruction

Wondering if there is any version of the pseye it is not working my Ps cable colour is diffferent from the one on the modding instruction

ps4eye_cmd.py is not compatible with python 3

└───╼  ./ps4eye_cmd.py startup.bin 
  File "/media/COSAS/aplicaciones/ps4eye/python/./ps4eye_cmd.py", line 13
    print 'PS4 camera not initialized'
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?

after pass the program 2to3 program, i get

└───╼  ./ps4eye_cmd.py startup.bin 
PS4 camera command file startup.bin opened
Traceback (most recent call last):
  File "/media/COSAS/aplicaciones/ps4eye/python/./ps4eye_cmd.py", line 30, in <module>
    wtype     = ord(setup[0])
TypeError: ord() expected string of length 1, but int found

any repo with this fixed?

greetings

How to get audio?

There's 4 mics on the camera. Is the driver capable of using the mics?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.