
Kinect reverse-engineered; open driver available - jgrahamc
http://www.adafruit.com/blog/2010/11/10/we-have-a-winner-open-kinect-drivers-released-winner-will-use-3k-for-more-hacking-plus-an-additional-2k-goes-to-the-eff/
======
iamwil
The code for the camera.c is here:
[http://git.marcansoft.com/?p=libfreenect.git;a=blob;f=lib/ca...](http://git.marcansoft.com/?p=libfreenect.git;a=blob;f=lib/cameras.c;h=412b465fd3ea66a02d87f4d2f2dac5b60ce330eb;hb=HEAD)

I've always wondered how people reverse engineer these things. Do they just
guess what the interface might be based on the chips? Or are they able to
probe it somehow through the port?

~~~
troutwine
I loved this book as a kid: [http://www.amazon.com/Reversing-Secrets-
Engineering-Eldad-Ei...](http://www.amazon.com/Reversing-Secrets-Engineering-
Eldad-Eilam/dp/0764574817)

It's probably a bit out of date now, but my dog-eared copy is still a good
read. Ah, nostalgia. There once were days when I dreamed that a CS degree
would make me as a god; the silly thoughts of a child. Now I know that it is a
_PhD_ which makes gods of men.

~~~
mechanical_fish
_Now I know that it is a _PhD_ which makes gods of men._

I know you're joking, but...

When I was halfway through my Ph.D. I formulated a hypothesis: The _proximate_
challenge that keeps you from graduating is that you have to write a thesis.
But the _ultimate_ challenge to getting your Ph.D. is this: You somehow have
to learn to understand, deep down, that all your romantic notions about the
Ph.D. are bunk, that you will be exactly the same person on the day after you
get it that you were the day before, and that you need to stop waiting for the
day when you feel like a god and just _write something down_ and get on with
life.

It may take you years to accept this, and it may drive you to drink, but after
you get to that point you can graduate.

Only then will you be able to live with the fact that your thesis looks like
crap to you. Your thesis will always look like crap to you. Either you will
have figured out absolutely everything and your thesis will look _incredibly
boring_ to you, because you've moved on, or -- vastly more likely -- your
thesis will look _woefully incomplete_ because, geez, there is so much that
you couldn't figure out, and you're just so stupid!

Or, most likely of all, you will think both of these things at the same time.

Similarly: Being the world's foremost expert on a particular scientific
problem is a lot less exciting in real life than it seems in the movies. In
fact, being on the frontier of science feels like being totally, hopelessly
lost and confused. Why this came as a surprise to me I'll never know.

~~~
troutwine
When I went to do mathematics at Chicago I figured I was the smartest person
alive. There I was, facing the gargoyles of my dreams; a poor kid aspiring to
a better life by shrugging off the accent I was born into and the mentality of
defeat so common among the poor. But I had gone too far, became _too_
confident and failed horribly. I was sure that _the world_ had failed--I was
too good--and that everything was bullshit. I left, walked away from a full
scholarship because _I_ had overcome the constrains of my life before and
Mathematics and University were no different. I took a job at a small software
shop in Portland, OR instead, enrolling part time at PSU doing computer
science.

I failed at both, as you might expect. The _world_ wasn't wrong, I was. While
I could program, I had no discipline. While I had intellect, I had no ability
to learn. The world was not wrong, I was. All of my anger and suffering and
frustration were _my_ fault. From the defeat of my new University and my new
job I learned that my romantic notions of most things were not reality. Enrico
Fermi, on whose stairway I bounded up, did not simply decide to conjure
nuclear fission under what is now a library. He worked for _years_ , a thing
which I had never done.

The novice says to the master, "Coal is black." The master replies, "No, it is
not."

The intermediate says to the master, "Coal is not black." The master replies,
"Of course it is."

The masters say among themselves, "It is coal."

I hold no romantic notions as I held when I were a boy; I have not become a
cynical man. Life is suffering and pain. Life is joy and love. I have built a
business from nothing and sold it for a profit. I am now very poor. Life is
life and that is beautiful. What we learn, what we _truly_ learn, we so
incorporate into our being that we cannot perceive it as unknown to all. We
are the streams into which a man steps: never the same, yet always the same.

To gain mastery over the frontier of science is to gain mastery over nothing,
over one's self. It is confusion and pain and truth and beauty.

~~~
jasonkester
You wrote all that as a 3rd level reply to an offhand comment in a random
thread? Wow. This is the reason I keep coming back here.

Just yesterday I saw so much negativity and pettiness on another thread that I
had pretty much written off HN as a lost cause.

Your post brought me back. Thanks!

------
st3fan
So much for "With Kinect, Microsoft built in numerous hardware and software
safeguards designed to reduce the chances of product tampering" ... :-)

~~~
Pyrodogg
Microsoft had already started backpedaling with it's "that's not hacking"
comment to Gamespot.

"Kinect for Xbox 360 has not been hacked--in any way--as the software and
hardware that are part of Kinect for Xbox 360 have not been modified. What has
happened is someone has created drivers that allow other devices to interface
with the Kinect for Xbox 360. The creation of these drivers, and the use of
Kinect for Xbox 360 with other devices, is unsupported. We strongly encourage
customers to use Kinect for Xbox 360 with their Xbox 360 to get the best
experience possible."

[http://www.gamespot.com/xbox360/sports/thebiggestloserultima...](http://www.gamespot.com/xbox360/sports/thebiggestloserultimateworkout/news.html?sid=6283696)

~~~
flogic
Yeah. I thought it was some exec shooting his mouth off the first time. There
didn't seem to be much a of a traditional DRM reason to lock the Kinect down.
So the most obvious answer is it wasn't.

~~~
BarkMore
At the start of a product cycle, game consoles are typically sold at a loss.
Manufacturers recoup this loss through licensing fees paid by game publishers.

If Microsoft is selling the Kinect at a loss, then Microsoft will be motivated
to keep it locked down to ensure that they can recoup the loss through
licensing fees.

~~~
VBprogrammer
I don't think this is a very convincing argument. I don't think there have
been many examples of people building games for the PC using the Wii
controller. I suspect that the same goes for the Kinect. The vast majority of
people buying this will be people buying it for the XBOX, with a small
proportion of geeks using the open source driver for interests sake, but not
the sole purpose of buying it.

~~~
hartror
Sony suffered a bit with the PS3 being used by Universities as cheap super
computer clusters. I believe from memory PS3 had a very low attach rate (the
number of games purchased per console). Though from Sony's view point they are
also trying to move TVs and ensure the success of Bluray so perhaps they were
happy with a low rate.

------
InclinedPlane
This is a misleading title. The Kinect sensor has been hacked, but Kinect
proper is a combination of hardware and software. Arguably the more
interesting aspects of Kinect are in the software.

That being said, this is still pretty cool, it'll be interesting to see what
people come up with using this technology.

~~~
modeless
Honestly the hardware is more interesting than the software. Yeah, skeleton
tracking is cool, but the hardware is capable of so much more. 3D scanning,
mapping, and localization for robots come to mind. With the microphone array
built in, Kinect is basically begging to be the eyes and ears of a robot.

~~~
teamonkey
Right now the Kinect drivers can't do anything that a pair of cheap USB
webcams can't. The only advantage seems to be the on-board depth processing
instead of having to use something like OpenCV.
<http://opencv.willowgarage.com/wiki/>

~~~
modeless
Completely wrong. Kinect is _not_ a stereo vision system. It's the first
consumer application of a completely new class of cameras which directly
measures depth by the time of flight of a reflected laser beam. It's literally
a 320x240 array of laser rangefinders. It's called a flash LIDAR camera, and
the quality and robustness of the depth data is far beyond anything achievable
from stereo vision today even with high-end cameras, let alone webcams.

edit: Actually, there seems to be some confusion on the Internet about exactly
how Kinect's depth sensor works, and it may be more likely based on structured
light scanning than LIDAR (though Microsoft has recently acquired some LIDAR
startups). Either way, though, the depth data quality is far beyond any kind
of stereo vision.

~~~
teamonkey
From what I understand, an IR pattern is projected on to the room and the
cameras pick it up. The level of distortion in the pattern shows how far the
object is. NOT Lidar. Probably a laser projector though.

The tech is nice, and it's nice that it's bundled up in one affordable
package, but the real power in Kinect is in the software. Right now all that
the drivers return is raw video and depth. It's what you do with that data
that counts.

------
markbao
Oh man. Ordering one ASAP. So much cool stuff could be done with this. Going
to try to create a gestures thing so I can browse my email from bed.

~~~
guelo
Could this all have been genius marketing by Microsoft?

~~~
flogic
I think it's probably an executive with enough power to say things but without
enough knowledge to know what he's saying. That's fairly normal for large
companies.

~~~
electromagnetic
I thought it was mandatory for large companies. If lower-upper management
actually had new ideas they might usurp someone elses power and then where
would the top execs be? And where would the company be then!? (besides rapidly
bankrupting itself through moron ideas)

------
olalonde
That was quick.

~~~
pchristensen
I'm actually surprised it took this long - how much more motivation did the
REs need than MSFT's lawsuit threats?

~~~
qeorge
He did it within 3 hours of it going on sale in Europe. That's pretty quick!

~~~
sliverstorm
I think the internet is getting people to the point they expect it to be
hacked a month before the product is actually released ;)

------
shogunmike
This is an exciting achievement and I'm very impressed that it was carried out
so rapidly. Good hacking indeed!

Although, I have two questions which HN may be able to answer for me:

1) What are the benefits of the Kinect over building a servo-driven IR bar
with audio yourself out of cheap commodity hardware? Is the price far less
when all components are integrated? Is the construction just that much
simpler?

2) Presumably now that the "easier" task of reverse engineering the comms
protocol has been achieved, the next step is to understand/replicate/replace
the "proprietary" algorithms in use by Microsoft that run in the XBox in order
to have some meaningful interaction with the device. Is it possible to use
some FOSS such as OpenCV with Kinect? I know it's early days and many of you
probably haven't had time to look at the protocol yet, but I am curious.

------
andrewcamel
What would be very interesting, is if you could mod the device to work with a
better camera. Then, it would probably be useful in the photography industry.
Maybe it would allow you to correct issues with lighting? It would allow
someone editing pictures to easily select a part of the picture in the
foreground or background. With selections being much easier, you could enhance
specific parts of photos to make them stand out around other less-important
parts without much effort at all.

I'm sure there are many more applications for this technology in the
photography and even videography industry. Any ideas?

------
augustl
I always wanted to be able to set focus on windows by looking at them. Perhaps
that can be achieved with a Kinect.

~~~
orangecat
You should be able to do that with a normal webcam, since you don't need depth
information. I've thought of that too; I think there will be a similar
interface when heads-up displays in glasses become viable.

~~~
a_m_kelly
I haven't been paying attention, but has eyetracking software gotten that
good? Can you point to people or companies who are working on this, or
currently available solutions?

I've been doing some usability testing stuff and it'd be nice to have
eyetracking (especially paired with click/mouseover data.) and not much less
helpful head/face tracking that is built into the webcam.

~~~
samlittlewood
Commercial use:

<http://www.gazehawk.com/>

Some open source:

<http://www.inference.phy.cam.ac.uk/opengazer/>

<http://sourceforge.net/projects/gazetrackinglib/>

------
joshu
I would have thought there was some onboard CPU on the kinect, based on the
power requirements (it can't be powered by a USB port alone.) If so, I suspect
that any heavy lifting the unit does is probably by software that uploaded to
the camera via USB at startup.

Anyone have further details?

~~~
wmf
Yes, there's at least one CPU. It looks like the Kinect performs depth
extraction on-board and the 360 performs gesture recognition.

[http://www.ifixit.com/Teardown/Microsoft-Kinect-
Teardown/406...](http://www.ifixit.com/Teardown/Microsoft-Kinect-
Teardown/4066/1)

~~~
mattmanser
Which, as stated elsewhere in the comments, is the really interesting bit of
this tech.

On the otherhand, it's still an impressive hack in terms of speed.

