Open3D icon indicating copy to clipboard operation
Open3D copied to clipboard

Cannot load k4arecord.dll

Open taeinkwon opened this issue 7 years ago • 18 comments

Hello, thank you for integrating Azure Kinect SDK to Open3D.

Describe the bug I followed the way that you described in the document, but Azure Kinect SDK does not work on my two laptops. bug1

It looks like LoadLibrary function can not read k4arecord.dll file. So I checked the path of the SDK and print the type of error using GetLastError function. It printed 126. I think the path and the version of SDK (1.2.0) are fine. I don't know why LoadLibrary can't read Kinect SDK. Do you know why it happened?

bug2

To Reproduce Installed the recent Open3d (0.8) and run the file using "python examples/Python/ReconstructionSystem/sensors/azure_kinect_mkv_reader.py --input d:\data\book10.mkv" and ".\AzureKinectMKVReader.exe --input c:\data\test.mkv" in the this repo.

Environment (please complete the following information):

  • OS: window 10
  • Python version: 3.6
  • Open3D version: 0.8
  • Is this remote workstation?: no
  • How did you install Open3D?: pip

taeinkwon avatar Oct 13 '19 13:10 taeinkwon

@yxlao is this a compatibility issue with k4a v1.2?

theNded avatar Oct 13 '19 22:10 theNded

FYI, I tested with both 1.2 and 1.3 versions

taeinkwon avatar Oct 13 '19 22:10 taeinkwon

@taeinkwon Yes, v1.2 shall have been tested. Probably it's missing some other dependencies, e.g. the depth engine library.

For error code 126, have you tried the methods described in https://stackoverflow.com/a/14362289/1255535, to trace all files while your dll is trying to load?

yxlao avatar Oct 17 '19 22:10 yxlao

You might want to refer to my comment at https://github.com/intel-isl/Open3D/issues/1314#issuecomment-580590274 if it helps.

scimad avatar Jan 31 '20 05:01 scimad

I have the same problem. I have SDK installed version 1.2 and the depth engine dll is there as well. Also azure_kinect_viewer.py gives me this error:

`[Open3D INFO] AzureKinectSensor::Connect [Open3D INFO] sensor_index 0 [Open3D INFO] Serial number: 000021492512 [Open3D INFO] Firmware build: Rel [Open3D INFO] > Color: 1.6.102 [Open3D INFO] > Depth: 1.6.75[6109.7] Sensor initialized. Press [ESC] to exit. [2020-02-10 14:56:32.076] [error] [t=5904] D:\a\1\s\extern\Azure-Kinect-Sensor-SDK\src\allocator\allocator.c (118): k4a_capture_t_get_context(). Invalid k4a_capture_t 0000000000000000 [2020-02-10 14:56:32.076] [error] [t=5904] D:\a\1\s\extern\Azure-Kinect-Sensor-SDK\src\allocator\allocator.c (344): Invalid argument to capture_get_color_image(). capture_handle (0000000000000000) is not a valid handle of type k4a_capture_t [2020-02-10 14:56:32.078] [error] [t=5904] D:\a\1\s\extern\Azure-Kinect-Sensor-SDK\src\allocator\allocator.c (118): k4a_capture_t_get_context(). Invalid k4a_capture_t 0000000000000000 [2020-02-10 14:56:32.080] [error] [t=5904] D:\a\1\s\extern\Azure-Kinect-Sensor-SDK\src\allocator\allocator.c (359): Invalid argument to capture_get_depth_image(). capture_handle (0000000000000000) is not a valid handle of type k4a_capture_t [2020-02-10 14:56:32.081] [error] [t=5904] D:\a\1\s\extern\Azure-Kinect-Sensor-SDK\src\allocator\allocator.c (118): k4a_capture_t_get_context(). Invalid k4a_capture_t 0000000000000000 [2020-02-10 14:56:32.081] [error] [t=5904] D:\a\1\s\extern\Azure-Kinect-Sensor-SDK\src\allocator\allocator.c (295): Invalid argument to capture_dec_ref(). capture_handle (0000000000000000) is not a valid handle of type k4a_capture_t [2020-02-10 14:56:32.115] [error] [t=5904] D:\a\1\s\extern\Azure-Kinect-Sensor-SDK\src\allocator\allocator.c (118): k4a_capture_t_get_context(). Invalid k4a_capture_t 0000000000000000 [2020-02-10 14:56:32.115] [error] [t=5904] D:\a\1\s\extern\Azure-Kinect-Sensor-SDK\src\allocator\allocator.c (344): Invalid argument to capture_get_color_image(). capture_handle (0000000000000000) is not a valid handle of type k4a_capture_t [2020-02-10 14:56:32.117] [error] [t=5904] D:\a\1\s\extern\Azure-Kinect-Sensor-SDK\src\allocator\allocator.c (118): k4a_capture_t_get_context(). Invalid k4a_capture_t 0000000000000000 [2020-02-10 14:56:32.119] [error] [t=5904] D:\a\1\s\extern\Azure-Kinect-Sensor-SDK\src\allocator\allocator.c (359): Invalid argument to capture_get_depth_image(). capture_handle (0000000000000000) is not a valid handle of type k4a_capture_t [2020-02-10 14:56:32.120] [error] [t=5904] D:\a\1\s\extern\Azure-Kinect-Sensor-SDK\src\allocator\allocator.c (118): k4a_capture_t_get_context(). Invalid k4a_capture_t 0000000000000000 [2020-02-10 14:56:32.121] [error] [t=5904] D:\a\1\s\extern\Azure-Kinect-Sensor-SDK\src\allocator\allocator.c (295): Invalid argument to capture_dec_ref(). capture_handle (0000000000000000) is not a valid handle of type k4a_capture_t Traceback (most recent call last): File "Open3D\examples/Python/ReconstructionSystem/sensors/azure_kinect_viewer.py", line 72, in v.run() File "Open3D\examples/Python/ReconstructionSystem/sensors/azure_kinect_viewer.py", line 36, in run vis.update_geometry() TypeError: update_geometry(): incompatible function arguments. The following argument types are supported: 1. (self: open3d.open3d.visualization.Visualizer, arg0: open3d.open3d.geometry.Geometry) -> bool

Invoked with: VisualizerWithKeyCallback with name viewer `

If I rename the folder "C:\Program Files\Azure Kinect SDK v1.2.0" to something else I get: RuntimeError: [Open3D ERROR] Cannot load k4a.dll. This probably means the DLLs are loaded from the correct location.

brookman avatar Feb 10 '20 13:02 brookman

Any update on this one on Azure Kinect SDK v1.3 and open3d 0.9.0? I am getting issue for these versions.

scimad avatar Mar 05 '20 05:03 scimad

@yxlao do you have any information about this?

germanros1987 avatar Mar 12 '20 19:03 germanros1987

I am also having this problem. I can load k4a.dll and depthengine_2_0.dll without any problems even on SDK 1.4.0. (so the viewer and recorder work). The only DLL that cannot be loaded is k4arecord.dll. I tried downgrading to 1.2.0 and had the exact same behavior (only mkv reader does not work)

rafaelkuffner avatar Apr 08 '20 07:04 rafaelkuffner

I am also having this problem. I can load k4a.dll and depthengine_2_0.dll without any problems even on SDK 1.4.0. (so the viewer and recorder work). The only DLL that cannot be loaded is k4arecord.dll. I tried downgrading to 1.2.0 and had the exact same behavior (only mkv reader does not work)

I am having the exact same problem. Windows 10

wearenocomputer avatar Apr 14 '20 12:04 wearenocomputer

Screenshot (73)

Adding the K4A_LIB_DIR system variable worked for me when using c++ verison of the mkv reader.

wearenocomputer avatar Apr 15 '20 10:04 wearenocomputer

Issue fixed : https://github.com/intel-isl/Open3D/issues/1314#issuecomment-634971437

djaym7 avatar May 27 '20 22:05 djaym7

I have the same problem. I have SDK installed version 1.2 and the depth engine dll is there as well. Also azure_kinect_viewer.py gives me this error:

`[Open3D INFO] AzureKinectSensor::Connect [Open3D INFO] sensor_index 0 [Open3D INFO] Serial number: 000021492512 [Open3D INFO] Firmware build: Rel [Open3D INFO] > Color: 1.6.102 [Open3D INFO] > Depth: 1.6.75[6109.7] Sensor initialized. Press [ESC] to exit. [2020-02-10 14:56:32.076] [error] [t=5904] D:\a\1\s\extern\Azure-Kinect-Sensor-SDK\src\allocator\allocator.c (118): k4a_capture_t_get_context(). Invalid k4a_capture_t 0000000000000000 [2020-02-10 14:56:32.076] [error] [t=5904] D:\a\1\s\extern\Azure-Kinect-Sensor-SDK\src\allocator\allocator.c (344): Invalid argument to capture_get_color_image(). capture_handle (0000000000000000) is not a valid handle of type k4a_capture_t [2020-02-10 14:56:32.078] [error] [t=5904] D:\a\1\s\extern\Azure-Kinect-Sensor-SDK\src\allocator\allocator.c (118): k4a_capture_t_get_context(). Invalid k4a_capture_t 0000000000000000 [2020-02-10 14:56:32.080] [error] [t=5904] D:\a\1\s\extern\Azure-Kinect-Sensor-SDK\src\allocator\allocator.c (359): Invalid argument to capture_get_depth_image(). capture_handle (0000000000000000) is not a valid handle of type k4a_capture_t [2020-02-10 14:56:32.081] [error] [t=5904] D:\a\1\s\extern\Azure-Kinect-Sensor-SDK\src\allocator\allocator.c (118): k4a_capture_t_get_context(). Invalid k4a_capture_t 0000000000000000 [2020-02-10 14:56:32.081] [error] [t=5904] D:\a\1\s\extern\Azure-Kinect-Sensor-SDK\src\allocator\allocator.c (295): Invalid argument to capture_dec_ref(). capture_handle (0000000000000000) is not a valid handle of type k4a_capture_t [2020-02-10 14:56:32.115] [error] [t=5904] D:\a\1\s\extern\Azure-Kinect-Sensor-SDK\src\allocator\allocator.c (118): k4a_capture_t_get_context(). Invalid k4a_capture_t 0000000000000000 [2020-02-10 14:56:32.115] [error] [t=5904] D:\a\1\s\extern\Azure-Kinect-Sensor-SDK\src\allocator\allocator.c (344): Invalid argument to capture_get_color_image(). capture_handle (0000000000000000) is not a valid handle of type k4a_capture_t [2020-02-10 14:56:32.117] [error] [t=5904] D:\a\1\s\extern\Azure-Kinect-Sensor-SDK\src\allocator\allocator.c (118): k4a_capture_t_get_context(). Invalid k4a_capture_t 0000000000000000 [2020-02-10 14:56:32.119] [error] [t=5904] D:\a\1\s\extern\Azure-Kinect-Sensor-SDK\src\allocator\allocator.c (359): Invalid argument to capture_get_depth_image(). capture_handle (0000000000000000) is not a valid handle of type k4a_capture_t [2020-02-10 14:56:32.120] [error] [t=5904] D:\a\1\s\extern\Azure-Kinect-Sensor-SDK\src\allocator\allocator.c (118): k4a_capture_t_get_context(). Invalid k4a_capture_t 0000000000000000 [2020-02-10 14:56:32.121] [error] [t=5904] D:\a\1\s\extern\Azure-Kinect-Sensor-SDK\src\allocator\allocator.c (295): Invalid argument to capture_dec_ref(). capture_handle (0000000000000000) is not a valid handle of type k4a_capture_t Traceback (most recent call last): File "Open3D\examples/Python/ReconstructionSystem/sensors/azure_kinect_viewer.py", line 72, in v.run() File "Open3D\examples/Python/ReconstructionSystem/sensors/azure_kinect_viewer.py", line 36, in run vis.update_geometry() TypeError: update_geometry(): incompatible function arguments. The following argument types are supported:

  1. (self: open3d.open3d.visualization.Visualizer, arg0: open3d.open3d.geometry.Geometry) -> bool

Invoked with: VisualizerWithKeyCallback with name viewer `

If I rename the folder "C:\Program Files\Azure Kinect SDK v1.2.0" to something else I get: RuntimeError: [Open3D ERROR] Cannot load k4a.dll. This probably means the DLLs are loaded from the correct location.

Having the same issue,is it solved ?

chuckwuxx avatar Jul 06 '20 14:07 chuckwuxx

