-
Notifications
You must be signed in to change notification settings - Fork 398
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
call hid_close(libusb/hid.c) stuck on android #595
Comments
How do you use hidapi under Android? What is the Android device you use for testing? Take note there are limitations on how to use hidapi under un-rooted Android devices. |
@mcuee The way I use hidapi on android is the same with #178 (comment). use java to get fd, and pass to native hidapi,and call hid_libusb_wrap_sys_device; |
Can you verify that you're not trying to call |
Any updates? Thanks. |
@mcuee I use https://github.com/libusb/hidapi/pull/457/commits to fix my problem. thanks. my code is older than master/latest |
but now,I cause the new cause . even if I use https://github.com/libusb/hidapi/pull/457/commits. also encouter stuck when call hid_close on android. and before stuck , I use hid_write always return -1. and the errno is 9(Bad file descriptor). and after a few seconds usb device has been plugged out. and then I call hid_close stuck . I found it stuck at |
maybe will call hid_write when call hid_close. is this not right calling logic? |
HIDAPI is not thread-safe. |
as the title show, I use hidapi (libusb/hid.c) to communicate with my usb hid device on android, sometimes, I call hid_close will stuck, It stuck at
hidapi_thread_join(&dev->thread_state);
and when stucking, The "read_thread" thread is running the below loop:
and not jump out。
sometimes, It works fine . In this situation, call hid_close , the read_callback fuction with transfer->status = LIBUSB_TRANSFER_CANCELLE is been called.
But when cause this stuck problem, the read_callback fuction with transfer->status = LIBUSB_TRANSFER_CANCELLE is not been called!
anyone cause the same problem? thanks a lot.
The text was updated successfully, but these errors were encountered: