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

usb attach error #6452

Closed
Long888 opened this issue May 25, 2020 · 13 comments
Closed

usb attach error #6452

Long888 opened this issue May 25, 2020 · 13 comments

Comments

@Long888
Copy link

Long888 commented May 25, 2020

20200525104911

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented May 25, 2020

Please help me to understand what is represented in the image, please.

  • Which RealSense camera model are you using?

  • It looks as though two versions of the same script file DeviceWatcher.java are being shown side by side, one of them in Librealsense SDK 2.33.1 and the other in SDK 2.34.0. This file is located in the Android wrapper at this path:

https://github.com/IntelRealSense/librealsense/blob/master/wrappers/android/librealsense/src/main/java/com/intel/realsense/librealsense/DeviceWatcher.java

  • You referred to a USB attach error. What is the error message that you are receiving, please?

@Long888
Copy link
Author

Long888 commented May 25, 2020

In SDK 2.34.0, when the USB camera is connected, onDeviceDetach will be called , but in the old version, onDeviceAttach will be called.

@MartyG-RealSense
Copy link
Collaborator

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?

@Long888
Copy link
Author

Long888 commented May 25, 2020

No ,it will call different function.

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented May 25, 2020

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.

@kafan1986
Copy link

kafan1986 commented May 25, 2020

@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.

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented May 25, 2020

@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?

@kafan1986
Copy link

@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.

@MartyG-RealSense
Copy link
Collaborator

@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.

@ev-mp
Copy link
Collaborator

ev-mp commented May 31, 2020

@Long888 , the issue was reproduced and addressed in the attached PR.
To be published in the next release

@MartyG-RealSense
Copy link
Collaborator

@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!

@MartyG-RealSense
Copy link
Collaborator

Hi @Long888 Do you require futher assistance with this case please, or can it be closed? Thanks!

@Long888 Long888 closed this as completed Jun 25, 2020
@MartyG-RealSense
Copy link
Collaborator

@Long888 Thanks so much for the update!

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

4 participants