Having the same issue

I also have the same issue...

www158 avatar Jul 06 '20 14:07 www158

Adding the K4A_LIB_DIR system variable worked for me when using c++ verison of the mkv reader.

This works for me. In Windows 10, I set the K4A_LIB_DIR to the the ""C:\Program Files\Azure Kinect SDK v1.4.1\sdk\windows-desktop\amd64\release\bin"", the azure_kinect_viewer.py can show the color and depth map. However, it still have the error message like this

I have the same problem. I have SDK installed version 1.2 and the depth engine dll is there as well. Also azure_kinect_viewer.py gives me this error: `[Open3D INFO] AzureKinectSensor::Connect [Open3D INFO] sensor_index 0 [Open3D INFO] Serial number: 000021492512 [Open3D INFO] Firmware build: Rel [Open3D INFO] > Color: 1.6.102 [Open3D INFO] > Depth: 1.6.75[6109.7] Sensor initialized. Press [ESC] to exit. [2020-02-10 14:56:32.076] [error] [t=5904] D:\a\1\s\extern\Azure-Kinect-Sensor-SDK\src\allocator\allocator.c (118): k4a_capture_t_get_context(). Invalid k4a_capture_t 0000000000000000

schen119 avatar Jul 11 '20 01:07 schen119

@schen119 we will look into this as soon as we have some bandwidth. @yxlao will try to help as soon as he is free.

germanros1987 avatar Aug 07 '20 04:08 germanros1987

On Windows, the Open3D Kinect plugin will look for the Kinect K4A library located in the default installation paths:

https://github.com/intel-isl/Open3D/blob/3c6e66419a0f5669b27503f1e30dd4960b1aa4ba/cpp/open3d/io/sensor/azure_kinect/K4aPlugin.cpp#L76-L79

Currently, it supports 1.2.0 to 1.4.1. So first, check if the dll files are are found in the paths above.

If the K4A library is not in the default location, you'll need to set the K4A_LIB_DIR environment variable to point to the directory containing the K4A's *.dll files.

Some of the fixes we have are in the master branch, we'll be updating the python packages in the next release.

yxlao avatar Dec 09 '20 23:12 yxlao

Hey, i still have the same problem with azure_kinect_mkv_reader.py

Traceback (most recent call last):
  File "D:/TUM/IFL/Open3D-master/Open3D-master/examples/python/reconstruction_system/sensors/azure_kinect_mkv_reader.py", line 135, in <module>
    reader = ReaderWithCallback(args.input, args.output)
  File "D:/TUM/IFL/Open3D-master/Open3D-master/examples/python/reconstruction_system/sensors/azure_kinect_mkv_reader.py", line 27, in __init__
    self.reader.open(self.input)
RuntimeError: [Open3D ERROR] Cannot load k4arecord.dll

My environment is Win 10, python 3.7.7, open3d 0.10.0, azure sdk v.1.4.1 Even after adding path as @wearenocomputer suggested it does not work. But I can run all of the pyk4a examples https://github.com/etiennedub/pyk4a Please help, I want to get an intrinsic matrix from my kinects and seems like its the only way you can do it :(

annazielke avatar Jan 28 '21 11:01 annazielke

Hey, i still have the same problem with azure_kinect_mkv_reader.py

Traceback (most recent call last):
  File "D:/TUM/IFL/Open3D-master/Open3D-master/examples/python/reconstruction_system/sensors/azure_kinect_mkv_reader.py", line 135, in <module>
    reader = ReaderWithCallback(args.input, args.output)
  File "D:/TUM/IFL/Open3D-master/Open3D-master/examples/python/reconstruction_system/sensors/azure_kinect_mkv_reader.py", line 27, in __init__
    self.reader.open(self.input)
RuntimeError: [Open3D ERROR] Cannot load k4arecord.dll

My environment is Win 10, python 3.7.7, open3d 0.10.0, azure sdk v.1.4.1 Even after adding path as @wearenocomputer suggested it does not work. But I can run all of the pyk4a examples https://github.com/etiennedub/pyk4a Please help, I want to get an intrinsic matrix from my kinects and seems like its the only way you can do it :(

Hello, you solve it?

apystin avatar Sep 01 '21 09:09 apystin