Testing on Nexus5x

questions or suggestion about ASICAP software

Moderators: chad, walkfaraway

Testing on Nexus5x

Postby chripell » Sun Feb 12, 2017 11:15 am

I happily tested the Android demo app on Nexus 5X running PureNexus based on Android N. :-)

The only problem I had was with permissions. I anticipated this kind of problem because Android is pretty picky on this (even if my phone is rooted) and was curious how Zwo worked around it (at first I was thinking they rewrote the drivers in Java with the API https://developer.android.com/guide/top ... /host.html, but this is actually native code). It manifested with an error in libusb, which neatly points to this kind of problems:

02-12 10:08:33.530 28213 28213 F DEBUG : Build fingerprint: 'google/bullhead/bullhead:7.1.1/NMF26F/3425388:user/release-keys'
02-12 10:08:33.530 28213 28213 F DEBUG : Revision: 'rev_1.0'
02-12 10:08:33.530 28213 28213 F DEBUG : ABI: 'arm64'
02-12 10:08:33.530 28213 28213 F DEBUG : pid: 28195, tid: 28211, name: Thread-5 >>> com.example.mycamera <<<
02-12 10:08:33.531 28213 28213 F DEBUG : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x4
02-12 10:08:33.531 28213 28213 F DEBUG : x0 0000000000000000 x1 0000000000000000 x2 0000007f10c8e804 x3 0000000000000000
02-12 10:08:33.531 28213 28213 F DEBUG : x4 0000000000000058 x5 8080808080808080 x6 0000007f2aeb915e x7 0000000000000008
02-12 10:08:33.531 28213 28213 F DEBUG : x8 0000000000000000 x9 0000000000000002 x10 0000000000000063 x11 0101010101010101
02-12 10:08:33.531 28213 28213 F DEBUG : x12 0000000000000000 x13 000000000ccccccc x14 000000008000002f x15 0000007f2b64a1e8
02-12 10:08:33.531 28213 28213 F DEBUG : x16 0000007f23a43158 x17 0000007f2963081c x18 0000000000000000 x19 0000007f10ca0008
02-12 10:08:33.531 28213 28213 F DEBUG : x20 0000007f10ca0000 x21 0000000000000001 x22 0000000000000000 x23 0000007f23a4e118
02-12 10:08:33.531 28213 28213 F DEBUG : x24 0000000000000000 x25 0000007f23a4df14 x26 cfb405e02d05008f x27 cfb405e02d05008f
02-12 10:08:33.531 28213 28213 F DEBUG : x28 0000000000000001 x29 0000007f29773460 x30 0000007f239f60cc
02-12 10:08:33.531 28213 28213 F DEBUG : sp 0000007f29773440 pc 0000007f29630830 pstate 0000000060000000
02-12 10:08:33.535 28213 28213 F DEBUG :
02-12 10:08:33.535 28213 28213 F DEBUG : backtrace:
02-12 10:08:33.535 28213 28213 F DEBUG : #00 pc 0000000000006830 /data/app/com.example.mycamera-1/lib/arm64/libusb-1.0.so (libusb_set_debug+20)
02-12 10:08:33.535 28213 28213 F DEBUG : #01 pc 000000000006f0c8 /data/app/com.example.mycamera-1/lib/arm64/libASICamera2.so (_ZN11CCameraBase10OpenCameraEi+72)
02-12 10:08:33.535 28213 28213 F DEBUG : #02 pc 000000000002422c /data/app/com.example.mycamera-1/lib/arm64/libASICamera2.so (ASIOpenCamera+1504)
02-12 10:08:33.535 28213 28213 F DEBUG : #03 pc 0000000000023ba4 /data/app/com.example.mycamera-1/lib/arm64/libASICamera2.so (ASIGetCameraProperty+180)
02-12 10:08:33.535 28213 28213 F DEBUG : #04 pc 0000000000002a70 /data/app/com.example.mycamera-1/lib/arm64/libzwo_camera.so (Java_com_zwo_ZwoCamera_getCameraProperty+64)
02-12 10:08:33.535 28213 28213 F DEBUG : #05 pc 0000000000404aa4 /data/app/com.example.mycamera-1/oat/arm64/base.odex (offset 0x3dc000)

The trick is putting SELinux in non enforcing mode, but then I make the usb devices word writable. With the ASI1600MC:

bullhead:/ # lsusb
Bus 001 Device 002: ID 14cd:8601
Bus 001 Device 001: ID 1d6b:0002
Bus 002 Device 001: ID 1d6b:0003
Bus 001 Device 007: ID 2109:2813
Bus 001 Device 005: ID 2109:0100
Bus 001 Device 008: ID 03c3:1601
bullhead:/ # cd /dev/bus/usb/001
bullhead:/dev/bus/usb/001 # chmod a+rw *
bullhead:/dev/bus/usb/001 # setenforce 0
bullhead:/dev/bus/usb/001 # echo 200 >/sys/module/usbcore/parameters/usbfs_memory_mb

I am pretty enthusiastic with this development. Not much because of Astro Imaging (the UI from the laptop is still better IMHO) but my plan is to used ASI Cameras for IR/UV photography, timelapse, median to have photos without people, etc. Doing that via the phone instead of laptop is super cool. :-)
Attachments
P1040090.JPG
chripell
 
Posts: 77
Joined: Tue Sep 17, 2013 4:50 pm

Re: Testing on Nexus5x

Postby ray » Tue Feb 14, 2017 3:40 pm

Thanks for your testing, We have tested the demo in some Android L and Android M devices with SELinux putting in enforcing mode successfully before, but Android N has more stringent security policies. I'm glad you have a "rooted" Android device so you can solve this problem. We will try to figure out a universal resolution of permission issues. A official release with better UI will be offered in the future.
ray
 
Posts: 14
Joined: Tue Feb 14, 2017 5:26 am


Return to ASICAP

Who is online

Users browsing this forum: No registered users and 1 guest