Вы находитесь на странице: 1из 17

Homebrew
EyeToy
for


PlaySta2on
2

Antonio
José
Ramos
Márquez
(aka
bigboss)


hEp://bigboss‐eyetoy.blogspot.com/


Summer’09

About
me:

  Telecomunica2ons
Engineer
working
like
IT
and
Iden2ty
Management

Consultant.


  Playsta2on
homebrew
developer
since
a
few
years
ago.

Research
History

  Dr.
Richard
Marks
showed
some
tech
demos
in
Siggraph
2001


hEp://www.research.scea.com/research/pdfs/GDC2001VideoInpuWorGamesRICK.pdf


  Release
07/04/03
in
Europe
with
Eyetoy
Play
name
SCES‐51513



  An
EyeToy
camera
was
included
with
the
game


  I
bought
the
game
and
i
decided
to
code
my
own
driver
for
PlaySta2on
2
and

began
my
research
to
make
it
possible




Research
History

  IOP
module
in
the
game
named
OV519.irx
and
it
had
symbols
included
and

a_er
 decompiling
 and
 some
 research
 i
 got
 Omnivision
 OV519
 and
 OV7640

chipsets
documenta2on
to
begin
to
work
in
my
driver.



  2004
I
got
a
saba2c
year
so
i
had
free
2me
to
make
an
estable
version
based

in
old
ps2lib.


  I
 learned
 a
 lot
 about
 isochronous
 transfer
 mode
 and
 low
 level
 usb
 driver

implementa2on.
Universal
Serial
Bus
Specifica2on
1.1
was
the
perfect
guide.


  I
began
researh
for
audio
part
of
the
driver.
Universal
Serial
Bus
Device
Class

for
audio
devices
1.0
was
very
helpfull.

Research
History

  09/26/2005
driver
for
PlaySta2on
2
Linux
was
released
and
then
deleted
in

official
PlaySta2on
2
Linux
Forum
(hEp://playsta2on2‐linux.com/projects/
eyetoy‐driver)
.



  It
showed
to
me
that
low
level
stuff
to
manage
OV519
and
OV7640
in
my

driver
was
perfect.
The
source
released
included
the
same
methods
than

original
OV519.irx
driver
to
manage
OV519
and
OV7640.
Audio
and
IPU

support
was
not
present
in
the
linux
driver.


Research
History

  11/04/05
EyeToy
Play
3
is
released
in
Europe
SCES‐53315.


  It
included
a
new
version
EYETOY.IRX,
symbols
are
not
included.


  I
decompiled
all
again
but
i
follow
with
the
old
approach.



  They
improve
driver
adding
best
control
on
init
proccess
(2
cameras
support,

thread
priority,
size
of
micframes,
size
of
videoframes,
number
of
mul2isoc

frames,samplerate,
etc).
Internally
it
was
the
same
with
beEer
code.

Research
History

  2006
some
test
are
done
with
hermes
(basic
mo2on
detec2on
for
liEle
mini

games,
fun
stuff
indeed
)


  2007
port
to
ps2dk
is
done
and
audio
support
was
added


  libeye
a
basic
library
to
manage
EyeToy
from
Emo2on
Engine
side

  libipu
a
basic
library
to
decode
ipu
frames
sent
by
the
driver

  libgsclassic
a
port
from
Wire
and
Toni
Saveski
old

and
light
graphic
library
to

ps2sdk

  Tested

with
success
under
PlaySta2on
2
emula2on
on
PlaySta2on
3
hardware!!!


Research
History

  10/26/07
Ps3
Eye
is
released
BCES‐00007

  Augmented
Reality
Game,
great
stuff



  2008
too
much
work
so
away
from
PlaySta2on
development


  Summer’09
fixed
some
bugs
in
Emo2on
Engine
side
and
tracking
ball
code
is

done


  2010
new
devices
for
Eye
will
be
released


hEp://blog.us.playsta2on.com/2009/08/exclusive‐behind‐the‐scenes‐with‐scea‐
research‐development‐part‐1/

EyeToy
driver

  All
usb
devices
drivers
in
PlaySta2on
2
register
the
following
func2ons:


  Probe:
test
if
driver
is
compliant
with
the
hardware
aEached
to
usb
port.
Basically

test
id
vendor
and
and
check
if
it
is
OV519/OV7640
camera
compliant
device

  AEach:
 if
 probe
 was
 successfully
 here
 all
 data
 structure
 and
 usb
 interfaces
 are

