-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
[C++] set_devices_changed_callback fire behavior different between backends after device.hardware_reset() #6921
Comments
Hi @MojamojaK The link below describes the advantages and disadvantages of the backend installation method compared to the traditional method of compiling from source. It may provide useful insights about the differences of RSUSB true vs false that you have encountered. Please scroll down through the linked-to comment to the section headed What are the advantages and disadvantages of using libuvc vs patched kernel modules? |
I understand that there are differences between the two backends. I mean, there are reasons to having both of them.
Currently with I personally think this is a bug, but is kind of open to interpretation since there is no official documentation for the |
This particular topic is outside of my programming knowledge unfortunately. One of the other RealSense team members such as @dorodnic may be able to advise on the question above. |
Hi @MojamojaK Base implementation of device callbacks relies on repeated polling on connected devices. This method is good because its portable across OS-es, but has the drawback of sometimes missing events if camera reconnected before next polling cycle occurs. On Windows, specifically Win 10, we have implementation that takes advantage of WinAPI functions to get these events faster. RSUSB doesn't do that since it tries to be cross-platform, except for the low level USB library (WinUSB/libusb/USBHost) My opinion is that it falls within expectations from the API. If Win10 backend is available to you, it is recommended to use it, RSUSB has other issues in addition to enumeration events. Of course, this project is open-source, and you are welcomed to customise it to your needs. To get this functionality on with RSUSB on Windows, you'd need to take |
Thanks very much for the guidance. |
Great Line 1544 in f7cdf6e
Right now RSUSB is checking device changes every 5 seconds. Reducing this constant will reduce chance of missing events, but it will increase (slightly) idle CPU utilisation |
Yes, I kind of noticed that. |
It seems like a good idea. This timeout used to be lower, but these queries do end-up, in terms of CPU utilisation. Please consider creating a pull-request. |
Just leaving a note that this case should be kept open whilst the pull request is still active. Thanks for contributing the pull @MojamojaK :) |
Note to @dorodnic that the PR of @MojamojaK has passed checks and is awaiting an approving review in order for merging to proceed. Thanks! |
Adding a reminder for @dorodnic that the pull of @MojamojaK has passed checks and is awaiting an approving review in order for merging to proceed. Thanks! |
@dorodnic - please see comment above. Thank you. |
Reminder for @dorodnic that the pull of @MojamojaK has passed checks and is awaiting an approving review in order for merging to proceed. Thanks! |
Issue Description
I was comparing behavior between
FORCE_RSUSB_BACKEND=true/false
It seems like the callback set at
context.set_devices_changed_callback(T callback)
will only be called after adevice.hardware_reset()
whenFORCE_RSUSB_BACKEND=false
.With
FORCE_RSUSB_BACKEND=true
, the callback won't be fired.I think the behavior should at least be consistent between the two backends.
The text was updated successfully, but these errors were encountered: