From: Alon S. <al...@op...> - 2014-11-24 07:57:17
|
Hi all, I'm currently have an Android application connecting to one of our products via USB OTG. The communication is done using the libusb 1.0.9 and it's working pretty well. When running the app under Android L, I get the following error from libusb_init(NULL): type=1400 audit(0.0:107): avc: denied { read } for name="usb" dev="tmpfs" ino=24433 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:usb_device:s0 tclass=dir A/libc(12605): Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 12605 (mapp.sdk.sample) I'm compiling libusb 1.0.9 using latest NDK 10c and testing on Nexus 5. I don't think it's ART runtime issue as the app works on Android 4.4.4 with ART enabled instead of dalvik. Anyone familiar with this issue? Thanks in advance, Alon. |
From: Xiaofan C. <xia...@gm...> - 2014-11-26 03:21:47
|
On Mon, Nov 24, 2014 at 3:42 PM, Alon Shahaf <al...@op...> wrote: > I'm compiling libusb 1.0.9 using latest NDK 10c and testing on Nexus 5. > Just want to point out the latest version is libusb-1.0.19 and there is Android support in libusb-1.0.19. You should try that first to see if that helps. libusb official website: http://libusb.info/ Download: http://sourceforge.net/projects/libusb/ Git repo: https://github.com/libusb/libusb Wiki: https://github.com/libusb/libusb/wiki -- Xiaofan |
From: Zygmunt P. <zyg...@gm...> - 2014-11-26 11:11:52
|
Hi Alon, I have a question for you. Did you root your device? Or not? If not, can you tell me how to use libusb on android? Regards Zygmunt 2014-11-26 4:21 GMT+01:00 Xiaofan Chen <xia...@gm...>: > On Mon, Nov 24, 2014 at 3:42 PM, Alon Shahaf <al...@op...> wrote: > > I'm compiling libusb 1.0.9 using latest NDK 10c and testing on Nexus 5. > > > > Just want to point out the latest version is libusb-1.0.19 and there > is Android support in libusb-1.0.19. You should try that first to see > if that helps. > > libusb official website: http://libusb.info/ > Download: http://sourceforge.net/projects/libusb/ > Git repo: https://github.com/libusb/libusb > Wiki: https://github.com/libusb/libusb/wiki > > > > -- > Xiaofan > > > ------------------------------------------------------------------------------ > Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server > from Actuate! Instantly Supercharge Your Business Reports and Dashboards > with Interactivity, Sharing, Native Excel Exports, App Integration & more > Get technology previously reserved for billion-dollar corporations, FREE > > http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk > _______________________________________________ > libusb-devel mailing list > lib...@li... > https://lists.sourceforge.net/lists/listinfo/libusb-devel > |
From: Xiaofan C. <xia...@gm...> - 2014-12-03 04:45:03
|
On Wed, Nov 26, 2014 at 7:11 PM, Zygmunt Ptak <zyg...@gm...> wrote: > Hi Alon, > I have a question for you. > Did you root your device? > Or not? If not, can you tell me how to use libusb on android? > No you can not use libusb on non-root Android device now (unless you control the system image). https://github.com/libusb/libusb/blob/master/android/README -- Xiaofan |
From: Toby G. <tob...@re...> - 2014-12-03 11:26:11
|
On 03/12/14 04:44, Xiaofan Chen wrote: > On Wed, Nov 26, 2014 at 7:11 PM, Zygmunt Ptak <zyg...@gm...> wrote: >> Hi Alon, >> I have a question for you. >> Did you root your device? >> Or not? If not, can you tell me how to use libusb on android? >> > No you can not use libusb on non-root Android device now (unless > you control the system image). > https://github.com/libusb/libusb/blob/master/android/README In addition to the information in that file, I believe that Android L devices may require changes to the SELinux policy. Regards, Toby |
From: Burhan E. <bur...@gm...> - 2014-12-03 13:21:59
|
---------- Forwarded message ---------- From: Burhan Eyuboglu <bur...@gm...> Date: 2014-12-03 14:46 GMT+02:00 Subject: Re: [libusb] libusb issues on Android L To: Toby Gray <tob...@re...> Did any one of you use libusb-1.0.so in the Android development in Xamarin? It gives the following error: libusb-1.0.so is not a valid ELF executable. 2014-12-03 13:25 GMT+02:00 Toby Gray <tob...@re...>: > On 03/12/14 04:44, Xiaofan Chen wrote: > > On Wed, Nov 26, 2014 at 7:11 PM, Zygmunt Ptak <zyg...@gm...> > wrote: > >> Hi Alon, > >> I have a question for you. > >> Did you root your device? > >> Or not? If not, can you tell me how to use libusb on android? > >> > > No you can not use libusb on non-root Android device now (unless > > you control the system image). > > https://github.com/libusb/libusb/blob/master/android/README > > In addition to the information in that file, I believe that Android L > devices may require changes to the SELinux policy. > > Regards, > > Toby > > > ------------------------------------------------------------------------------ > Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server > from Actuate! Instantly Supercharge Your Business Reports and Dashboards > with Interactivity, Sharing, Native Excel Exports, App Integration & more > Get technology previously reserved for billion-dollar corporations, FREE > > http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk > _______________________________________________ > libusb-devel mailing list > lib...@li... > https://lists.sourceforge.net/lists/listinfo/libusb-devel > |
From: Alon S. <al...@op...> - 2014-12-03 17:52:32
|
Hi again, We are using libusb 1.0.9 (with minor patches) in our application without root. You can check out this project: https://github.com/OpenNI/OpenNI2/tree/master/ThirdParty/PSCommon/XnLib/ThirdParty/libusb-1.0.9-Android/libusb There are some patches to get the descriptors differently, I'm guessing this is why root is not needed. On the Android L issue, Google set the SELinux mode to enforcing, which is blocking the libusb_init() call. If your device is rooted, you can try installing SELinux Mode Changer from the google play and setting the mode to Premissive. I didn't try updating to 1.0.19, but after googling the problem I think the same problem exists there too. As far as I know, even root won't help to bypass this. We did however progressed by getting the access on Java API, and modified libusb_init to continue from there. This works but the connection hangs after a random time (from 5s to few minutes). I'll post more details about this solution later. Is anyone using libusb on Android L successfully? |
From: jyeoh <ye...@el...> - 2014-12-08 22:53:51
|
There is already a fix in this libusb fork: https://github.com/martinmarinov/rtl_tcp_andro- Now, not only you will need to pass the file descriptor, you will need to pass the device file path as well via UsbDevice.getDeviceName(). -- View this message in context: http://libusb.6.n5.nabble.com/libusb-libusb-issues-on-Android-L-tp5713931p5713970.html Sent from the LibUSB Dev mailing list archive at Nabble.com. |