microsoft / Azure-Kinect-Sensor-SDK

A cross platform (Linux and Windows) user mode SDK to read data from your Azure Kinect device.
https://Azure.com/Kinect
MIT License
1.49k stars 619 forks source link

capture error when multi-device using multi-thread to capture #550

Closed YuXinFan closed 5 years ago

YuXinFan commented 5 years ago

Describe the bug When installing multi-device (at the first time, 4 devices/at the second time, 6 devices), create a thread for each device to do capturing. Store captures in a short queue. And the main thread gets the capture result from the queue. The function capturesync_get_capture() sometimes gets error.

To Reproduce

  1. Install multi-devices, 6 devices in my problem, connect and set them as external sync.
  2. Set the "synchronized_images_only" to true.
  3. Set Image Format to RGBA32, Set color resolution to 2016P, set depth resolution to NFOV_UNBINNED
  4. Start all devices, Create a thread for each device to do capturing
  5. Start running program to do capture. This error occurs.

Expected behavior

the program can get captures and runs without error. Logs

[error] [t=9128] D:\a\1\s\extern\Azure-Kinect-Sensor-SDK\src\capturesync\capturesync.c (143): replace_sample(). capturesync_drop, releasing capture early due to full queue TS: 2684400 type:Depth

Screen image

Desktop (please complete the following information):

Additional context When I use 4 cameras with 720p color resolution, NFOV_2X2BINNED depth mode, this error did not occur. But when I increase to 6 devices, 2160p, NFOV_UNBINNED, this error occurs

wes-b commented 5 years ago

You have too many devices on a single PC. USB can not keep up.

Get Outlook for Androidhttps://aka.ms/ghei36


From: fanyx notifications@github.com Sent: Saturday, July 27, 2019 1:02:13 AM To: microsoft/Azure-Kinect-Sensor-SDK Azure-Kinect-Sensor-SDK@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: Re: [microsoft/Azure-Kinect-Sensor-SDK] capture error when multi-device using multi-thread to capture (#550)

Additional information When I increase the number of kinect device to 6, and increase the image resolution from 720p to 2160p. An error always occurs when capturing

Logs [error] [t=9128] D:\a\1\s\extern\Azure-Kinect-Sensor-SDK\src\capturesync\capturesync.c (143): replace_sample(). capturesync_drop, releasing capture early due to full queue TS: 2684400 type:Depth

Screen [image]https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fuser-images.githubusercontent.com%2F22362306%2F61991775-c1341400-b087-11e9-9e8c-eebafa108f4c.png&data=02%7C01%7CWes.Barcalow%40microsoft.com%7C2ea916a00d8d4568abae08d71268bc6a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636998113353824631&sdata=6F67WKe4d4KWvaEx9tNLs83gijzoRzf7%2F1vlZU1UdEE%3D&reserved=0

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FAzure-Kinect-Sensor-SDK%2Fissues%2F550%3Femail_source%3Dnotifications%26email_token%3DACVJTJJH33O45N2A54CSHKDQBP6ILA5CNFSM4IHIJPA2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD26GQJY%23issuecomment-515663911&data=02%7C01%7CWes.Barcalow%40microsoft.com%7C2ea916a00d8d4568abae08d71268bc6a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636998113353834627&sdata=pc8HYucAAcqey3KV1oz3LZf4MlKbSQD1JDUFqqMx5uQ%3D&reserved=0, or mute the threadhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FACVJTJPDX3RG7B67LOOOFATQBP6ILANCNFSM4IHIJPAQ&data=02%7C01%7CWes.Barcalow%40microsoft.com%7C2ea916a00d8d4568abae08d71268bc6a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636998113353834627&sdata=2GcZUgKpMXyQBMdLMq4G16gfaRPDPoLhfnM4uslNHjs%3D&reserved=0.

YuXinFan commented 5 years ago

For your information, I connect 4 PCIe Data acquisitions to the PC. USBs are connected to data acquisitions. I think it may be ok.

cdedmonds commented 5 years ago

@YuXinFan it is possible you are exceeding the available PCIe bandwidth on the machine.

wes-b commented 5 years ago

We are happy that you had 4 devices running on a single PC.

kalisina commented 2 years ago

Hey @YuXinFan Did you manage to fix the issue? I've got the same when running 6 sensors at 1080p

YuXinFan commented 2 years ago

Hey @YuXinFan Did you manage to fix the issue? I've got the same when running 6 sensors at 1080p

@arkader I forgot the detail and I have left the project, but it has been fixed.

I remember that this error only occurs at the starting process. It has some probability of error or normally starts in my PC. if the device runs normally, it won't cause this error in the following running.

Maybe you can add a mechanism in your code to catch the error and mechanism restart it until normally start.