How to diagnose K4AException for device.open() error
See original GitHub issueHello! This is a great project and I want to thank you for making this. I am getting an error in the last mile.
Summary: I’m trying to test whether I can open my Kinect DK from an Ubuntu 18.04 docker container running on an ARM64 device with pyk4a
.
Repro:
- Create an Ubuntu 18.04 docker container and run on ARM64 device (also running linux, a version of RHEL).
- Install Azure Kinect Sensor SDK according to the instructions on the GitHub repo here. Version 1.4 and installed from inside the running docker container.
- Install
py4a
withpip
with Python 3.6.9 (installed withapt-get install python3-dev
). - Run the example
devices.py
for device check.
Output and traceback:
Available devices: 1
---------------------------------------------------------------------------
K4AException Traceback (most recent call last)
<ipython-input-7-65eaaf62310e> in <module>
6 for device_id in range(cnt):
7 device = PyK4A(device_id=device_id)
----> 8 device.open()
9 print(f"{device_id}: {device.serial}")
10 device.close()
/usr/local/lib/python3.6/dist-packages/pyk4a/pyk4a.py in open(self)
66 if self.opened:
67 raise K4AException("Device already opened")
---> 68 self._device_open()
69
70 def close(self):
/usr/local/lib/python3.6/dist-packages/pyk4a/pyk4a.py in _device_open(self)
83 def _device_open(self):
84 res, handle = k4a_module.device_open(self._device_id, self.thread_safe)
---> 85 _verify_error(res)
86 self._device_handle = handle
87
/usr/local/lib/python3.6/dist-packages/pyk4a/errors.py in _verify_error(res)
16 res = Result(res)
17 if res == Result.Failed:
---> 18 raise K4AException()
19 elif res == Result.Timeout:
20 raise K4ATimeoutException()
K4AException:
I also tried from the command line and Python interpreter inside the docker container:
Python 3.6.9 (default, Jan 26 2021, 15:33:00)
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from pyk4a import PyK4A, connected_device_count
>>> cnt = connected_device_count()
>>> print(cnt)
1
>>> device = PyK4A(device_id=0)
>>> device.open()
[2021-04-10 16:15:38.616] [error] [t=18753] /__w/1/s/extern/Azure-Kinect-Sensor-SDK/src/usbcommand/usbcommand.c (370): find_libusb_device(). Unable to open LIBUSB at index 0
[2021-04-10 16:15:38.618] [error] [t=18753] /__w/1/s/extern/Azure-Kinect-Sensor-SDK/src/depth_mcu/depth_mcu.c (68): usb_cmd_create(USB_DEVICE_DEPTH_PROCESSOR, device_index, NULL, &depthmcu->usb_cmd) returned failure in depthmcu_create()
[2021-04-10 16:15:38.618] [error] [t=18753] /__w/1/s/extern/Azure-Kinect-Sensor-SDK/src/sdk/k4a.c (133): depthmcu_create(index, &device->depthmcu) returned failure in k4a_device_open()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.6/dist-packages/pyk4a/pyk4a.py", line 68, in open
self._device_open()
File "/usr/local/lib/python3.6/dist-packages/pyk4a/pyk4a.py", line 85, in _device_open
_verify_error(res)
File "/usr/local/lib/python3.6/dist-packages/pyk4a/errors.py", line 18, in _verify_error
raise K4AException()
pyk4a.errors.K4AException
Please let me know if you wish for more information. This is likely an SDK issue, but if you have any clues I’d be really grateful. Thanks so much! Best regards.
Issue Analytics
- State:
- Created 2 years ago
- Comments:12 (1 by maintainers)
Top Results From Across the Web
How to diagnose K4AException for device.open() error
Install Azure Kinect Sensor SDK according to the instructions on the GitHub repo here. Version 1.4 and installed from inside the running docker...
Read more >Azure Kinect Sensor SDK: k4a::device - Microsoft Open Source
Open a k4a device. Throws error on failure. See also: k4a_device_open. k4a; device; Generated by doxygen 1.8.
Read more >etiennedub/pyk4a: Python 3 wrapper for Azure-Kinect ... - GitHub
pyk4a. CI codecov · pyk4a. This library is a simple and pythonic wrapper in Python 3 for the Azure-Kinect-Sensor-SDK. Images are returned as...
Read more >azure kinect Failed to open device! - Microsoft Q&A
we open the cmd windows to find some errors bellow. 3 devices has ... (360): find_libusb_device(). libusb device(s) are all unavalable.
Read more >Azure Kinect unable to open device error - TouchDesigner forum
You can also set the environment variable K4A_ENABLE_LOG_TO_A_FILE to 1 to enable debug logging which might give more information.It will create ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
-v /dev/bus/usb:/dev/bus/usb --privileged
X
server. You can play withX
server inside your container.Closing the issue because it is probably not caused by pyk4a. But let’s continue the discussion.