configured.

  DeEach:
called
when
device
is
deaEached
from
usb
port

  Addi2onally
 the
 driver
 has
 3
 func2on
 for
 mic
 OV519MicProbe,OV519MicAEach

and
OV519MicDeEach

EyeToy
Driver

  All
iop
modules
has
a
main
func2on
called
start,
in
the
driver
this
func2on
do:

 Show
version
release
and
copyright
stuff
something
like:


bigboss's
EyeToy
driver

Some
part
reversed
from
PAL
EyeToy
Play
OV519.IRX

Copyright
(C)
2004,2005,2006,2007,2008
Antonio
Jose
Ramos
Marquez
aka
bigboss

 Register
driver
in
usb
stack


 Init
semaphores


 Reserve
memory
to
eyetoy
driver
structure



 Init
thread
to
dma2ee
stuff
to
send
ipu
frames
to
EE


 Init
thread
to
rpc
server
to
receive
comand
to
manage
EyeToy


EyeToy
Driver

  There
is
also
a
mic_start
func2on
doing


  Ini2alized
memory
for
mic
structure

  Init
semaphores

  Init
thread
mic_dma2ee
to
send
pcm
audio
frames
to
EE

  Init
rpc
thread
to
manage
mic
func2onality



EyeToy
Driver

  Wait_for_command
rpc
thread
uses
cam_dispatch
to
receive
and
manage

the
next
commands:
 

  0x0b
to
set
data
pointer
in
EE
side
memory,
it
is
ini2alized
with
libeye.
Driver
will

send
all
ipu
frames
to
this
direc2on
using
a
double
buffer
with
sifcmd

  0x0a
to
ini2alize
camera.
It
will
set
all
internal
register
for
OV519
and
OV7640


  0x16
start
camera
call
4
2mes
to
usb_tranfer
func2on.
Mul2isoc
is
not
supported

in
usb
homebrew
driver,
for
this
reason
is
needed
to
call
a
few
2mes
to
this

funcion.
It
sends
informa2on
from
usb
device
to
IOP
side.
All
usb
frames
are
saved

with
double
buffer.
For
each
usb
transfer
completed,
func2on
usb_data_ready
is

called,
here
usb
frame
is
parsed
to
extract
valid
ipuframes,
then
are
send
to
ee

with
ee2dma
thread
with
sifcmd.
Usb_data_ready
func2on
call
also
to

usb_transfer
to
get
a
con2nuos
stream.

EyeToy
Driver

  Commands:

  0x17
stop
camera
stream

  0x22
set
framerate


  0x23
show
register
0xea
informa2on
from
OV519

  0x2e
set
AEC
flag

  0x2f
set
AGC


  0x30
set
AWB

  0x31
set
ABC


  0x2c
set
exposure

  0x28
set
gain

EyeToy
Driver

  Commands:

  0x29
set
red
and
blue
gain

  0x2d
set
brightness


  0x2b
set
satura2on

  0x2a
do
nothing

  0x32
set
led
frequency


  0x24
do
nothing

  0x33
compresion
level


  0x34
set
audio
gain

  0x38
set
mirror
flag(this
is
not
present
in
Original
OV519.IRX
driver)


EyeToy
Driver

  Internally
these
fuc2ons
are
used
to
manage
OV519
and
OV7640
registers


  register_read

  register_write

  register_write_masked

  i2c_register_read

  i2c_register_write

  i2c_register_write_masked

EyeToy
Driver

  EyeToy
 driver
 sends
 a
 con2nuous
 stream
 of
 well
 formed
 ipu
 frames
 to
 EE

side
without
extra
call
from
EE
side.


  A_er
 libeye
 init
 and
 start
 stream,
 applica2ons
 will
 have
 these
 frames

availables
for
use
it
without
call
to
iop
side.
Each
itera2on
in
your
code
you

have
available
ipuframes
to
do
what
do
you
want
with
them


  Normal
mode
decode
ipu
frame
with
ipu
to
RGBA
texture
do
some
proccess

for
mo2on
or
tracking
and
display
to
screen
and
back
again.


EyeToy
Tracking
balls

  It
is
a
sample
code
trakcking
balls
in
the
screen.
A
red
alpha
rectangle
track

all
balls
in
the
screen,
all
is
done
with
ps2sdk,
libeye,
libipu,
libgsclassic,

libblobdetect
and
eyetoy
driver.


Вам также может понравиться