r9y9/pylibfreenect2

Packet buffer is NULL

Dagrol opened this issue · 15 comments

I am getting the following error on Ubuntu 14.04 while running the examples:

[Error] [DepthPacketStreamParser] Packet buffer is NULL
[Error] [DepthPacketStreamParser] Packet buffer is NULL
[Error] [DepthPacketStreamParser] Packet buffer is NULL
[Error] [DepthPacketStreamParser] Packet buffer is NULL
[Error] [DepthPacketStreamParser] Packet buffer is NULL
[Error] [DepthPacketStreamParser] Packet buffer is NULL
[Error] [DepthPacketStreamParser] Packet buffer is NULL
.....
it continuously prints the above and eventually crashes. Am I missing something in the installation? since they worked fine on OSX.

--Edit--
Just to add, the Protonect binary seems to work fine in libfreenect2

r9y9 commented

Do you see the error with Protonect?

Nope. Protonect works fine. I get that error as soon as I run the examples and any other scripts I wrote which use pylibfreenect2 which were working fine on OSX. I am starting to wonder if it might be a graphics card issue? (I am running ubuntu 14.04 on a macbook pro with amd Radeon HD 8870M)

r9y9 commented

Um, it might be the issue related graphics, but I'm afraid that I don't have a workaround right now. It's worth trying to see which packet processor triggers this; OpenGLPacketPipeline, OpenCLPacketPipeline or CpuPacketPipeline to dig into the problem.

I am not 100% sure if it's a graphics card issue. It seems very odd that Protonect works but not this. I might be missing some configuration settings

How did you resolve this issue? I am also getting recursively same error.

Any Solutions ? I am having the same issue!

./Protonect doesn't present any isssues
./Protonect cl DOES present the same error

Changing from OpenCL to OpenCV seem to have solved the issue

EDIT: As mentioned below by @r9y9 using

from pylibfreenect2 import OpenGLPacketPipeline
pipeline = OpenGLPacketPipeline()

instead of

from pylibfreenect2 import OpenCLPacketPipeline
pipeline = OpenCLPacketPipeline()

Seems to have solved the issue.
(CpuPacketPipeline() also works just fine)

I am facing the same problem.
Protonect works normally.
Do you think the problem lies with the GPU?
My PC uses only CPU. Can not I use Kinect V 2 with pylibfreenect with CPU alone?
However,
from pylibfreenect 2 import CpuPacketPipeline
pipeline = CpuPacketPipeline ()
I guess that this is programmed to work with only the CPU

I do not know what to do

r9y9 commented

Well, since I don't have Kinect v2 anymore, it's hard to say what is the real cause of this. Could anybody confirm whether the issue comes from pylibfreenect2 or libfreenect2? According to the #34 (comment), there's something wrong with OpenCL. Does Protonect work even with OpenCL backend?

I tried
$ ./Protonect gl It works normally
$ ./Protonect cl It does not work properly, Packet buffer is NULL
$ ./Protonect cpu It works normally

OpenCL doesn't work, but the problem was solved.
I modified the example code(multiframe_listener.py) and tested it.
I made the order of OpenCL the last.

【before】
try:
from pylibfreenect2 import OpenCLPacketPipeline
pipeline = OpenCLPacketPipeline()
except:
try:
from pylibfreenect2 import OpenGLPacketPipeline
pipeline = OpenGLPacketPipeline()
except:
from pylibfreenect2 import CpuPacketPipeline
pipeline = CpuPacketPipeline()

【after】
try:
from pylibfreenect2 import OpenGLPacketPipeline
pipeline = OpenGLPacketPipeline()
except:
try:
from pylibfreenect2 import CpuPacketPipeline
pipeline = CpuPacketPipeline()
except:
from pylibfreenect2 import OpenCLPacketPipeline
pipeline = OpenCLPacketPipeline()

This code worked without problems!
Thank you for your help!

r9y9 commented

@tokyokuma Thank you very much! So there should be something wrong with OpenCL setup. I used OpenCL backend because it was the fastest backend for me, but I changed example code to use the OpenGL backend instead by default.

I had the same issue, so I edited the parameters to:

depth_method to opengl
reg_method to cpu

After that, it is working well.

I had the same issue, so I edited the parameters to:

depth_method to opengl reg_method to cpu

After that, it is working well.

hi, but I still want to use opencl for registration, any idea?

$ ./bin/Protonect cuda brought me the same errors:

...
[Error] [DepthPacketStreamParser] Packet buffer is NULL
[Error] [DepthPacketStreamParser] Packet buffer is NULL
[Error] [DepthPacketStreamParser] Packet buffer is NULL
[Error] [DepthPacketStreamParser] Packet buffer is NULL
[Error] [DepthPacketStreamParser] Packet buffer is NULL
[Error] [DepthPacketStreamParser] Packet buffer is NULL
[Error] [DepthPacketStreamParser] Packet buffer is NULL
[Error] [DepthPacketStreamParser] Packet buffer is NULL
[Error] [DepthPacketStreamParser] Packet buffer is NULL
[Error] [DepthPacketStreamParser] Packet buffer is NULL
[Error] [DepthPacketStreamParser] Packet buffer is NULL
[Error] [DepthPacketStreamParser] Packet buffer is NULL
[Error] [DepthPacketStreamParser] Packet buffer is NULL
[Error] [DepthPacketStreamParser] Packet buffer is NULL
[Error] [DepthPacketStreamParser] Packet buffer is NULL
[Error] [DepthPacketStreamParser] Packet buffer is NULL
[Error] [DepthPacketStreamParser] Packet buffer is NULL
[Error] [DepthPacketStreamParser] Packet buffer is NULL
[Error] [DepthPacketStreamParser] Packet buffer is NULL
[Error] [DepthPacketStreamParser] Packet buffer is NULL
[Error] [DepthPacketStreamParser] Packet buffer is NULL
[Error] [DepthPacketStreamParser] Packet buffer is NULL
[Error] [DepthPacketStreamParser] Packet buffer is NULL
[Error] [DepthPacketStreamParser] Packet buffer is NULL
[Error] [DepthPacketStreamParser] Packet buffer is NULL
[Error] [DepthPacketStreamParser] Packet buffer is NULL
...