OpenKinect / libfreenect2

Open source drivers for the Kinect for Windows v2 device
2.08k stars 751 forks source link

Failed to connect to display #1102

Open itsyoshio opened 4 years ago

itsyoshio commented 4 years ago

Overview Description: I can't get Video from Protonect, or rather i cannot display it on my Screen. Haven't had any luck with either X11 or Wayland. (tried Deepin and Gnome Wayland / Gnome X11). Any pointers in the right direction are greatly appreciated.

Version, Platform, and Hardware Bug Found:

  1. da68a71 (HEAD -> master, origin/master, origin/HEAD) Update TegraJPEG detection
  2. Linux yoshio-notebook 5.3.18-1-surface #1 SMP PREEMPT Sat, 28 Dec 2019 22:53:29 +0000 x86_64 GNU/Linux
  3. 
    Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/6p, 5000M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/3p, 5000M
        |__ Port 2: Dev 3, If 0, Class=Hub, Driver=hub/1p, 5000M
            |__ Port 1: Dev 4, If 0, Class=Vendor Specific Class, Driver=, 5000M
            |__ Port 1: Dev 4, If 1, Class=Vendor Specific Class, Driver=, 5000M
            |__ Port 1: Dev 4, If 2, Class=Audio, Driver=snd-usb-audio, 5000M
            |__ Port 1: Dev 4, If 3, Class=Audio, Driver=snd-usb-audio, 5000M
4. `00:14.0 USB controller [0c03]: Intel Corporation Sunrise Point-LP USB 3.0 xHCI Controller [8086:9d2f] (rev 21)`

Steps to Reproduce:

1. Build current libfreenect2 from Github
2. run /build/Protonect

Actual Results:
`$ ./Protonect`

Version: 0.2.0 Environment variables: LOGFILE= Usage: ./Protonect [-gpu=] [gl | cl | clkde | cuda | cudakde | cpu] [] [-noviewer] [-norgb | -nodepth] [-help] [-version] [-frames ] To pause and unpause: pkill -USR1 Protonect [Info] [Freenect2Impl] enumerating devices... [Info] [Freenect2Impl] 9 usb devices connected [Info] [Freenect2Impl] found valid Kinect v2 @2:4 with serial 298089633947 [Info] [Freenect2Impl] found 1 devices [Error] [OpenGLDepthPacketProcessorImpl] GLFW error 65544 Wayland: Failed to connect to display [Error] [OpenGLDepthPacketProcessor] Failed to initialize GLFW.



Expected Results:
- Display Sensor Results

Reproducibility:
- Unknown

Additional Information:
- Kinect v2 with Official Microsoft Kinect One to Windows Adapter.
- Bought a Second Pair (unofficial [Kinect One Windows Adapter](https://www.amazon.de/dp/B07GFGBF6Q/ref=sr_1_3?keywords=Kinect+v2&qid=1578252389&sr=8-3) + Kinect v2) where i experience the same result.
- `./Protonect cpu` results in `$ GLFW error 65537 The GLFW library is not initialized` being displayed 5 times.
floe commented 4 years ago

Can you run glxgears, does that work? And have you tried installing libglfw3-wayland (just a guess, I'm not a Wayland user myself).

itsyoshio commented 4 years ago

Hi floe,

Yes i can run glxgears without err. I'm on Arch so the corresponding Package would be glfw-wayland, which is installed.

Thank you so far.

floe commented 4 years ago

Maybe related: #946

Beyley commented 3 years ago

i seem to be getting this error too, even though i dont have wayland installed at all

JustCryen commented 8 months ago

I have issues getting it to work as well. There are two glfw packages on Arch: glfw-wayland and glfw-x11. Both conflicting with each other. For some reason libfreenect2 defaults to glfw-wayland. Does it matter if I'm trying to use libfreenect2 on x11?

JustCryen commented 8 months ago

I've tried biro-mark's fix in https://github.com/OpenKinect/libfreenect2/issues/946 and It's still not working on Linux.

Protonect cl in both cases returned:

Version: 0.2.0
Environment variables: LOGFILE=<protonect.log>
Usage: Protonect [-gpu=<id>] [gl | cl | clkde | cuda | cudakde | cpu] [<device serial>]
        [-noviewer] [-norgb | -nodepth] [-help] [-version]
        [-frames <number of frames to process>]
To pause and unpause: pkill -USR1 Protonect
[Error] [OpenCLDepthPacketProcessorImpl] cl::Platform::get(&platforms): -1001
[Error] [OpenCLAllocator] b->buffer = cl::Buffer(context, CL_MEM_WRITE_ONLY | CL_MEM_ALLOC_HOST_PTR, size, NULL, &err): -34
[Error] [OpenCLAllocator] b->buffer = cl::Buffer(context, CL_MEM_WRITE_ONLY | CL_MEM_ALLOC_HOST_PTR, size, NULL, &err): -34
[Info] [VaapiRgbPacketProcessorImpl] driver: Mesa Gallium driver 23.3.5-arch1.1 for AMD Radeon RX 6700 XT (radeonsi, navi22, LLVM 16.0.6, DRM 3.57, 6.7.4-zen1-1-zen)
[Error] [OpenCLAllocator] b->buffer = cl::Buffer(context, CL_MEM_READ_ONLY | CL_MEM_ALLOC_HOST_PTR, size, NULL, &err): -34
[Info] [Freenect2Impl] enumerating devices...
[Info] [Freenect2Impl] 16 usb devices connected
[Info] [Freenect2Impl] found valid Kinect v2 @4:2 with serial 006895750347
[Info] [Freenect2Impl] found 1 devices
[Info] [Freenect2DeviceImpl] opening...
[Info] [Freenect2DeviceImpl] transfer pool sizes rgb: 20*16384 ir: 60*8*33792
[Info] [Freenect2DeviceImpl] opened
[Info] [Freenect2DeviceImpl] starting...
[Error] [OpenCLDepthPacketProcessorImpl] OpenCLDepthPacketProcessor is not initialized!
[Error] [OpenCLDepthPacketProcessorImpl] OpenCLDepthPacketProcessor is not initialized!
[Error] [OpenCLDepthPacketProcessorImpl] OpenCLDepthPacketProcessor is not initialized!
[Debug] [Freenect2DeviceImpl] status 0x090000: 9729
[Debug] [Freenect2DeviceImpl] status 0x090000: 9731
[Info] [Freenect2DeviceImpl] submitting rgb transfers...
[Info] [Freenect2DeviceImpl] submitting depth transfers...
[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
[Info] [Freenect2DeviceImpl] started
[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
device serial: 006895750347
device firmware: 4.0.3917.0
[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
[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
GLFW error 65537 The GLFW library is not initialized
GLFW error 65537 The GLFW library is not initialized
GLFW error 65537 The GLFW library is not initialized
GLFW error 65537 The GLFW library is not initialized
GLFW error 65537 The GLFW library is not initialized
Failed to create opengl window.
[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

And self-terminates at the end.

In both cases (with the fix and without) cmake returns this warning message on compilation:

CMake Warning (dev) at /usr/share/cmake/Modules/FindOpenGL.cmake:381 (message):
  Policy CMP0072 is not set: FindOpenGL prefers GLVND by default when
  available.  Run "cmake --help-policy CMP0072" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.

  FindOpenGL found both a legacy GL library:

    OPENGL_gl_LIBRARY: /usr/lib/libGL.so

  and GLVND libraries for OpenGL and GLX:

    OPENGL_opengl_LIBRARY: /usr/lib/libOpenGL.so
    OPENGL_glx_LIBRARY: /usr/lib/libGLX.so

  OpenGL_GL_PREFERENCE has not been set to "GLVND" or "LEGACY", so for
  compatibility with CMake 3.10 and below the legacy GL library will be used.
Call Stack (most recent call first):
  CMakeLists.txt:269 (FIND_PACKAGE)
This warning is for project developers.  Use -Wno-dev to suppress it.
floe commented 8 months ago

I have issues getting it to work as well. There are two glfw packages on Arch: glfw-wayland and glfw-x11. Both conflicting with each other. For some reason libfreenect2 defaults to glfw-wayland. Does it matter if I'm trying to use libfreenect2 on x11?

Yes, if you're using X11, then the wayland package won't do anything, you'll need glfw-x11. Note that I'm unfamiliar with Arch, we've always tested this primarily on Ubuntu.

JustCryen commented 8 months ago

Yeah, sorry, I forgot to mention that I got it to launch Protonect by changing to glfw-x11 but not without further problems. For now I'm still having issues with VAAPI on an AMD card, Protonect works only if I use export LIBVA_DRIVER_NAME=i965 as currently libfreenect2 doesn't seem to support VAAPI on AMD… The current "solution" seems to be to remove libva altogether but that's not really an option, is it? Btw, I've reverted the biro-mark's fix, it looks like it isn't really needed.