Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

context.query_devices() giving error on being called to get the connected devices #11652

Closed
KIL299 opened this issue Apr 3, 2023 · 23 comments
Closed

Comments

@KIL299
Copy link

KIL299 commented Apr 3, 2023

  • Before opening a new issue, we wanted to provide you with some useful suggestions (Click "Preview" above for a better view):

  • All users are welcomed to report bugs, ask questions, suggest or request enhancements and generally feel free to open new issue, even if they haven't followed any of the suggestions above :)


Required Info
Camera Model { L515 }
Firmware Version 01.05.08.01
Operating System & Version Win (11)
Kernel Version (Linux Only) -
Platform NUC
SDK Version { legacy / 2.0 }
Language {C#/unity }
Segment }

Issue Description

<Describe your issue / question / feature request / etc..>
I have a 8 L515 sensors setup for project. These sensors are connected using 2 usb hubs which have separate power supply. When the sensors are being initialised (i.e. on state) and we shut down the NUC, and start the application again the sensors are not being detected and in application as well as Intel's RealSense Viewer. I am using query_devices() function of SDK and its giving the below error

"Exception Reported : System.Exception: MFCreateDeviceSource(_device_attrs, &_source) returned: HResult 0x0: "The operation completed successfully." ---> System.Runtime.InteropServices.ExternalException: rs2_create_device(info_list:000002411CCB1CA0, index:7)
   --- End of inner exception stack trace ---
  at Intel.RealSense.ErrorMarshaler.MarshalNativeToManaged (System.IntPtr pNativeData) [0x000a7] in <9a520ff8d39c46b3afbe1e502bcc8f24>:0 
  at (wrapper managed-to-native) Intel.RealSense.NativeMethods.rs2_create_device(intptr,int,object&)
  at Intel.RealSense.DeviceList.get_Item (System.Int32 index) [0x00007] in <9a520ff8d39c46b3afbe1e502bcc8f24>:0 
  at RsDeviceAvailibilityCheck+d__0.MoveNext () [0x00027] in C:\Users\kunal\GluvRetail\Assets\RealSenseSDK2.0\Scripts\RsDeviceAvailibilityCheck.cs:23 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <695d1cc93cca45069c528c15c9fdd749>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <695d1cc93cca45069c528c15c9fdd749>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <695d1cc93cca45069c528c15c9fdd749>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <695d1cc93cca45069c528c15c9fdd749>:0 
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0 
  at Initialization+d__10.MoveNext () [0x001c6] in C:\Users\kunal\GluvRetail\Assets\Scripts\StateManagerScripts\Initialization.cs:266 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <695d1cc93cca45069c528c15c9fdd749>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <695d1cc93cca45069c528c15c9fdd749>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <695d1cc93cca45069c528c15c9fdd749>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <695d1cc93cca45069c528c15c9fdd749>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0 
  at Initialization+d__8.MoveNext () [0x000f9] in C:\Users\kunal\GluvRetail\Assets\Scripts"
 
 
  Also I have replicated the same setup but the problem I am having is that I am able to see only 2 sensors out of 8 in Intel RealSense Viewer and unable to get the list of connected devices in our application. I am getting the same error as above.
 
  I went through some other issues mentioned here but unable to find robust solution.

@MartyG-RealSense
Copy link
Collaborator

Hi @KIL299 May I first ask whether the shutdown is a complete shutdown that requires the power button to restart (a 'cold boot') or are you resetting the computer (but not turning it off). Thanks!

@KIL299
Copy link
Author

KIL299 commented Apr 3, 2023

@MartyG-RealSense
The NUC and the sensors both have different power supply
so yeah if we remove the power cable of the NUC such that it is abruptly turned off then on restart the query devices function is giving error .
Sometimes the queryDevices() function run but we don't get all connected devices even if those are connected.

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Apr 3, 2023

Could you test if reversing the orientation of the micro-sized USB connector in the base of the camera improves the number of cameras that are detected on reboot, please? A characteristic of the L515 camera model is that it operates better with the micro-sized end of the cable plugged in one particular insertion direction of the two directions available.

@KIL299
Copy link
Author

KIL299 commented Apr 3, 2023

@MartyG-RealSense
Could you please suggest the direction in which I should insert the micro usb because it should be a one time setup.
For our use case as this is a one time setup and the connections cannot be changed later as they are being kept away from the reach of users it will be difficult for us to check the orientation of micro USB and change them every time we encounter such issue.

