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
usb attach error #6452
Comments
Please help me to understand what is represented in the image, please.
|
In SDK 2.34.0, when the USB camera is connected, onDeviceDetach will be called , but in the old version, onDeviceAttach will be called. |
I am not an Android wrapper programmer so I cannot speak for the intent of the wrapper developers. Reading the code though, it looks like the DeviceListener listens for whether a device is inserted (Attached) or unplugged (Detached) and directs the program to the invalidateDevices() function to decide what should happen next. In that block, it either adds or removes the device depending on the checks that the logic makes about the status of variables. Does the program still work the same in 2.34.0 as it did in 2.33.1, even if the code has differences? |
No ,it will call different function. |
The code looks okay to me (though I am honestly not an Android wrapper programming expert). The listener checks for the insertion status, and takes an action depending on whether an Attach or Detach event is detected. It is possible for the USB port to mis-identify an insertion as a removal if the connector is inserted in a certain way, such as accidentally pulling the cable backwards a little after pushing it in, or not fully inserting it as far into the port as it will go. The ideal insertion method is a fast, firm push action instead of a slow insertion. If a fast, firm insertion does not fix the problem then I would recommend using Librealsense version 2.33.1 instead of 2.34.0. |
@Long888 @MartyG-RealSense This indeed looks like a bug. Even if a usb device is plugged and anyone has used the listerner to maybe receive a callback and do to some initialization etc., it will never be triggered. As both insertion and disconnection are will trigger the onDeviceDetach method. |
@kafan1986 Thanks vry much for your input on this case. Are you experiencing this detach problem with the 2.34.0 Android wrapper yourself, please? |
@MartyG-RealSense No, I have not tested it personally, so can not guarantee its behaviour. Last I used v2.31.0 SDK and firmware 5.12.1.0. |
@kafan1986 Thanks again for your help. @Long888 I recommend using 2.33.1 for now and see if your problem is fixed when the next SDK version (probably 2.35.0) is released. |
@Long888 , the issue was reproduced and addressed in the attached PR. |
@Long888 I can confirm that this bug-fix was included in SDK version 2.35.0 published on 31 May 2020. Can you test your project with SDK version 3.35.0 or the newer 2.35.2 and let us know if it has resolved your problem, please? Thanks! |
Hi @Long888 Do you require futher assistance with this case please, or can it be closed? Thanks! |
@Long888 Thanks so much for the update! |
The text was updated successfully, but these errors were encountered: