|
From: Antão A. <ant...@gm...> - 2016-03-16 17:31:02
|
On Wed, Mar 16, 2016 at 12:54 AM Xiaofan Chen <xia...@gm...> wrote: > On Tue, Mar 15, 2016 at 10:23 PM, Antão Almada <ant...@gm...> > wrote: > > I'm using the Gritzman fork (https://github.com/Gritzman/libusb), based > on > > the OPENNI fork, that fixes the known Android file descriptor and > SELinux > > issues. Root is not required. > > In any case, I do not think you should rely on this fork, the base > version of libusb 1.0.9 is too old. > Unfortunately after all these years the official source still has no support for the issues I mentioned previously. My first plan was actually to use the official source but it crashs even before I make any change. I now suspect it's the only Android specific code in libusb that is making it crash. It uses __android_log_write() instead of __android_log_print(): http://stackoverflow.com/questions/12752043/output-of-android-log-write-not-displayed-in-logcat A problem I just found out on the Gritzman fork when I turned on ENABLE_DEBUG_LOGGING. > > I'm using Android USB Accessory mode where the connected device is > > the host and implements Android Open Accessory (AOA). My app is not > > running on the host and the issue now is that the device does not show > > up in the device enumeration... :( > > In that case,your issue has nothing to do with libusb. libusb is only > for the host side. But your Android device is not the host in this > mode. You should forget about libusb in this case. > I don't believe that's true. An Android accessory is available as a /dev/usb_accessory file: https://books.google.pt/books?id=0cuQAwAAQBAJ&pg=PA93 It requires some changes on the backend but I'm sure it is possible. > > I'm going through all this because using the Android public API I'm > > getting too many ENODEV errors. Unfortunately this is a known > > Android bug (feature?) so I'm trying to find a workaround. > > You'd better debug your host device. > I've been debugging both the host and the client for quite some time. https://code.google.com/p/android/issues/detail?id=20545&can=1&q=enodev&colspec=ID%20Status%20Priority%20Owner%20Summary%20Stars%20Reporter%20Opened You'd better be sure about what you're saying before replying to emails on the mailing list. > > -- > Xiaofan > -- Antao |