So could you please suggest some other way to solve the issue other than manually unplugging and plugging the cables?
(Currently there are more than 5 setups of which 2 are working in excellent condition while the others are having problems like unable to detected the connected devices even if all sensors are physically connected , sometime the frames are not being captured even if all the sensors are physically connected and its not a problem specific to our application same can be verified on intel RealSense Viewer)

@MartyG-RealSense
Copy link
Collaborator

The correct direction is not predictable in advance and a problem may not occur on every L515 camera unit. The only way to identify if a particular camera unit has a problem with a particular insertion direction is to insert it whilst the RealSense Viewer is open and see whether '2.1' appears beside the camera name. If it does then reverse the connector to see if it correctly identifies as '3.2'.

So the correct orientations would have to be verified 'in the factory' and then fixed in place before being shipped to the customer.

The L515 camera model is now retired and is no longer manufactured and will not receive future updates / fixes, unfortunately.

@KIL299
Copy link
Author

KIL299 commented Apr 3, 2023

@MartyG-RealSense
Will check it once and get back to you soon if the solution works.
Thankyou.

@KIL299
Copy link
Author

KIL299 commented Apr 3, 2023

Is there any fixed method or set of instructions to stop a L515 device ?
Like are there any steps to be followed while stopping a RealSense device so as to avoid damaging the sensor?

@MartyG-RealSense
Copy link
Collaborator

Performing a controlled close of a RealSense program such as the Viewer or your own program (such as using the top-corner 'x' on a program window) should close down the camera pipelines.

The SDK script instructions pipeline.Stop() and then pipeline.Close() on the next line should also properly shut down a particular camera.

If you are using C# in your script though instead of C++ then a RealSense team member suggests at #4463 that there may be issues with automated clean-up when stopping a camera.

A power-off of the computer should not damage the camera. There are circumstances though where a computer is rebooted and not all cameras are re-detected the second time that the computer starts. Some RealSense users experiencing this problem found that reboot reliability increased if they enable a feature called Wake On LAN in the computer's BIOS settings.

If you are using a USB cable other than the short official one supplied with the camera then it should also be a high grade one if it is 2 meters or longer, as lower quality cables may suffer degraded performance or disconnections (again due to the volume of RealSense data bandwidth being passed through the cable).

@KIL299
Copy link
Author

KIL299 commented Apr 3, 2023

Will look into it and try them and reach out to you soon.
Thankyou @MartyG-RealSense for your insights.

@KIL299
Copy link
Author

KIL299 commented Apr 4, 2023

Hi @MartyG-RealSense
I want to know why the below error occurs what's its significance.

"Exception Reported : System.Exception: MFCreateDeviceSource(_device_attrs, &_source) returned: HResult 0x0: "The operation completed successfully." ---> System.Runtime.InteropServices.ExternalException: rs2_create_device(info_list:000002411CCB1CA0, index:7)
--- End of inner exception stack trace ---
at Intel.RealSense.ErrorMarshaler.MarshalNativeToManaged (System.IntPtr pNativeData) [0x000a7] in <9a520ff8d39c46b3afbe1e502bcc8f24>:0
at (wrapper managed-to-native) Intel.RealSense.NativeMethods.rs2_create_device(intptr,int,object&)
at Intel.RealSense.DeviceList.get_Item (System.Int32 index) [0x00007] in <9a520ff8d39c46b3afbe1e502bcc8f24>:0
at RsDeviceAvailibilityCheck+d__0.MoveNext () [0x00027] in C:\Users\kunal\GluvRetail\Assets\RealSenseSDK2.0\Scripts\RsDeviceAvailibilityCheck.cs:23
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <695d1cc93cca45069c528c15c9fdd749>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <695d1cc93cca45069c528c15c9fdd749>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <695d1cc93cca45069c528c15c9fdd749>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <695d1cc93cca45069c528c15c9fdd749>:0
at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0
at Initialization+d__10.MoveNext () [0x001c6] in C:\Users\kunal\GluvRetail\Assets\Scripts\StateManagerScripts\Initialization.cs:266
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <695d1cc93cca45069c528c15c9fdd749>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <695d1cc93cca45069c528c15c9fdd749>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <695d1cc93cca45069c528c15c9fdd749>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <695d1cc93cca45069c528c15c9fdd749>:0
at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0
at Initialization+d__8.MoveNext () [0x000f9] in C:\Users\kunal\GluvRetail\Assets\Scripts"

Could you please give a brief explanation about the error as to know why it occurs?

@KIL299
Copy link
Author

KIL299 commented Apr 4, 2023

realsense viewer

I tried changing the orientations of cables but not seeing any change near the name being displayed in intel real sense viewer

@KIL299
Copy link
Author

KIL299 commented Apr 4, 2023

8 sensors connected
realsese viewer

above attached images shows the case where we are able to see 8 sensors connected in device manager but only 2 in intel RealSense Viewer

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Apr 4, 2023

The MFCreateDeviceSource error typically occurs if there is a permissions related problem with accessing a camera. As at least two of the camera are detected, I doubt that it is a Windows camera privacy setting issue but you could check that access permissions are enabled using the instructions at #3381 (comment)

You could eliminate the possibility of corrupted camera drivers by unplugging all the L515 cameras and then going to the Windows Device Manager and selecting the View > Show Hidden Devices menu option to display all installed depth and RGB camera drivers for your L515s, even if they are not currently plugged in. Each L515 camera will have two drivers, Depth and RGB, so for 8 cameras there should be a total of 16 L515 drivers listed.

image

image

You can then right-click on each of the listed drivers and select the Uninstall device menu option to remove the drivers from the list. The drivers for each camera will be automatically reinstalled when the camera is re-inserted into the USB port.

@KIL299
Copy link
Author

KIL299 commented Apr 4, 2023

sure will check and uninstall those drivers and see if the issue gets resolved.

@KIL299
Copy link
Author

KIL299 commented Apr 6, 2023

@MartyG-RealSense
I wanted to access the temperature of L515 device
In Intel RealSense Viewer I am seeing 4 temperatures mainly APD temperature ,Humidity temperature , LDD temperature , MC temperature and MA temperature.
I am not sure which of the above represents the device temperature.I tried finding it in documentation of data sheet but didn't find it.
Can you explain what these temperature and which of the above represents the sensor temperature.
Screenshot 2023-04-06 111311

@MartyG-RealSense
Copy link
Collaborator

Descriptions for the temperatures are not officially documented but it is possible to make some educated guesses.

LLD may be Lamp Lumen Depreciation.

https://www.hepetech.com/new/what-is-led-lamp-lumen-depreciation.html

MC may be the temperature of the "Moisture Content" of the camera.

APD is likely to be "Avalanche Photodiode".

https://en.wikipedia.org/wiki/Avalanche_photodiode

A definition for MA could not be found. I would speculate that it is the ambient temperature when the camera is streaming, which will be the best measure of operating temperature.

@KIL299
Copy link
Author

KIL299 commented Apr 10, 2023

Hey @MartyG-RealSense
When I try running rs-enumerate-devices there is a parameter "Camera-Locked" whose value is always "Yes"
What does this parameter suggest?
Does this parameter affect the functioning of sensor?
If yes do we need to reset that parameter?

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Apr 10, 2023

The "Camera Locked" status is shown as Yes for most RealSense cameras. My understanding is that it simply means that it is a normal retail camera that does not have access to the advanced debug features that an Intel RealSense engineer's "unlocked" camera for internal use has. So you do not need to be concerned about the Yes status.

@MartyG-RealSense
Copy link
Collaborator

Hi @KIL299 Do you require further assistance with this case, please? Thanks!

@KIL299
Copy link
Author

KIL299 commented Apr 18, 2023

Hi @MartyG-RealSense
Recently I started testing with 2 D435 Sensors
When I am trying to access them through Realsense Viewer I am getting below error

"Invalid Value in rs2_get_option(options:000001AD01CB0160, option:Auto
Exposure Limit):
hwmon command 0x80( 5 0 0 0 ) failed (response -7= HW not ready)"

"Invalid Value in rs2_get_option(options:000001AD15990680, option:Auto Gain
Limit Toggle):
hwmon command 0x80( 5 0 0 0 ) failed (response -7= HW not ready)"

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Apr 18, 2023

These errors should disappear if the recommended firmware driver for each SDK version is installed in the camera. They occur because of changes made to auto exposure limit and auto gain limit in firmware 5.14.0.0.

2.53.1: firmware 5.14.0.0
2.51.1: firmware 5.13.0.50

@MartyG-RealSense
Copy link
Collaborator

Hi @KIL299 Do you require further assistance with this case, please? Thanks!

@MartyG-RealSense
Copy link
Collaborator

Case closed due to no further comments received.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants