-
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
Android error handling fix #4032
Android error handling fix #4032
Conversation
matkatz
commented
May 21, 2019
- reset the streaming endpoint in case of overflow.
- fix wrong error handling on android usb transfer commands
- release device/sensor instances that kept alive in the camera app
messenger->reset_endpoint(read_ep, reset_ep_timeout); | ||
break; | ||
case librealsense::platform::RS2_USB_STATUS_SUCCESS: | ||
strctx->stream->got_bytes = transferred; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gottransferred_bytes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the name in all of our UVC implementations, we can change it when moving to rsuvc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am using libuvc under Android, how can I handle the error?
src/android/usb_host/android_uvc.cpp
Outdated
@@ -938,19 +938,27 @@ void stream_thread(usbhost_uvc_stream_context *strctx) { | |||
} | |||
}); | |||
LOG_DEBUG("Transfer thread started for endpoint address: " << strctx->endpoint); | |||
bool disconnect = false; | |||
do { | |||
auto i = strctx->stream->stream_if->interface; | |||
uint32_t transferred = 0; | |||
auto sts = messenger->bulk_transfer(read_ep, strctx->stream->outbuf, LIBUVC_XFER_BUF_SIZE, transferred, 1000); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you use hard-coded timeouts ? (1000, 50)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will create a define, it is not accessible to the app level