On Mon, 8 Jun 2015 01:41:08 -0700 (PDT)
Hi Hiromasa,
I am the author of the kinect1 gspca driver.
> I wrote a linux kernel driver for kinect v2 device. The code
> is available at
>
https://github.com/yoshimoto/gspca-kinect2
>
> This driver uses video 4 linux 2 (v4l2) interface for both color and depth
> stream
> so that you can use your kinect as a web-camera.
>
I don't have a kinect2 so I don't know much about it and I cannot test
the code, bu I took a brief look at it anyway, it seems to be in
a decent shape, it only needs some touches before you cold propose it to
linux-media[1] and have it in the linux kernel.
[1]
http://www.linuxtv.org/lists.php
Maybe start proposing the gspca.[ch] changes about no_clear_halt so
that you can remove these files from your repository.
And then send the patches to add support for the depth stream
pixelformat.
Is the V4L2_PIX_FMT_Y11BPACK the same exact packed format used by the
kinect 1? If so the name is OK, if not it would be better to come up
with another name.
When adding a new pixel format to videodev2.h it also needs to be
documented, follow the example of the Y10B format:
grep -r -i Y10B .../linux/Documentation/DocBook/
When submitting kinect2.[ch] to linux-media please describe briefly the
kinect2 hardware and explain what the pixel formats are; people in
linux-media don't necessarily know the details, for instance I don't.
Some comments on the kernel driver:
- run linux/script/
checkpatch.pl -f kinect.[ch]
Check the style issues and also look at
linux/Documentation/CodingStyle and
linux/Documentation/SubmittingPatches
BTW most warnings about "line over 80 characters" can be ignored but
some actually make sense;
- avoid forward declarations of functions (sd_stopN,
sd_private_ioctl), just reorder the definitions;
- have separate functions and separate sd_desc for color and depth
stream, and just check for the interface in sd_probe() to register
the appropriate subdriver, look at kinect.c in the latest kernels to
get an idea.
AFAICS the kinect2 has color and depth stream on two separate
interfaces, right? So you are going to have two instances of the driver
for each device, each instance will have it's own subdriver.
Just for the records, the kinect 1 makes it harder to support color and
depth at the same time with the current gspca infrastructure because it
uses two different endpoints for them on the same interface.
I didn't look at this, could you please add a README which describes
what it does?
From your brief comment below I take that libk4w2 can work either with
libusb or with your kernel driver, right? So, in a way it overlaps with
libfreenect2; can that cause fragmentation?
About using the kernel driver, have you looked at libv4l[2] from
v4l2-utils[3] to see if it's possible to use its plugin infrastructure
for the depth stream decoding?
[2]
http://linuxtv.org/downloads/v4l-dvb-apis/libv4l.html
[3]
http://git.linuxtv.org/v4l-utils.git
> It is basically rewrite version of libfreenect2. However, it also includes
> the following
> features;
> - Optimized depth decoder by using OpenMP
> - CUDA-based color decoder, which may run faster than trubojpeg
>
> I'd like to contribute to openkinect project with these codes.
> Any comment is appreciated.
>
>
> Thanks,
> Hiromasa YOSHIMOTO
>
Ciao ciao,
Antonio
--
Antonio Ospite
http://ao2.it
A: Because it messes up the order in which people normally read text.
See
http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?