Skip to content
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

on Android USB 3.2, the example capture constantly report "bulk_transfer returned error, error: Out of memory" #4091

Closed
Mad-Thanos opened this issue May 28, 2019 · 69 comments
Labels

Comments

@Mad-Thanos
Copy link

Mad-Thanos commented May 28, 2019

Required Info
Camera Model D415
Firmware Version 5.11.04
Operating System & Version MacOS 10.13.6+Android Studio 3.4.1
Kernel Version (Linux Only) N/A
Platform Andriod 8.1(linux kernel 4.5) +USB 3.1 Gen2 c-to-c cable
SDK Version 2.22.0
Language java &c++ }
Segment Smartphone

Issue Description

short version:

I ran the wrappers/android/examples/capture app on a Android Phone(has a usb 3.1 compatible type-c female interface) with D415 plugged in. But there was only black screen on the UI, which means the text "Connect to a Realsense Camera" was gone but no video data rendered. And at the same time, I found in the logcat of Android studio there reported constantly a plenty of warning messages:

2019-05-29 00:01:49.276 27981-28475/com.intel.realsense.capture W/librs: bulk_transfer returned error, endpoint: �, error: Out of memory

the full log was something as follow:

Click me to expand
2019-05-29 00:01:45.036 27981-28098/com.intel.realsense.capture D/librs DeviceWatcher: Device: /dev/bus/usb/003/002 added successfully
2019-05-29 00:01:49.237 27981-27981/com.intel.realsense.capture I/librs: Found UVC Device vid: id- 
    vid- 8086
    pid- ad3
    mi- 0
    unique_id- /dev/bus/usb/003/002
    path- /dev/bus/usb/003/002
    susb specification- 320
2019-05-29 00:01:49.237 27981-27981/com.intel.realsense.capture I/librs: Found UVC Device vid: id- 
    vid- 8086
    pid- ad3
    mi- 3
    unique_id- /dev/bus/usb/003/002
    path- /dev/bus/usb/003/002
    susb specification- 320
2019-05-29 00:01:49.239 27981-27981/com.intel.realsense.capture I/librs: Found UVC Device vid: id- 
    vid- 8086
    pid- ad3
    mi- 0
    unique_id- /dev/bus/usb/003/002
    path- /dev/bus/usb/003/002
    susb specification- 320
2019-05-29 00:01:49.239 27981-27981/com.intel.realsense.capture I/librs: Found UVC Device vid: id- 
    vid- 8086
    pid- ad3
    mi- 3
    unique_id- /dev/bus/usb/003/002
    path- /dev/bus/usb/003/002
    susb specification- 320
2019-05-29 00:01:49.241 27981-27981/com.intel.realsense.capture D/librs capture example: try start streaming
2019-05-29 00:01:49.241 27981-27981/com.intel.realsense.capture I/librs: Found UVC Device vid: id- 
    vid- 8086
    pid- ad3
    mi- 0
    unique_id- /dev/bus/usb/003/002
    path- /dev/bus/usb/003/002
    susb specification- 320
2019-05-29 00:01:49.241 27981-27981/com.intel.realsense.capture I/librs: Found UVC Device vid: id- 
    vid- 8086
    pid- ad3
    mi- 3
    unique_id- /dev/bus/usb/003/002
    path- /dev/bus/usb/003/002
    susb specification- 320
2019-05-29 00:01:49.276 27981-28475/com.intel.realsense.capture W/librs: bulk_transfer returned error, endpoint: �, error: Out of memory
......  many many repeated warning message as the above line.....

My Question is: Has anybody ever seen this problem before? What should I do to fix this?

Longer version:

My setup:

"Android Phone Huawei P20 + USB 3.1 Gen 2 C Male to C Male cable + Realsense D415".
I've smiply checked the cable, it is compliant with USB 3.1 Gen 2 10/20Gbps 5A 100W.
I've also checked the Huawei P20's type c interface by plugging it into my Macbook and checking the 'USB 3.0 Bus' section of System Report of the MacBook. It showed the Speed is up to 5Gbps of "Huawei P20+ the c-to-c cable" combination. I guess that means either Huawei P20 or my Macbook has a USB 3.1 Gen 1 or USB 3.0 interface.

What I did and what I saw:

I downloaded the librealsense-2.22.0.aar and librealsense-2.22.0.zip from dl.bintray.com.
After that, I import them into the android project of wrappers/android, making both examples/native-example and examples/capture Modules to depend on them.

Then I modified the examples/native-example's source code to enumerate the device, the sensors and the stream profiles of each sensor. And save the enumerated result to a log file: usb3.2-P20-enumerate-log.txt
In a word, I could tell that the highest profiles (1280x720xZ16x30Hz Depth stream and the 1920x1080xRGB8x30Hz Color stream) are available.

In the next step, I build and ran examples/capture on the Huawei P20. After granting the USB permission the capture app, the screen was black and the message
“27981-28475/com.intel.realsense.capture W/librs: bulk_transfer returned error, endpoint: �, error: Out of memory” was flooding the Logcat.

@matkatz
Copy link
Contributor

matkatz commented May 29, 2019

Hi @GucciPrada
That seems to be the same issue that was reported in #3612.
I'm still not able to reproduce it on my RK3399 setup and I plan to try some other devices.
Did you see this issue on earlier versions of librealsense?

@Mad-Thanos
Copy link
Author

Hi,@matkatz thanks for your reply. I just read that similar issue you mentioned.
I didn't try earlier version of librealsense or firmware. I'll try it out today. And I'm also keep finding other android devices that support usb3.1/3.2 to try. I'll post any news I get at here.

For additional information,
1.I've tried some android phones that only support usb 2.1(e.g. Oppo Find X/Vivo Nex), the 'capture' example are working nicely, successfully and stably delivering RGBD stream of VGA(640x480)@30hz. That's quite a nice work from you guys!
However I wanna a higher resolution RGBD stream(.i.e 720p or 1080p).
Have you or other people successfully made the D415+android deliver 720P or 1080P RGBD stream @30fps? which android device do they use? and the cable?

@matkatz
Copy link
Contributor

matkatz commented May 30, 2019

I tried to reproduce this issue on Pixel 2 (Android 9), Samsung S8 (Android 9) and FireFly RK3399 (Android 8.1) with no success.
I will try to get other platforms next week and hopefully reproduce the issue.
As for the high resolution streaming, all of the platforms above were capable to stream 720p depth with 1080p color but with significant frame drops, I get about 20 FPS for the depth stream and 15 FPS for the color.

@Mad-Thanos
Copy link
Author

I tried to reproduce this issue on Pixel 2 (Android 9), Samsung S8 (Android 9) and FireFly RK3399 (Android 8.1) with no success.
I will try to get other platforms next week and hopefully reproduce the issue.
As for the high resolution streaming, all of the platforms above were capable to stream 720p depth with 1080p color but with significant frame drops, I get about 20 FPS for the depth stream and 15 FPS for the color.

Thank you! That is quite informative. What about the USB 3.0 cable or adapter you used? any advice or recommendation?

@matkatz
Copy link
Contributor

matkatz commented Jun 2, 2019

I'm not sure what type my cable is it but you can probably test your cable with realsense-viewer over Windows/Linux

@Mad-Thanos
Copy link
Author

OK, Thank you! I tested my cable with realsense-viewer on Macbook. I'll test it on Windows later.

@Mad-Thanos
Copy link
Author

I tried with my new Android Phone, Honor V20 (another brand of Huawei), the device was enumerated as usb2.1 device but actually the Phone is declared to support USB 3.1 Gen1. And this time, the same 'out-of-memory' problem happened with firmware 5.11.4 & librealsense 2.22.0 or 2.21.0. Here is the log while running firmware 5.11.4+librealsense 2.21.0:

Click me to expand
2019-06-04 14:14:57.981 28713-28713/com.intel.realsense.capture I/librs Enumerator: onReceive: android.hardware.usb.action.USB_DEVICE_ATTACHED
2019-06-04 14:14:58.140 28713-28713/com.intel.realsense.capture I/librs UsbUtilities: grantUsbPermissions:
    device: UsbDevice[mName=/dev/bus/usb/002/002,mVendorId=32902,mProductId=2771,mClass=239,mSubclass=2,mProtocol=1,mManufacturerName=Intel(R) RealSense(TM) Depth Camera 415 ,mProductName=Intel(R) RealSense(TM) Depth Camera 415 ,mVersion=50.114,mSerialNumber=null,mSubProductId =-1,mConfigurations=[
    UsbConfiguration[mId=1,mName=null,mAttributes=192,mMaxPower=55,mInterfaces=[
    UsbInterface[mId=0,mAlternateSetting=0,mName=Intel(R) RealSense(TM) Depth Camera 415  Depth,mClass=14,mSubclass=1,mProtocol=0,mEndpoints=[
    UsbEndpoint[mAddress=135,mAttributes=3,mMaxPacketSize=64,mInterval=6]]
    UsbInterface[mId=1,mAlternateSetting=0,mName=Intel(R) RealSense(TM) Depth Camera 415  Depth,mClass=14,mSubclass=2,mProtocol=0,mEndpoints=[
    UsbEndpoint[mAddress=130,mAttributes=2,mMaxPacketSize=512,mInterval=0]]
    UsbInterface[mId=2,mAlternateSetting=0,mName=Intel(R) RealSense(TM) Depth Camera 415  Y,mClass=14,mSubclass=2,mProtocol=0,mEndpoints=[
    UsbEndpoint[mAddress=131,mAttributes=2,mMaxPacketSize=512,mInterval=0]]
    UsbInterface[mId=3,mAlternateSetting=0,mName=Intel(R) RealSense(TM) Depth Camera 415  RGB,mClass=14,mSubclass=1,mProtocol=0,mEndpoints=[]
    UsbInterface[mId=4,mAlternateSetting=0,mName=Intel(R) RealSense(TM) Depth Camera 415  RGB,mClass=14,mSubclass=2,mProtocol=0,mEndpoints=[
    UsbEndpoint[mAddress=132,mAttributes=2,mMaxPacketSize=512,mInterval=0]]]]
2019-06-04 14:15:18.593 28713-28713/com.intel.realsense.capture W/ActivityThread: handleWindowVisibility: no activity for token android.os.BinderProxy@e6c6c4e
2019-06-04 14:15:18.621 28713-28713/com.intel.realsense.capture I/librs Enumerator: onReceive: USB_CONTROL_PERMISSION
2019-06-04 14:15:18.623 28713-28752/com.intel.realsense.capture I/librs MessagesHandler: handleMessage: realsense device attached
2019-06-04 14:15:18.623 28713-28752/com.intel.realsense.capture I/librs Enumerator: notifyOnAttach
2019-06-04 14:15:18.624 28713-28752/com.intel.realsense.capture I/usbhost: usb_device_new /dev/bus/usb/002/002 fd: 64
2019-06-04 14:15:18.624 28713-28752/com.intel.realsense.capture I/usbhost: usb_device_new read returned 1230 errno 19
2019-06-04 14:15:18.645 28713-28752/com.intel.realsense.capture I/librs: Found UVC Device vid: id- 
    vid- 8086
    pid- ad3
    mi- 0
    unique_id- @
    path- /dev/bus/usb/002/002
    susb specification- 210
2019-06-04 14:15:18.645 28713-28752/com.intel.realsense.capture I/librs: Found UVC Device vid: id- 
    vid- 8086
    pid- ad3
    mi- 3
    unique_id- @
    path- /dev/bus/usb/002/002
    susb specification- 210
2019-06-04 14:15:18.672 28713-28713/com.intel.realsense.capture I/librs: Found UVC Device vid: id- 
    vid- 8086
    pid- ad3
    mi- 0
    unique_id- @
    path- /dev/bus/usb/002/002
    susb specification- 210
2019-06-04 14:15:18.672 28713-28713/com.intel.realsense.capture I/librs: Found UVC Device vid: id- 
    vid- 8086
    pid- ad3
    mi- 3
    unique_id- @
    path- /dev/bus/usb/002/002
    susb specification- 210
2019-06-04 14:15:18.677 28713-28713/com.intel.realsense.capture I/librs: Found UVC Device vid: id- 
    vid- 8086
    pid- ad3
    mi- 0
    unique_id- @
    path- /dev/bus/usb/002/002
    susb specification- 210
2019-06-04 14:15:18.677 28713-28713/com.intel.realsense.capture I/librs: Found UVC Device vid: id- 
    vid- 8086
    pid- ad3
    mi- 3
    unique_id- @
    path- /dev/bus/usb/002/002
    susb specification- 210
2019-06-04 14:15:18.679 28713-28713/com.intel.realsense.capture I/librs: Found UVC Device vid: id- 
    vid- 8086
    pid- ad3
    mi- 0
    unique_id- @
    path- /dev/bus/usb/002/002
    susb specification- 210
2019-06-04 14:15:18.679 28713-28713/com.intel.realsense.capture I/librs: Found UVC Device vid: id- 
    vid- 8086
    pid- ad3
    mi- 3
    unique_id- @
    path- /dev/bus/usb/002/002
    susb specification- 210
2019-06-04 14:15:18.752 28713-28921/com.intel.realsense.capture W/librs: bulk_transfer on read endpoint returned error, ERROR: Out of memory
2019-06-04 14:15:19.013 28713-28921/com.intel.realsense.capture W/librs: bulk_transfer on read endpoint returned error, ERROR: Out of memory

And I then tried to use firmware 5.11.4 + librealsense 2.19.2, it can work correctly, delivering 640x480 RGBD@30Hz, although the device was enumverated as usb 2.1 device. Here is the log:

Click me to expand
2019-06-04 14:00:24.198 27346-27346/com.intel.realsense.capture I/librs Enumerator: onReceive: android.hardware.usb.action.USB_DEVICE_ATTACHED
2019-06-04 14:00:24.278 27346-27346/com.intel.realsense.capture I/librs UsbUtilities: grantUsbPermissions:
    device: UsbDevice[mName=/dev/bus/usb/002/002,mVendorId=32902,mProductId=2771,mClass=239,mSubclass=2,mProtocol=1,mManufacturerName=Intel(R) RealSense(TM) Depth Camera 415 ,mProductName=Intel(R) RealSense(TM) Depth Camera 415 ,mVersion=50.114,mSerialNumber=null,mSubProductId =-1,mConfigurations=[
    UsbConfiguration[mId=1,mName=null,mAttributes=192,mMaxPower=55,mInterfaces=[
    UsbInterface[mId=0,mAlternateSetting=0,mName=Intel(R) RealSense(TM) Depth Camera 415  Depth,mClass=14,mSubclass=1,mProtocol=0,mEndpoints=[
    UsbEndpoint[mAddress=135,mAttributes=3,mMaxPacketSize=64,mInterval=6]]
    UsbInterface[mId=1,mAlternateSetting=0,mName=Intel(R) RealSense(TM) Depth Camera 415  Depth,mClass=14,mSubclass=2,mProtocol=0,mEndpoints=[
    UsbEndpoint[mAddress=130,mAttributes=2,mMaxPacketSize=512,mInterval=0]]
    UsbInterface[mId=2,mAlternateSetting=0,mName=Intel(R) RealSense(TM) Depth Camera 415  Y,mClass=14,mSubclass=2,mProtocol=0,mEndpoints=[
    UsbEndpoint[mAddress=131,mAttributes=2,mMaxPacketSize=512,mInterval=0]]
    UsbInterface[mId=3,mAlternateSetting=0,mName=Intel(R) RealSense(TM) Depth Camera 415  RGB,mClass=14,mSubclass=1,mProtocol=0,mEndpoints=[]
    UsbInterface[mId=4,mAlternateSetting=0,mName=Intel(R) RealSense(TM) Depth Camera 415  RGB,mClass=14,mSubclass=2,mProtocol=0,mEndpoints=[
    UsbEndpoint[mAddress=132,mAttributes=2,mMaxPacketSize=512,mInterval=0]]]]
2019-06-04 14:00:34.898 27346-27346/com.intel.realsense.capture I/librs Enumerator: onReceive: USB_CONTROL_PERMISSION
2019-06-04 14:00:34.901 27346-27370/com.intel.realsense.capture I/librs MessagesHandler: handleMessage: realsense device attached
2019-06-04 14:00:34.901 27346-27370/com.intel.realsense.capture I/librs Enumerator: notifyOnAttach
2019-06-04 14:00:34.902 27346-27370/com.intel.realsense.capture I/usbhost: usb_device_new /dev/bus/usb/002/002 fd: 80
2019-06-04 14:00:34.902 27346-27370/com.intel.realsense.capture I/usbhost: usb_device_new read returned 1230 errno 0
2019-06-04 14:00:34.920 27346-27370/com.intel.realsense.capture I/librs: Found UVC Device vid: id- 
    vid- 8086
    pid- ad3
    mi- 0
    unique_id- P
    path- /dev/bus/usb/002/002
    susb specification- 210
2019-06-04 14:00:34.920 27346-27370/com.intel.realsense.capture I/librs: Found UVC Device vid: id- 
    vid- 8086
    pid- ad3
    mi- 3
    unique_id- P
    path- /dev/bus/usb/002/002
    susb specification- 210
2019-06-04 14:00:37.802 27346-27346/com.intel.realsense.capture W/ActivityThread: handleWindowVisibility: no activity for token android.os.BinderProxy@73c1f23
2019-06-04 14:00:37.873 27346-27346/com.intel.realsense.capture I/librs: Found UVC Device vid: id- 
    vid- 8086
    pid- ad3
    mi- 0
    unique_id- P
    path- /dev/bus/usb/002/002
    susb specification- 210
2019-06-04 14:00:37.873 27346-27346/com.intel.realsense.capture I/librs: Found UVC Device vid: id- 
    vid- 8086
    pid- ad3
    mi- 3
    unique_id- P
    path- /dev/bus/usb/002/002
    susb specification- 210
2019-06-04 14:00:37.874 27346-27346/com.intel.realsense.capture I/librs: Found UVC Device vid: id- 
    vid- 8086
    pid- ad3
    mi- 0
    unique_id- P
    path- /dev/bus/usb/002/002
    susb specification- 210
2019-06-04 14:00:37.874 27346-27346/com.intel.realsense.capture I/librs: Found UVC Device vid: id- 
    vid- 8086
    pid- ad3
    mi- 3
    unique_id- P
    path- /dev/bus/usb/002/002
    susb specification- 210
2019-06-04 14:00:37.875 27346-27346/com.intel.realsense.capture I/librs: Found UVC Device vid: id- 
    vid- 8086
    pid- ad3
    mi- 0
    unique_id- P
    path- /dev/bus/usb/002/002
    susb specification- 210
2019-06-04 14:00:37.875 27346-27346/com.intel.realsense.capture I/librs: Found UVC Device vid: id- 
    vid- 8086
    pid- ad3
    mi- 3
    unique_id- P
    path- /dev/bus/usb/002/002
    susb specification- 210

@dreifelix
Copy link

Encountered this issue as well, using D435 + Pixel3 and D435 + Samsung S7 (same results). Both devices are not rooted, and are detected as usb 210. Firmware 5.11.04, librealsense 2.22. Tried both camera and capture apps.

For camera app, it starts with black screen, then the Settings page is displayed after a few seconds. I tried selecting different settings, including the lowest frame rate and resolution and only one active stream, but I still get the Out of memory issue.

Next, I tried building the AAR and created my own app. Same result for both devices. Let me know if you want me to try something else.

See sample log below, if it helps:

capture app logs for D435 + S7
$ adb shell am start -n "com.intel.realsense.capture/com.intel.realsense.capture.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Client not ready yet..Waiting for process to come online
Connected to process 20619 on device samsung-sm_g930f-192.168.43.1:5555
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
I/zygote64: no shared libraies, dex_files: 1
I/InstantRun: starting instant run server: is main process
D/librs UsbUtilities: hasUsbPermission
D/librs UsbUtilities: grantUsbPermissions
I/librs UsbUtilities: grantUsbPermissions:
    device: UsbDevice[mName=/dev/bus/usb/001/002,mVendorId=32902,mProductId=2823,mClass=239,mSubclass=2,mProtocol=1,mManufacturerName=Intel(R) RealSense(TM) Depth Camera 435 ,mProductName=Intel(R) RealSense(TM) Depth Camera 435 ,mVersion=2.16,mSerialNumber=null,mConfigurations=[
    UsbConfiguration[mId=1,mName=null,mAttributes=192,mMaxPower=55,mInterfaces=[
    UsbInterface[mId=0,mAlternateSetting=0,mName=Intel(R) RealSense(TM) Depth Camera 435 with RGB Module Depth,mClass=14,mSubclass=1,mProtocol=0,mEndpoints=[
    UsbEndpoint[mAddress=135,mAttributes=3,mMaxPacketSize=64,mInterval=6]]
    UsbInterface[mId=1,mAlternateSetting=0,mName=Intel(R) RealSense(TM) Depth Camera 435 with RGB Module Depth,mClass=14,mSubclass=2,mProtocol=0,mEndpoints=[
    UsbEndpoint[mAddress=130,mAttributes=2,mMaxPacketSize=512,mInterval=0]]
    UsbInterface[mId=2,mAlternateSetting=0,mName=Intel(R) RealSense(TM) Depth Camera 435  Y,mClass=14,mSubclass=2,mProtocol=0,mEndpoints=[
    UsbEndpoint[mAddress=131,mAttributes=2,mMaxPacketSize=512,mInterval=0]]
    UsbInterface[mId=3,mAlternateSetting=0,mName=Intel(R) RealSense(TM) Depth Camera 435 with RGB Module RGB,mClass=14,mSubclass=1,mProtocol=0,mEndpoints=[]
    UsbInterface[mId=4,mAlternateSetting=0,mName=Intel(R) RealSense(TM) Depth Camera 435 with RGB Module RGB,mClass=14,mSubclass=2,mProtocol=0,mEndpoints=[
    UsbEndpoint[mAddress=132,mAttributes=2,mMaxPacketSize=512,mInterval=0]]]]
D/librs: Librealsense VERSION: 2.22.0
D/OpenGLRenderer: HWUI GL Pipeline
D/ViewRootImpl@a2905e4[MainActivity]: setView = DecorView@59b2a4d[MainActivity] TM=true MM=false
D/ViewRootImpl@a2905e4[MainActivity]: dispatchAttachedToWindow
V/Surface: sf_framedrop debug : 0x4f4c, game : false, logging : 0
D/ViewRootImpl@a2905e4[MainActivity]: Relayout returned: old=[0,0][0,0] new=[0,0][1080,1920] result=0x7 surface={valid=true 529795960832} changed=true
I/OpenGLRenderer: Initialized EGL, version 1.4
D/OpenGLRenderer: Swap behavior 2
D/libGLESv1: STS_GLApi : DTS, ODTC are not allowed for Package : com.intel.realsense.capture
D/mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, egl_color_buffer_format *, EGLBoolean) returns 0x3000,  [1080x1920]-format:1
D/OpenGLRenderer: eglCreateWindowSurface = 0x7b5a4f64a0
D/SurfaceView: BG show() Surface(name=Background for - SurfaceView - com.intel.realsense.capture/com.intel.realsense.capture.MainActivity@e82a902@0) com.intel.realsense.librealsense.GLRsSurfaceView{e82a902 V.E...... ......ID 0,0-1080,1920 #7f070037 app:id/glSurfaceView}
V/Surface: sf_framedrop debug : 0x4f4c, game : false, logging : 0
D/SurfaceView: surfaceCreated 1 com.intel.realsense.librealsense.GLRsSurfaceView{e82a902 V.E...... ......ID 0,0-1080,1920 #7f070037 app:id/glSurfaceView}
D/SurfaceView: surfaceChanged (1080,1920) 1 com.intel.realsense.librealsense.GLRsSurfaceView{e82a902 V.E...... ......ID 0,0-1080,1920 #7f070037 app:id/glSurfaceView}
D/ViewRootImpl@a2905e4[MainActivity]: MSG_RESIZED_REPORT: frame=Rect(0, 0 - 1080, 1920) ci=Rect(0, 63 - 0, 0) vi=Rect(0, 63 - 0, 0) or=1
D/mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, egl_color_buffer_format *, EGLBoolean) returns 0x3000,  [1080x1920]-format:2
D/ViewRootImpl@a2905e4[MainActivity]: Relayout returned: old=[0,0][1080,1920] new=[0,0][1080,1920] result=0x1 surface={valid=true 529795960832} changed=false
D/ViewRootImpl@a2905e4[MainActivity]: MSG_WINDOW_FOCUS_CHANGED 1
V/InputMethodManager: Starting input: tba=android.view.inputmethod.EditorInfo@6acc213 nm : com.intel.realsense.capture ic=null
I/InputMethodManager: startInputInner - mService.startInputOrWindowGainedFocus
D/librs: Librealsense VERSION: 2.22.0
    Librealsense VERSION: 2.22.0
V/InputMethodManager: Starting input: tba=android.view.inputmethod.EditorInfo@8629c50 nm : com.intel.realsense.capture ic=null
D/ViewRootImpl@a2905e4[MainActivity]: MSG_RESIZED: frame=Rect(0, 0 - 1080, 1920) ci=Rect(0, 63 - 0, 0) vi=Rect(0, 0 - 0, 0) or=1
I/librs Enumerator: onReceive: USB_CONTROL_PERMISSION
D/librs UsbUtilities: hasUsbPermission
D/librs UsbUtilities: hasUsbPermission
I/librs MessagesHandler: handleMessage: realsense device attached
I/librs Enumerator: notifyOnAttach
D/librs DeviceWatcher: Adding device: /dev/bus/usb/001/002
D/librs: AddUsbDevice, previous device count: 0
    AddUsbDevice, adding device: /dev/bus/usb/001/002, descriptor: 100
    AddUsbDevice, create
D/librs: AddUsbDevice, notify
I/librs: Found UVC Device vid: id- 
    vid- 8086
    pid- b07
    mi- 0
    unique_id- /dev/bus/usb/001/002
    path- /dev/bus/usb/001/002
    susb specification- 210
    Found UVC Device vid: id- 
    vid- 8086
    pid- b07
    mi- 3
    unique_id- /dev/bus/usb/001/002
    path- /dev/bus/usb/001/002
    susb specification- 210
D/librs: AddUsbDevice, current device count: 1
D/librs DeviceWatcher: Device: /dev/bus/usb/001/002 added successfully
I/librs MessagesHandler: handleMessage: realsense device detached
I/librs Enumerator: notifyOnDetach
D/librs DeviceWatcher: Removing device: /dev/bus/usb/001/002
D/librs: RemoveUsbDevice, previous device count: 1
E/librs: Cancel request failed: No such device
D/librs: usb device: /dev/bus/usb/001/002, released
    RemoveUsbDevice, removing device: /dev/bus/usb/001/002, descriptor: 100
    RemoveUsbDevice, current device count: 0
D/UsbDeviceConnectionJNI: close
D/librs DeviceWatcher: Device: /dev/bus/usb/001/002 removed successfully
I/librs Enumerator: onReceive: android.hardware.usb.action.USB_DEVICE_ATTACHED
D/librs UsbUtilities: hasUsbPermission
D/librs UsbUtilities: grantUsbPermissions
I/librs UsbUtilities: grantUsbPermissions:
    device: UsbDevice[mName=/dev/bus/usb/001/002,mVendorId=32902,mProductId=2823,mClass=239,mSubclass=2,mProtocol=1,mManufacturerName=Intel(R) RealSense(TM) Depth Camera 435 ,mProductName=Intel(R) RealSense(TM) Depth Camera 435 ,mVersion=2.16,mSerialNumber=null,mConfigurations=[
    UsbConfiguration[mId=1,mName=null,mAttributes=192,mMaxPower=55,mInterfaces=[
    UsbInterface[mId=0,mAlternateSetting=0,mName=Intel(R) RealSense(TM) Depth Camera 435 with RGB Module Depth,mClass=14,mSubclass=1,mProtocol=0,mEndpoints=[
    UsbEndpoint[mAddress=135,mAttributes=3,mMaxPacketSize=64,mInterval=6]]
    UsbInterface[mId=1,mAlternateSetting=0,mName=Intel(R) RealSense(TM) Depth Camera 435 with RGB Module Depth,mClass=14,mSubclass=2,mProtocol=0,mEndpoints=[
    UsbEndpoint[mAddress=130,mAttributes=2,mMaxPacketSize=512,mInterval=0]]
    UsbInterface[mId=2,mAlternateSetting=0,mName=Intel(R) RealSense(TM) Depth Camera 435  Y,mClass=14,mSubclass=2,mProtocol=0,mEndpoints=[
    UsbEndpoint[mAddress=131,mAttributes=2,mMaxPacketSize=512,mInterval=0]]
    UsbInterface[mId=3,mAlternateSetting=0,mName=Intel(R) RealSense(TM) Depth Camera 435 with RGB Module RGB,mClass=14,mSubclass=1,mProtocol=0,mEndpoints=[]
    UsbInterface[mId=4,mAlternateSetting=0,mName=Intel(R) RealSense(TM) Depth Camera 435 with RGB Module RGB,mClass=14,mSubclass=2,mProtocol=0,mEndpoints=[
    UsbEndpoint[mAddress=132,mAttributes=2,mMaxPacketSize=512,mInterval=0]]]]
D/ViewRootImpl@a2905e4[MainActivity]: MSG_WINDOW_FOCUS_CHANGED 0
D/ViewRootImpl@a2905e4[MainActivity]: MSG_RESIZED: frame=Rect(0, 0 - 1080, 1920) ci=Rect(0, 63 - 0, 0) vi=Rect(0, 63 - 0, 0) or=1
D/ViewRootImpl@a2905e4[MainActivity]: Relayout returned: old=[0,0][1080,1920] new=[0,0][1080,1920] result=0x1 surface={valid=true 529795960832} changed=false
I/zygote64: Do partial code cache collection, code=29KB, data=26KB
I/zygote64: After code cache collection, code=24KB, data=22KB
    Increasing code cache capacity to 128KB
I/librs Enumerator: onReceive: USB_CONTROL_PERMISSION
D/librs UsbUtilities: hasUsbPermission
D/librs UsbUtilities: hasUsbPermission
I/librs MessagesHandler: handleMessage: realsense device attached
I/librs Enumerator: notifyOnAttach
D/librs DeviceWatcher: Adding device: /dev/bus/usb/001/002
D/librs: AddUsbDevice, previous device count: 0
    AddUsbDevice, adding device: /dev/bus/usb/001/002, descriptor: 100
    AddUsbDevice, create
D/librs: AddUsbDevice, notify
I/librs: Found UVC Device vid: id- 
    vid- 8086
    pid- b07
    mi- 0
    unique_id- /dev/bus/usb/001/002
    path- /dev/bus/usb/001/002
    susb specification- 210
    Found UVC Device vid: id- 
    vid- 8086
    pid- b07
    mi- 3
    unique_id- /dev/bus/usb/001/002
    path- /dev/bus/usb/001/002
    susb specification- 210
D/librs: AddUsbDevice, current device count: 1
D/librs DeviceWatcher: Device: /dev/bus/usb/001/002 added successfully
D/librs: interrupt_request: 1, 3, 0, 7, 0, 0, 
D/librs: interrupt_request: 1, 3, 0, 7, 0, 0, 
D/ViewRootImpl@a2905e4[MainActivity]: MSG_WINDOW_FOCUS_CHANGED 1
V/InputMethodManager: Starting input: tba=android.view.inputmethod.EditorInfo@9a54d81 nm : com.intel.realsense.capture ic=null
I/InputMethodManager: startInputInner - mService.startInputOrWindowGainedFocus
D/librs: Librealsense VERSION: 2.22.0
    Librealsense VERSION: 2.22.0
I/librs: Found UVC Device vid: id- 
    vid- 8086
    pid- b07
    mi- 0
    unique_id- /dev/bus/usb/001/002
    path- /dev/bus/usb/001/002
    susb specification- 210
    Found UVC Device vid: id- 
    vid- 8086
    pid- b07
    mi- 3
    unique_id- /dev/bus/usb/001/002
    path- /dev/bus/usb/001/002
    susb specification- 210
D/librs: try_fetch_usb_device(...) failed.
I/librs: Found UVC Device vid: id- 
    vid- 8086
    pid- b07
    mi- 0
    unique_id- /dev/bus/usb/001/002
    path- /dev/bus/usb/001/002
    susb specification- 210
    Found UVC Device vid: id- 
    vid- 8086
    pid- b07
    mi- 3
    unique_id- /dev/bus/usb/001/002
    path- /dev/bus/usb/001/002
    susb specification- 210
D/librs: try_fetch_usb_device(...) failed.
D/librs capture example: try start streaming
I/librs: Found UVC Device vid: id- 
    vid- 8086
    pid- b07
    mi- 0
    unique_id- /dev/bus/usb/001/002
    path- /dev/bus/usb/001/002
    susb specification- 210
    Found UVC Device vid: id- 
    vid- 8086
    pid- b07
    mi- 3
    unique_id- /dev/bus/usb/001/002
    path- /dev/bus/usb/001/002
    susb specification- 210
D/librs: try_fetch_usb_device(...) failed.
D/librs: CLinearCoefficients started
    start new time_diff_keeper 
    Creating UVC Device from path: /dev/bus/usb/001/002
    global_timestamp_reader created
D/librs: Creating UVC Device from path: /dev/bus/usb/001/002
    global_timestamp_reader created
D/librs: global_timestamp_reader created
D/librs: USB pipe 130 reset successfully
D/librs: USB pipe 132 reset successfully
D/librs capture example: streaming started successfully
D/librs: Transfer thread started for endpoint address: 132
D/librs: Transfer thread started for endpoint address: 130
W/librs: bulk_transfer returned error, endpoint: �, error: Out of memory
W/librs: bulk_transfer returned error, endpoint: �, error: Out of memory
W/librs: bulk_transfer returned error, endpoint: �, error: Out of memory
W/librs: bulk_transfer returned error, endpoint: �, error: Out of memory
W/librs: bulk_transfer returned error, endpoint: �, error: Out of memory
W/librs: bulk_transfer returned error, endpoint: �, error: Out of memory
W/librs: bulk_transfer returned error, endpoint: �, error: Out of memory
W/librs: bulk_transfer returned error, endpoint: �, error: Out of memory
W/librs: bulk_transfer returned error, endpoint: �, error: Out of memory
W/librs: bulk_transfer returned error, endpoint: �, error: Out of memory
W/librs: bulk_transfer returned error, endpoint: �, error: Out of memory
W/librs: bulk_transfer returned error, endpoint: �, error: Out of memory
W/librs: bulk_transfer returned error, endpoint: �, error: Out of memory
W/librs: bulk_transfer returned error, endpoint: �, error: Out of memory
W/librs: bulk_transfer returned error, endpoint: �, error: Out of memory
W/librs: bulk_transfer returned error, endpoint: �, error: Out of memory
W/librs: bulk_transfer returned error, endpoint: �, error: Out of memory
W/librs: bulk_transfer returned error, endpoint: �, error: Out of memory
W/librs: bulk_transfer returned error, endpoint: �, error: Out of memory
W/librs: bulk_transfer returned error, endpoint: �, error: Out of memory
W/librs: bulk_transfer returned error, endpoint: �, error: Out of memory
D/librs: time_diff_keeper::update_diff_time - in
    time_diff_keeper::update_diff_time - lock
W/librs: bulk_transfer returned error, endpoint: �, error: Out of memory
W/librs: bulk_transfer returned error, endpoint: �, error: Out of memory
W/librs: bulk_transfer returned error, endpoint: �, error: Out of memory
W/librs: bulk_transfer returned error, endpoint: �, error: Out of memory
W/librs: bulk_transfer returned error, endpoint: �, error: Out of memory
W/librs: bulk_transfer returned error, endpoint: �, error: Out of memory
W/librs: bulk_transfer returned error, endpoint: �, error: Out of memory
W/librs: bulk_transfer returned error, endpoint: �, error: Out of memory
W/librs: bulk_transfer returned error, endpoint: �, error: Out of memory
W/librs: bulk_transfer returned error, endpoint: �, error: Out of memory
W/librs: bulk_transfer returned error, endpoint: �, error: Out of memory
W/librs: bulk_transfer returned error, endpoint: �, error: Out of memory
W/librs: bulk_transfer returned error, endpoint: �, error: Out of memory
W/librs: bulk_transfer returned error, endpoint: �, error: Out of memory
W/librs: bulk_transfer returned error, endpoint: �, error: Out of memory
W/librs: bulk_transfer returned error, endpoint: �, error: Out of memory
D/librs: time_diff_keeper::call reset()
W/librs: bulk_transfer returned error, endpoint: �, error: Out of memory
D/librs: CLinearCoefficients::reset
W/librs: bulk_transfer returned error, endpoint: �, error: Out of memory
D/librs: CLinearCoefficients::add_value - in
    CLinearCoefficients::add_value - lock
W/librs: bulk_transfer returned error, endpoint: �, error: Out of memory
W/librs: bulk_transfer returned error, endpoint: �, error: Out of memory
D/librs: CLinearCoefficients::calc_linear_coefs - in
    CLinearCoefficients::calc_linear_coefs - lock
W/librs: bulk_transfer returned error, endpoint: �, error: Out of memory
D/librs: CLinearCoefficients::calc_linear_coefs - unlock
    CLinearCoefficients::add_value - unlock
    time_diff_keeper::update_diff_time - unlock
W/librs: bulk_transfer returned error, endpoint: �, error: Out of memory
W/librs: bulk_transfer returned error, endpoint: �, error: Out of memory
W/librs: bulk_transfer returned error, endpoint: �, error: Out of memory
W/librs: bulk_transfer returned error, endpoint: �, error: Out of memory
W/librs: bulk_transfer returned error, endpoint: �, error: Out of memory
W/librs: bulk_transfer returned error, endpoint: �, error: Out of memory

@matkatz
Copy link
Contributor

matkatz commented Jun 6, 2019

Thanks for the inputs!
I'm trying to put my finger on the changes that cause this issue.
I understand that it does not exists on 2.19.2 and it does on 2.21.0
What about 2.20.0 (uploaded to Bintray today)?

@matkatz
Copy link
Contributor

matkatz commented Jun 7, 2019

There is a change on USB transfer method on v2.21.0 that might cause this issue.
I created a branch that partly revert this change: android_bulk_transfer
Its purpose is only to verify that this is indeed the cause so it might be very buggy.
You can also consume it by changing the bintray repo to:
https://dl.bintray.com/intel-realsense/librealsense-dev
And specify version 2.23.0.372

@dreifelix
Copy link

Happy to share that your branch works! I have tested it on S7 + D435, no errors in the log. Will test it on the Pixel3 on Monday when I have the device with me. It worked with all three streams (color, depth, infrared) turned on simultaneously at low resolution and 15 fps each.

Thanks so much for the fix!

@Mad-Thanos
Copy link
Author

Thanks! I'll give it a try and report the results at here.

@Mad-Thanos
Copy link
Author

Mad-Thanos commented Jun 11, 2019

I tried librealsense 2.20.0 + firmware 5.11.04 on Honor V20 android phone, the example capture can work normally now.
Here is the log:

Click me to expand
2019-06-11 11:05:24.597 31246-31246/com.intel.realsense.capture I/librs Enumerator: onReceive: android.hardware.usb.action.USB_DEVICE_ATTACHED
2019-06-11 11:05:24.597 31246-31246/com.intel.realsense.capture I/librs Enumerator: onReceive: android.hardware.usb.action.USB_DEVICE_ATTACHED
2019-06-11 11:05:24.625 31246-31246/com.intel.realsense.capture I/librs UsbUtilities: grantUsbPermissions:
    device: UsbDevice[mName=/dev/bus/usb/002/002,mVendorId=32902,mProductId=2771,mClass=239,mSubclass=2,mProtocol=1,mManufacturerName=Intel(R) RealSense(TM) Depth Camera 415 ,mProductName=Intel(R) RealSense(TM) Depth Camera 415 ,mVersion=50.114,mSerialNumber=null,mSubProductId =-1,mConfigurations=[
    UsbConfiguration[mId=1,mName=null,mAttributes=192,mMaxPower=55,mInterfaces=[
    UsbInterface[mId=0,mAlternateSetting=0,mName=Intel(R) RealSense(TM) Depth Camera 415  Depth,mClass=14,mSubclass=1,mProtocol=0,mEndpoints=[
    UsbEndpoint[mAddress=135,mAttributes=3,mMaxPacketSize=64,mInterval=6]]
    UsbInterface[mId=1,mAlternateSetting=0,mName=Intel(R) RealSense(TM) Depth Camera 415  Depth,mClass=14,mSubclass=2,mProtocol=0,mEndpoints=[
    UsbEndpoint[mAddress=130,mAttributes=2,mMaxPacketSize=512,mInterval=0]]
    UsbInterface[mId=2,mAlternateSetting=0,mName=Intel(R) RealSense(TM) Depth Camera 415  Y,mClass=14,mSubclass=2,mProtocol=0,mEndpoints=[
    UsbEndpoint[mAddress=131,mAttributes=2,mMaxPacketSize=512,mInterval=0]]
    UsbInterface[mId=3,mAlternateSetting=0,mName=Intel(R) RealSense(TM) Depth Camera 415  RGB,mClass=14,mSubclass=1,mProtocol=0,mEndpoints=[]
    UsbInterface[mId=4,mAlternateSetting=0,mName=Intel(R) RealSense(TM) Depth Camera 415  RGB,mClass=14,mSubclass=2,mProtocol=0,mEndpoints=[
    UsbEndpoint[mAddress=132,mAttributes=2,mMaxPacketSize=512,mInterval=0]]]]
2019-06-11 11:05:24.781 31246-31276/com.intel.realsense.capture W/libEGL: EGLNativeWindowType 0x7cbe276010 disconnect failed
2019-06-11 11:05:24.795 31246-31271/com.intel.realsense.capture W/libEGL: EGLNativeWindowType 0x7cbfc3f010 disconnect failed
2019-06-11 11:05:24.804 31246-31246/com.intel.realsense.capture I/ViewRootImpl: jank_removeInvalidNode all the node in jank list is out of time
2019-06-11 11:05:28.181 31246-31246/com.intel.realsense.capture W/ActivityThread: handleWindowVisibility: no activity for token android.os.BinderProxy@cc8dd49
2019-06-11 11:05:28.222 31246-31246/com.intel.realsense.capture I/librs Enumerator: onReceive: USB_CONTROL_PERMISSION
2019-06-11 11:05:28.224 31246-31273/com.intel.realsense.capture I/librs MessagesHandler: handleMessage: realsense device attached
2019-06-11 11:05:28.224 31246-31273/com.intel.realsense.capture I/librs Enumerator: notifyOnAttach
2019-06-11 11:05:28.225 31246-31273/com.intel.realsense.capture I/usbhost: usb_device_new /dev/bus/usb/002/002 fd: 75
2019-06-11 11:05:28.225 31246-31273/com.intel.realsense.capture I/usbhost: usb_device_new read returned 1230 errno 0
2019-06-11 11:05:28.245 31246-31273/com.intel.realsense.capture I/librs: Found UVC Device vid: id- 
    vid- 8086
    pid- ad3
    mi- 0
    unique_id- K
    path- /dev/bus/usb/002/002
    susb specification- 210
2019-06-11 11:05:28.245 31246-31273/com.intel.realsense.capture I/librs: Found UVC Device vid: id- 
    vid- 8086
    pid- ad3
    mi- 3
    unique_id- K
    path- /dev/bus/usb/002/002
    susb specification- 210
2019-06-11 11:05:28.245 31246-31246/com.intel.realsense.capture I/librs: Found UVC Device vid: id- 
    vid- 8086
    pid- ad3
    mi- 0
    unique_id- K
    path- /dev/bus/usb/002/002
    susb specification- 210
2019-06-11 11:05:28.245 31246-31246/com.intel.realsense.capture I/librs: Found UVC Device vid: id- 
    vid- 8086
    pid- ad3
    mi- 3
    unique_id- K
    path- /dev/bus/usb/002/002
    susb specification- 210
2019-06-11 11:05:28.246 31246-31246/com.intel.realsense.capture I/librs: Found UVC Device vid: id- 
    vid- 8086
    pid- ad3
    mi- 0
    unique_id- K
    path- /dev/bus/usb/002/002
    susb specification- 210
2019-06-11 11:05:28.246 31246-31246/com.intel.realsense.capture I/librs: Found UVC Device vid: id- 
    vid- 8086
    pid- ad3
    mi- 3
    unique_id- K
    path- /dev/bus/usb/002/002
    susb specification- 210
2019-06-11 11:05:28.247 31246-31246/com.intel.realsense.capture I/librs: Found UVC Device vid: id- 
    vid- 8086
    pid- ad3
    mi- 0
    unique_id- K
    path- /dev/bus/usb/002/002
    susb specification- 210
2019-06-11 11:05:28.247 31246-31246/com.intel.realsense.capture I/librs: Found UVC Device vid: id- 
    vid- 8086
    pid- ad3
    mi- 3
    unique_id- K
    path- /dev/bus/usb/002/002
    susb specification- 210
2019-06-11 11:05:28.314 31246-31356/com.intel.realsense.capture E/librs: Cannot queue request: Out of memory
2019-06-11 11:05:28.319 31246-31246/com.intel.realsense.capture I/ViewRootImpl: jank_removeInvalidNode all the node in jank list is out of time
2019-06-11 11:05:31.978 31246-31265/com.intel.realsense.capture I/alsense.captur: Starting profile saver IsSaveProfileNow end.

however, I am not sure whether the third to last line in the above log is critical or could be ignored.

@Mad-Thanos
Copy link
Author

And the example app capture built with librealsense-dev 2.23.0.372 can also work normally.
Here is the log:

Click me to expand
2019-06-11 11:20:43.757 1412-1412/com.intel.realsense.capture I/librs Enumerator: onReceive: android.hardware.usb.action.USB_DEVICE_ATTACHED
2019-06-11 11:20:43.795 1412-1412/com.intel.realsense.capture I/librs UsbUtilities: grantUsbPermissions:
    device: UsbDevice[mName=/dev/bus/usb/002/002,mVendorId=32902,mProductId=2771,mClass=239,mSubclass=2,mProtocol=1,mManufacturerName=Intel(R) RealSense(TM) Depth Camera 415 ,mProductName=Intel(R) RealSense(TM) Depth Camera 415 ,mVersion=50.114,mSerialNumber=null,mSubProductId =-1,mConfigurations=[
    UsbConfiguration[mId=1,mName=null,mAttributes=192,mMaxPower=55,mInterfaces=[
    UsbInterface[mId=0,mAlternateSetting=0,mName=Intel(R) RealSense(TM) Depth Camera 415  Depth,mClass=14,mSubclass=1,mProtocol=0,mEndpoints=[
    UsbEndpoint[mAddress=135,mAttributes=3,mMaxPacketSize=64,mInterval=6]]
    UsbInterface[mId=1,mAlternateSetting=0,mName=Intel(R) RealSense(TM) Depth Camera 415  Depth,mClass=14,mSubclass=2,mProtocol=0,mEndpoints=[
    UsbEndpoint[mAddress=130,mAttributes=2,mMaxPacketSize=512,mInterval=0]]
    UsbInterface[mId=2,mAlternateSetting=0,mName=Intel(R) RealSense(TM) Depth Camera 415  Y,mClass=14,mSubclass=2,mProtocol=0,mEndpoints=[
    UsbEndpoint[mAddress=131,mAttributes=2,mMaxPacketSize=512,mInterval=0]]
    UsbInterface[mId=3,mAlternateSetting=0,mName=Intel(R) RealSense(TM) Depth Camera 415  RGB,mClass=14,mSubclass=1,mProtocol=0,mEndpoints=[]
    UsbInterface[mId=4,mAlternateSetting=0,mName=Intel(R) RealSense(TM) Depth Camera 415  RGB,mClass=14,mSubclass=2,mProtocol=0,mEndpoints=[
    UsbEndpoint[mAddress=132,mAttributes=2,mMaxPacketSize=512,mInterval=0]]]]
2019-06-11 11:20:43.951 1412-1446/com.intel.realsense.capture W/libEGL: EGLNativeWindowType 0x7cac44f010 disconnect failed
2019-06-11 11:20:43.965 1412-1442/com.intel.realsense.capture W/libEGL: EGLNativeWindowType 0x7cac4e6010 disconnect failed
2019-06-11 11:20:43.976 1412-1412/com.intel.realsense.capture I/ViewRootImpl: jank_removeInvalidNode all the node in jank list is out of time
2019-06-11 11:20:45.569 1412-1412/com.intel.realsense.capture W/ActivityThread: handleWindowVisibility: no activity for token android.os.BinderProxy@cc8dd49
2019-06-11 11:20:45.611 1412-1412/com.intel.realsense.capture I/librs Enumerator: onReceive: USB_CONTROL_PERMISSION
2019-06-11 11:20:45.613 1412-1444/com.intel.realsense.capture I/librs MessagesHandler: handleMessage: realsense device attached
2019-06-11 11:20:45.613 1412-1444/com.intel.realsense.capture I/librs Enumerator: notifyOnAttach
2019-06-11 11:20:45.614 1412-1444/com.intel.realsense.capture I/usbhost: usb_device_new /dev/bus/usb/002/002 fd: 77
2019-06-11 11:20:45.614 1412-1444/com.intel.realsense.capture I/usbhost: usb_device_new read returned 1230 errno 0
2019-06-11 11:20:45.615 1412-1444/com.intel.realsense.capture I/librs: Found UVC Device vid: id- 
    vid- 8086
    pid- ad3
    mi- 0
    unique_id- /dev/bus/usb/002/002
    path- /dev/bus/usb/002/002
    susb specification- 210
2019-06-11 11:20:45.615 1412-1444/com.intel.realsense.capture I/librs: Found UVC Device vid: id- 
    vid- 8086
    pid- ad3
    mi- 3
    unique_id- /dev/bus/usb/002/002
    path- /dev/bus/usb/002/002
    susb specification- 210
2019-06-11 11:20:45.615 1412-1412/com.intel.realsense.capture I/librs: Found UVC Device vid: id- 
    vid- 8086
    pid- ad3
    mi- 0
    unique_id- /dev/bus/usb/002/002
    path- /dev/bus/usb/002/002
    susb specification- 210
2019-06-11 11:20:45.615 1412-1412/com.intel.realsense.capture I/librs: Found UVC Device vid: id- 
    vid- 8086
    pid- ad3
    mi- 3
    unique_id- /dev/bus/usb/002/002
    path- /dev/bus/usb/002/002
    susb specification- 210
2019-06-11 11:20:45.616 1412-1412/com.intel.realsense.capture I/librs: Found UVC Device vid: id- 
    vid- 8086
    pid- ad3
    mi- 0
    unique_id- /dev/bus/usb/002/002
    path- /dev/bus/usb/002/002
    susb specification- 210
2019-06-11 11:20:45.616 1412-1412/com.intel.realsense.capture I/librs: Found UVC Device vid: id- 
    vid- 8086
    pid- ad3
    mi- 3
    unique_id- /dev/bus/usb/002/002
    path- /dev/bus/usb/002/002
    susb specification- 210
2019-06-11 11:20:45.616 1412-1412/com.intel.realsense.capture I/librs: Found UVC Device vid: id- 
    vid- 8086
    pid- ad3
    mi- 0
    unique_id- /dev/bus/usb/002/002
    path- /dev/bus/usb/002/002
    susb specification- 210
2019-06-11 11:20:45.616 1412-1412/com.intel.realsense.capture I/librs: Found UVC Device vid: id- 
    vid- 8086
    pid- ad3
    mi- 3
    unique_id- /dev/bus/usb/002/002
    path- /dev/bus/usb/002/002
    susb specification- 210
2019-06-11 11:20:45.672 1412-1515/com.intel.realsense.capture I/librs: USB pipe 130 reset successfully
2019-06-11 11:20:45.681 1412-1517/com.intel.realsense.capture I/librs: USB pipe 132 reset successfully
2019-06-11 11:20:49.215 1412-1428/com.intel.realsense.capture I/alsense.captur: Starting profile saver IsSaveProfileNow end.

@Mad-Thanos
Copy link
Author

Mad-Thanos commented Jun 11, 2019

Hi @matkatz ,
Do you have any thoughts about the problem of the USB protocol version? That is, librealsense running on a USB 3.1 compliant android phone recognizes the D415 camera as a USB 2.1 device.

I've checked the cable and the phone using both a windows tool named 'ChipGenius' and the MacOS X System Report App on MacBook Pro.

On windows, I plugged my Honor V20 android phone into the USB 3.2 type-c port of the PC laptop, using the same c-to-c cable that I used to connect the android phone with the D415 camera. And the ChipGenius give me a USB detection result of the Honor V20 phone as follow:

Device Description: USB Composite Device (HUAWEI PCT-AL10)
  Equipment Type: Supplier Customization

  Protocol version: USB 3.10
  Current speed: High Speed
  Power consumption: 504mA

  USB device ID: VID = 12D1 PID = 107E
Equipment serial number: 5EN0219223001846

Equipment supplier: HUAWEI
  Equipment Name: PCT-AL10
Equipment revision: 0299

  Host/Master Controller model: Unknown

As you can see, the phone + the cable is recognized as USB 3.1 device.

on MacBook Pro (Retina, 13-inch, Early 2015 version), I got almost the same result:
I think the Speed: Up to 5Gb/sec implies that the phone is connected to USB 3.0 port of my MacBook.

Honor V20 with MBP

So why it's susb specification- 210 when the D415 is connected to the same phone using the same cable? Am I missing something?


Added:
However, in the first post of this issue, I ran librealsense 2.22.0+ capture app on Huawei P20(also support USB3.0). The D415 can be recognized as a USB 3.0 device. But at that time the app ran into the OOM problem. I'll try to build the capture app using librealsense-dev 2.23.0.372, run it on Huawei P20 and check if the D415 is recognized as a USB 3.0 device and if the OOM problem is gone.

@matkatz
Copy link
Contributor

matkatz commented Jun 11, 2019

Thanks for the feedback!

I'm testing the library on 4 different platforms:

  • FireFly RK3328 Android 7
  • FireFly RK3399 Android 8.1
  • Samsung S8 Android 9
  • Pixel 2 Android 9

On all of those systems the camera(D415 FW 5.11.4.0) is identified as USB 3.2.
It is possible that the camera will be detected as USB 2 in some cases, but unplug and plug back the camera should solve that.

I'm still not capable to reproduce the memory issue on those platforms, currently I'm working on both directions:

  • Trying to reproduce and solve the memory issue (preferred).
  • Revert the USB bulk transfer changes (this is causing other problems that I still need to solve)

@Mad-Thanos
Copy link
Author

Mad-Thanos commented Jun 16, 2019

I tried to build the example capture with librealsense-dev 2.23.0.372, and ran it on Huawei P20.
something similar to issue #4215 happened. See this screencast video:

You could see that the frames were fitfully updated, the screen got stuck for a while and got updated later again, off and on repeatedly.
I could see from the logcat a warning and an error message alternately appeared:

W/librs: Timeout reached waiting for response
E/librs: Cancel request failed: Invalid argument

The warning log seems to be similar to issue #3612.

But after switching librealsense to v2.20.0, and build the capture again, It worked correctly. It even could deliver 1280x720x30fps RGBD stream, since the D415 was enumerated as USB 3.2 device.

@matkatz
Copy link
Contributor

matkatz commented Jun 16, 2019

I was finally able to reproduce the issue and able to see where is it coming from.
From a reason that I’m not yet understand, the USB bulk transfer started to fail when the frame resolution size was larger than ~600KB.

To solve that I changed the read buffer size from default hard coded size to a value that is determined according to the current stream resolution.

Reducing the buffer size allows to configure and stream lower resolutions in case of “Out of memory” error.

I also tried to reassemble the frame from few smaller USB payloads but that didn’t work for me (I think it requires isochronous endpoint which is not supported by Android).

BTW, a reboot to the device that the issue was reproduced on (Pixel 2 - Android 9), eliminated the issue.

I will keep looking into this but first I want to apply the fix if it's mitigates the issue.

Once again I will ask you to check my fix before I push it to the development branch.

This is the branch: android-read-length-fix
And it is also available in the dev repo (https://dl.bintray.com/intel-realsense/librealsense-dev) on bintray, version: 2.23.0.13

Thanks in advance!

@Mad-Thanos
Copy link
Author

That's great! I'd like to try it out later in this day

@dreifelix
Copy link

The android-read-length-fix branch fails to stream using the camera sample app, even at lowest resolution at 6 fps when tested on my S7 + D435.

Logs on first run, with D435 already attached to USB port
$ adb shell am start -n "com.intel.realsense.camera/com.intel.realsense.camera.DetachedActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Client not ready yet..Waiting for process to come online
Connected to process 14436 on device samsung-sm_g930f-192.168.43.1:5555
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
I/zygote64: no shared libraies, dex_files: 1
I/InstantRun: starting instant run server: is main process
D/librs: Librealsense VERSION: 2.23.0
D/librs UsbUtilities: hasUsbPermission
I/librs MessagesHandler: handleMessage: realsense device attached
I/librs Enumerator: notifyOnAttach
D/librs DeviceWatcher: Adding device: /dev/bus/usb/001/002
D/librs: AddUsbDevice, previous device count: 0
    AddUsbDevice, adding device: /dev/bus/usb/001/002, descriptor: 75
    AddUsbDevice, create
D/librs: AddUsbDevice, notify
I/librs: Found UVC Device vid: id- 
    vid- 8086
    pid- b07
    mi- 0
    unique_id- /dev/bus/usb/001/002
    path- /dev/bus/usb/001/002
    susb specification- 210
    Found UVC Device vid: id- 
    vid- 8086
    pid- b07
    mi- 3
    unique_id- /dev/bus/usb/001/002
    path- /dev/bus/usb/001/002
    susb specification- 210
D/librs: AddUsbDevice, current device count: 1
I/librs: Found UVC Device vid: id- 
    vid- 8086
    pid- b07
    mi- 0
    unique_id- /dev/bus/usb/001/002
    path- /dev/bus/usb/001/002
    susb specification- 210
    Found UVC Device vid: id- 
    vid- 8086
    pid- b07
    mi- 3
    unique_id- /dev/bus/usb/001/002
    path- /dev/bus/usb/001/002
    susb specification- 210
D/librs: try_fetch_usb_device(...) failed.
D/librs: Creating UVC Device from path: /dev/bus/usb/001/002
D/librs: interrupt_request: 1, 3, 0, 7, 0, 0, 
E/librs: SetXU result:-1
D/librs: interrupt_request: 1, 3, 0, 7, 0, 0, 
D/OpenGLRenderer: HWUI GL Pipeline
D/ViewRootImpl@edad6cd[DetachedActivity]: setView = DecorView@2e1b82[DetachedActivity] TM=true MM=false
D/ViewRootImpl@edad6cd[DetachedActivity]: dispatchAttachedToWindow
D/librs: Creating UVC Device from path: /dev/bus/usb/001/002
V/Surface: sf_framedrop debug : 0x4f4c, game : false, logging : 0
D/ViewRootImpl@edad6cd[DetachedActivity]: Relayout returned: old=[0,0][0,0] new=[0,0][1080,1920] result=0x7 surface={valid=true 506472833024} changed=true
I/OpenGLRenderer: Initialized EGL, version 1.4
D/OpenGLRenderer: Swap behavior 2
D/libGLESv1: STS_GLApi : DTS, ODTC are not allowed for Package : com.intel.realsense.camera
D/mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, egl_color_buffer_format *, EGLBoolean) returns 0x3000,  [1080x1920]-format:1
D/OpenGLRenderer: eglCreateWindowSurface = 0x75e64b1a40
D/librs DeviceWatcher: Device: /dev/bus/usb/001/002 added successfully
D/ViewRootImpl@edad6cd[DetachedActivity]: MSG_RESIZED_REPORT: frame=Rect(0, 0 - 1080, 1920) ci=Rect(0, 63 - 0, 0) vi=Rect(0, 63 - 0, 0) or=1
D/ViewRootImpl@edad6cd[DetachedActivity]: MSG_WINDOW_FOCUS_CHANGED 1
V/InputMethodManager: Starting input: tba=android.view.inputmethod.EditorInfo@24b12c9 nm : com.intel.realsense.camera ic=null
I/InputMethodManager: startInputInner - mService.startInputOrWindowGainedFocus
W/LayerDrawable: Invalid drawable added to LayerDrawable! Drawable already belongs to another owner but does not expose a constant state.
    java.lang.RuntimeException
        at android.graphics.drawable.LayerDrawable$ChildDrawable.<init>(LayerDrawable.java:1855)
        at android.graphics.drawable.LayerDrawable$LayerState.<init>(LayerDrawable.java:1975)
        at android.graphics.drawable.RippleDrawable$RippleState.<init>(RippleDrawable.java:1021)
        at android.graphics.drawable.RippleDrawable.createConstantState(RippleDrawable.java:1011)
        at android.graphics.drawable.RippleDrawable.createConstantState(RippleDrawable.java:1009)
        at android.graphics.drawable.LayerDrawable.mutate(LayerDrawable.java:1779)
        at android.graphics.drawable.RippleDrawable.mutate(RippleDrawable.java:997)
        at android.view.View.applyBackgroundTint(View.java:21827)
        at android.view.View.setBackgroundDrawable(View.java:21698)
        at android.support.design.widget.FloatingActionButton.access$001(FloatingActionButton.java:68)
        at android.support.design.widget.FloatingActionButton$ShadowDelegateImpl.setBackgroundDrawable(FloatingActionButton.java:824)
        at android.support.design.widget.FloatingActionButtonLollipop.setBackgroundDrawable(FloatingActionButtonLollipop.java:73)
        at android.support.design.widget.FloatingActionButton.<init>(FloatingActionButton.java:179)
        at android.support.design.widget.FloatingActionButton.<init>(FloatingActionButton.java:151)
        at java.lang.reflect.Constructor.newInstance0(Native Method)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:334)
        at android.view.LayoutInflater.createView(LayoutInflater.java:647)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:790)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:863)
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
        at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:287)
        at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139)
        at com.intel.realsense.camera.PreviewActivity.onCreate(PreviewActivity.java:56)
        at android.app.Activity.performCreate(Activity.java:7183)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1220)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2910)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3032)
        at android.app.ActivityThread.-wrap11(Unknown Source:0)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1696)
        at android.os.Handler.dispatchMessage(Handler.java:105)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6944)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
W/LayerDrawable: Invalid drawable added to LayerDrawable! Drawable already belongs to another owner but does not expose a constant state.
    java.lang.RuntimeException
        at android.graphics.drawable.LayerDrawable$ChildDrawable.<init>(LayerDrawable.java:1855)
        at android.graphics.drawable.LayerDrawable$LayerState.<init>(LayerDrawable.java:1975)
        at android.graphics.drawable.LayerDrawable.createConstantState(LayerDrawable.java:168)
        at android.graphics.drawable.LayerDrawable.mutate(LayerDrawable.java:1779)
        at android.graphics.drawable.LayerDrawable.mutate(LayerDrawable.java:1785)
        at android.graphics.drawable.RippleDrawable.mutate(RippleDrawable.java:997)
        at android.view.View.applyBackgroundTint(View.java:21827)
        at android.view.View.setBackgroundDrawable(View.java:21698)
        at android.support.design.widget.FloatingActionButton.access$001(FloatingActionButton.java:68)
        at android.support.design.widget.FloatingActionButton$ShadowDelegateImpl.setBackgroundDrawable(FloatingActionButton.java:824)
        at android.support.design.widget.FloatingActionButtonLollipop.setBackgroundDrawable(FloatingActionButtonLollipop.java:73)
        at android.support.design.widget.FloatingActionButton.<init>(FloatingActionButton.java:179)
        at android.support.design.widget.FloatingActionButton.<init>(FloatingActionButton.java:151)
        at java.lang.reflect.Constructor.newInstance0(Native Method)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:334)
        at android.view.LayoutInflater.createView(LayoutInflater.java:647)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:790)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:863)
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
        at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:287)
        at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139)
        at com.intel.realsense.camera.PreviewActivity.onCreate(PreviewActivity.java:56)
        at android.app.Activity.performCreate(Activity.java:7183)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1220)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2910)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3032)
        at android.app.ActivityThread.-wrap11(Unknown Source:0)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1696)
        at android.os.Handler.dispatchMessage(Handler.java:105)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6944)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
D/librs: Librealsense VERSION: 2.23.0
I/librs: Found UVC Device vid: id- 
    vid- 8086
    pid- b07
    mi- 0
    unique_id- /dev/bus/usb/001/002
    path- /dev/bus/usb/001/002
    susb specification- 210
I/librs: Found UVC Device vid: id- 
    vid- 8086
    pid- b07
    mi- 3
    unique_id- /dev/bus/usb/001/002
    path- /dev/bus/usb/001/002
    susb specification- 210
D/librs: try_fetch_usb_device(...) failed.
D/librs camera streamer: try start streaming
D/librs: Librealsense VERSION: 2.23.0
I/librs: Found UVC Device vid: id- 
    vid- 8086
    pid- b07
    mi- 0
    unique_id- /dev/bus/usb/001/002
    path- /dev/bus/usb/001/002
    susb specification- 210
    Found UVC Device vid: id- 
    vid- 8086
    pid- b07
    mi- 3
    unique_id- /dev/bus/usb/001/002
    path- /dev/bus/usb/001/002
    susb specification- 210
D/librs: try_fetch_usb_device(...) failed.
    Creating UVC Device from path: /dev/bus/usb/001/002
I/librs: Found 4 unreachable streams, 4 extrinsics deleted
D/librs: Creating UVC Device from path: /dev/bus/usb/001/002
I/librs: Found UVC Device vid: id- 
    vid- 8086
    pid- b07
    mi- 0
    unique_id- /dev/bus/usb/001/002
    path- /dev/bus/usb/001/002
    susb specification- 210
    Found UVC Device vid: id- 
    vid- 8086
    pid- b07
    mi- 3
    unique_id- /dev/bus/usb/001/002
    path- /dev/bus/usb/001/002
    susb specification- 210
D/librs: try_fetch_usb_device(...) failed.
    Creating UVC Device from path: /dev/bus/usb/001/002
I/librs: Found 68 unreachable streams, 68 extrinsics deleted
E/librs: SetXU result:-1
D/librs: Creating UVC Device from path: /dev/bus/usb/001/002
I/librs: USB pipe 131 reset successfully
    endpoint 131 read buffer size: 129856
D/librs: time_diff_keeper::start: _users_count = 1
I/librs: USB pipe 130 reset successfully
    endpoint 130 read buffer size: 259456
D/librs: time_diff_keeper::start: _users_count = 2
I/librs: USB pipe 132 reset successfully
    endpoint 132 read buffer size: 203776
D/librs: Transfer thread started for endpoint address: 131
W/librs: bulk_transfer returned error, endpoint: 131, error: Out of memory, number: 12
E/librs: USB transfer failed, the max read buffer size is smaller than the current resolution requires, try to configure lower resolution
I/librs: USB pipe 131 reset successfully
D/librs: start join stream_thread
    Transfer thread stopped for endpoint address: 131
D/librs: Transfer thread started for endpoint address: 132
W/librs: bulk_transfer returned error, endpoint: 132, error: Out of memory, number: 12
E/librs: USB transfer failed, the max read buffer size is smaller than the current resolution requires, try to configure lower resolution
I/librs: USB pipe 132 reset successfully
D/librs: start join stream_thread
    Transfer thread stopped for endpoint address: 132
D/librs: Transfer thread started for endpoint address: 130
W/librs: bulk_transfer returned error, endpoint: 130, error: Out of memory, number: 12
E/librs: USB transfer failed, the max read buffer size is smaller than the current resolution requires, try to configure lower resolution
I/librs: USB pipe 130 reset successfully
D/librs: start join stream_thread
    Transfer thread stopped for endpoint address: 130
E/librs: SetXU result:-1
E/librs: SetXU result:-1
E/librs camera streamer: failed to start streaming
D/librs: start join cb_thread
    cb_thread joined
D/librs: start join cb_thread
    cb_thread joined
D/librs: time_diff_keeper::stop: _users_count = 1
    start join cb_thread
    cb_thread joined
D/librs: time_diff_keeper::stop: _users_count = 0
    time_diff_keeper::stop: stop object.
D/librs: Notification: time_diff_keeper polling loop is being shut-down
E/librs camera pr: UNKNOWN_ERROR
I/Choreographer: Skipped 202 frames!  The application may be doing too much work on its main thread.
D/OpenGLRenderer: eglDestroySurface = 0x75e64b1a40
D/ViewRootImpl@edad6cd[DetachedActivity]: Relayout returned: old=[0,0][1080,1920] new=[0,0][1080,1920] result=0x5 surface={valid=false 0} changed=true
D/ViewRootImpl@edad6cd[DetachedActivity]: MSG_WINDOW_FOCUS_CHANGED 0
D/ViewRootImpl@8eece60[Toast]: setView = android.widget.LinearLayout{ecf4f19 V.E...... ......I. 0,0-0,0} TM=true MM=false
V/Toast: Text: Jnva in android.widget.Toast$TN@eb47bde
D/ViewRootImpl@8eece60[Toast]: dispatchAttachedToWindow
V/Surface: sf_framedrop debug : 0x4f4c, game : false, logging : 0
D/ViewRootImpl@8eece60[Toast]: Relayout returned: old=[0,0][0,0] new=[254,1636][826,1752] result=0x27 surface={valid=true 506472833024} changed=true
I/zygote64: Do partial code cache collection, code=25KB, data=29KB
    After code cache collection, code=24KB, data=29KB
    Increasing code cache capacity to 128KB
D/librs: Librealsense VERSION: 2.23.0
I/librs: Found UVC Device vid: id- 
    vid- 8086
    pid- b07
    mi- 0
    unique_id- /dev/bus/usb/001/002
    path- /dev/bus/usb/001/002
    susb specification- 210
    Found UVC Device vid: id- 
    vid- 8086
    pid- b07
    mi- 3
    unique_id- /dev/bus/usb/001/002
    path- /dev/bus/usb/001/002
    susb specification- 210
D/librs: try_fetch_usb_device(...) failed.
D/librs: Creating UVC Device from path: /dev/bus/usb/001/002
I/librs: Found 65 unreachable streams, 260 extrinsics deleted
D/librs: Creating UVC Device from path: /dev/bus/usb/001/002
I/zygote64: Do partial code cache collection, code=26KB, data=57KB
    After code cache collection, code=26KB, data=57KB
    Increasing code cache capacity to 256KB
I/zygote64: Compiler allocated 9MB to compile void android.widget.TextView.<init>(android.content.Context, android.util.AttributeSet, int, int)
D/ViewRootImpl@526af9a[SettingsActivity]: setView = DecorView@615e0cb[SettingsActivity] TM=true MM=false
D/ViewRootImpl@8eece60[Toast]: MSG_RESIZED_REPORT: frame=Rect(254, 1636 - 826, 1752) ci=Rect(0, 0 - 0, 0) vi=Rect(0, 0 - 0, 0) or=1
V/InputMethodManager: Not IME target window, ignoring
D/ViewRootImpl@526af9a[SettingsActivity]: dispatchAttachedToWindow
I/zygote64: Compiler allocated 4MB to compile void android.view.View.<init>(android.content.Context, android.util.AttributeSet, int, int)
I/zygote64: Do full code cache collection, code=125KB, data=81KB
    After code cache collection, code=121KB, data=65KB
I/zygote64: Do partial code cache collection, code=125KB, data=76KB
    After code cache collection, code=125KB, data=76KB
    Increasing code cache capacity to 512KB
V/Surface: sf_framedrop debug : 0x4f4c, game : false, logging : 0
D/ViewRootImpl@526af9a[SettingsActivity]: Relayout returned: old=[0,0][0,0] new=[0,0][1080,1920] result=0x7 surface={valid=true 505948479488} changed=true
D/mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, egl_color_buffer_format *, EGLBoolean) returns 0x3000,  [1080x1920]-format:1
D/OpenGLRenderer: eglCreateWindowSurface = 0x75e64b1a40
D/AbsListView:  in onLayout changed 
I/zygote64: Do full code cache collection, code=250KB, data=157KB
I/zygote64: After code cache collection, code=242KB, data=133KB
D/AbsListView:  in onLayout changed 
I/zygote64: Do partial code cache collection, code=245KB, data=150KB
I/zygote64: After code cache collection, code=245KB, data=150KB
    Increasing code cache capacity to 1024KB
D/ViewRootImpl@526af9a[SettingsActivity]: MSG_RESIZED_REPORT: frame=Rect(0, 0 - 1080, 1920) ci=Rect(0, 63 - 0, 0) vi=Rect(0, 63 - 0, 0) or=1
    MSG_WINDOW_FOCUS_CHANGED 1
V/InputMethodManager: Starting input: tba=android.view.inputmethod.EditorInfo@672e898 nm : com.intel.realsense.camera ic=null
I/InputMethodManager: startInputInner - mService.startInputOrWindowGainedFocus
V/InputMethodManager: Starting input: tba=android.view.inputmethod.EditorInfo@caf81e3 nm : com.intel.realsense.camera ic=null
D/ViewRootImpl@edad6cd[DetachedActivity]: dispatchDetachedFromWindow
D/InputEventReceiver: channel '9cbb623 com.intel.realsense.camera/com.intel.realsense.camera.DetachedActivity (client)' ~ Disposing input event receiver.
    channel '9cbb623 com.intel.realsense.camera/com.intel.realsense.camera.DetachedActivity (client)' ~NativeInputEventReceiver.
D/ViewRootImpl@8eece60[Toast]: dispatchDetachedFromWindow
D/InputEventReceiver: channel '5b61317 Toast (client)' ~ Disposing input event receiver.
    channel '5b61317 Toast (client)' ~NativeInputEventReceiver.
Logs when D435 is pulled and re-attached to the USB port
I/librs Enumerator: onReceive: android.hardware.usb.action.USB_DEVICE_DETACHED
I/librs MessagesHandler: handleMessage: realsense device detached
I/librs Enumerator: notifyOnDetach
D/librs DeviceWatcher: Removing device: /dev/bus/usb/001/002
D/librs: RemoveUsbDevice, previous device count: 1
E/librs: Cancel request failed: No such device
D/librs: usb device: /dev/bus/usb/001/002, released
    RemoveUsbDevice, removing device: /dev/bus/usb/001/002, descriptor: 75
    RemoveUsbDevice, current device count: 0
D/UsbDeviceConnectionJNI: close
D/librs DeviceWatcher: Device: /dev/bus/usb/001/002 removed successfully
D/librs: Librealsense VERSION: 2.23.0
D/ViewRootImpl@68badc3[DetachedActivity]: setView = DecorView@3c9640[DetachedActivity] TM=true MM=false
D/ViewRootImpl@526af9a[SettingsActivity]: MSG_WINDOW_FOCUS_CHANGED 0
D/ViewRootImpl@68badc3[DetachedActivity]: dispatchAttachedToWindow
V/Surface: sf_framedrop debug : 0x4f4c, game : false, logging : 0
D/ViewRootImpl@68badc3[DetachedActivity]: Relayout returned: old=[0,0][0,0] new=[0,0][1080,1920] result=0x7 surface={valid=true 505948491776} changed=true
D/mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, egl_color_buffer_format *, EGLBoolean) returns 0x3000,  [1080x1920]-format:1
D/OpenGLRenderer: eglCreateWindowSurface = 0x75ce20e630
D/ViewRootImpl@68badc3[DetachedActivity]: MSG_RESIZED_REPORT: frame=Rect(0, 0 - 1080, 1920) ci=Rect(0, 63 - 0, 0) vi=Rect(0, 63 - 0, 0) or=1
    MSG_WINDOW_FOCUS_CHANGED 1
V/InputMethodManager: Starting input: tba=android.view.inputmethod.EditorInfo@39836be nm : com.intel.realsense.camera ic=null
I/InputMethodManager: startInputInner - mService.startInputOrWindowGainedFocus
D/OpenGLRenderer: eglDestroySurface = 0x75e64b1a40
I/zygote64: Compiler allocated 8MB to compile void android.view.ViewRootImpl.performTraversals()
D/OpenGLRenderer: eglDestroySurface = 0x75e64b1a40
D/ViewRootImpl@526af9a[SettingsActivity]: Relayout returned: old=[0,0][1080,1920] new=[0,0][1080,1920] result=0x5 surface={valid=false 0} changed=true
D/ViewRootImpl@526af9a[SettingsActivity]: Relayout returned: old=[0,0][1080,1920] new=[0,0][1080,1920] result=0x1 surface={valid=false 0} changed=false
I/librs Enumerator: onReceive: android.hardware.usb.action.USB_DEVICE_ATTACHED
D/librs UsbUtilities: hasUsbPermission
I/librs MessagesHandler: handleMessage: realsense device attached
I/librs Enumerator: notifyOnAttach
D/librs DeviceWatcher: Adding device: /dev/bus/usb/001/002
D/librs: AddUsbDevice, previous device count: 0
    AddUsbDevice, adding device: /dev/bus/usb/001/002, descriptor: 88
    AddUsbDevice, create
D/librs: AddUsbDevice, notify
I/librs: Found UVC Device vid: id- 
    vid- 8086
    pid- b07
    mi- 0
    unique_id- /dev/bus/usb/001/002
    path- /dev/bus/usb/001/002
    susb specification- 210
    Found UVC Device vid: id- 
    vid- 8086
    pid- b07
    mi- 3
    unique_id- /dev/bus/usb/001/002
    path- /dev/bus/usb/001/002
    susb specification- 210
D/librs: AddUsbDevice, current device count: 1
I/librs: Found UVC Device vid: id- 
    vid- 8086
    pid- b07
    mi- 0
    unique_id- /dev/bus/usb/001/002
    path- /dev/bus/usb/001/002
    susb specification- 210
    Found UVC Device vid: id- 
    vid- 8086
    pid- b07
    mi- 3
    unique_id- /dev/bus/usb/001/002
    path- /dev/bus/usb/001/002
    susb specification- 210
D/librs: try_fetch_usb_device(...) failed.
    Creating UVC Device from path: /dev/bus/usb/001/002
I/librs: Found 68 unreachable streams, 272 extrinsics deleted
D/librs: interrupt_request: 1, 3, 0, 7, 0, 0, 
E/librs: SetXU result:-1
D/librs: interrupt_request: 1, 3, 0, 7, 0, 0, 
D/ViewRootImpl@68badc3[DetachedActivity]: MSG_WINDOW_FOCUS_CHANGED 0
D/ViewRootImpl@68badc3[DetachedActivity]: MSG_WINDOW_FOCUS_CHANGED 1
D/librs: Creating UVC Device from path: /dev/bus/usb/001/002
I/librs: Found UVC Device vid: id- 
    vid- 8086
    pid- b07
    mi- 0
    unique_id- /dev/bus/usb/001/002
    path- /dev/bus/usb/001/002
    susb specification- 210
I/librs: Found UVC Device vid: id- 
    vid- 8086
    pid- b07
    mi- 3
    unique_id- /dev/bus/usb/001/002
    path- /dev/bus/usb/001/002
    susb specification- 210
D/librs: try_fetch_usb_device(...) failed.
    Creating UVC Device from path: /dev/bus/usb/001/002
I/librs: Found 4 unreachable streams, 16 extrinsics deleted
D/librs: Creating UVC Device from path: /dev/bus/usb/001/002
D/librs DeviceWatcher: Device: /dev/bus/usb/001/002 added successfully
I/librs: Found UVC Device vid: id- 
    vid- 8086
    pid- b07
    mi- 0
    unique_id- /dev/bus/usb/001/002
    path- /dev/bus/usb/001/002
    susb specification- 210
    Found UVC Device vid: id- 
    vid- 8086
    pid- b07
    mi- 3
    unique_id- /dev/bus/usb/001/002
    path- /dev/bus/usb/001/002
    susb specification- 210
D/librs: try_fetch_usb_device(...) failed.
I/librs: Found UVC Device vid: id- 
    vid- 8086
    pid- b07
    mi- 0
    unique_id- /dev/bus/usb/001/002
    path- /dev/bus/usb/001/002
    susb specification- 210
    Found UVC Device vid: id- 
    vid- 8086
    pid- b07
    mi- 3
    unique_id- /dev/bus/usb/001/002
    path- /dev/bus/usb/001/002
    susb specification- 210
D/librs: try_fetch_usb_device(...) failed.
    Creating UVC Device from path: /dev/bus/usb/001/002
I/librs: Found 4 unreachable streams, 16 extrinsics deleted
D/librs: Creating UVC Device from path: /dev/bus/usb/001/002
W/LayerDrawable: Invalid drawable added to LayerDrawable! Drawable already belongs to another owner but does not expose a constant state.
    java.lang.RuntimeException
        at android.graphics.drawable.LayerDrawable$ChildDrawable.<init>(LayerDrawable.java:1855)
        at android.graphics.drawable.LayerDrawable$LayerState.<init>(LayerDrawable.java:1975)
        at android.graphics.drawable.RippleDrawable$RippleState.<init>(RippleDrawable.java:1021)
        at android.graphics.drawable.RippleDrawable.createConstantState(RippleDrawable.java:1011)
        at android.graphics.drawable.RippleDrawable.createConstantState(RippleDrawable.java:1009)
        at android.graphics.drawable.LayerDrawable.mutate(LayerDrawable.java:1779)
        at android.graphics.drawable.RippleDrawable.mutate(RippleDrawable.java:997)
        at android.view.View.applyBackgroundTint(View.java:21827)
        at android.view.View.setBackgroundDrawable(View.java:21698)
        at android.support.design.widget.FloatingActionButton.access$001(FloatingActionButton.java:68)
        at android.support.design.widget.FloatingActionButton$ShadowDelegateImpl.setBackgroundDrawable(FloatingActionButton.java:824)
        at android.support.design.widget.FloatingActionButtonLollipop.setBackgroundDrawable(FloatingActionButtonLollipop.java:73)
        at android.support.design.widget.FloatingActionButton.<init>(FloatingActionButton.java:179)
        at android.support.design.widget.FloatingActionButton.<init>(FloatingActionButton.java:151)
        at java.lang.reflect.Constructor.newInstance0(Native Method)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:334)
        at android.view.LayoutInflater.createView(LayoutInflater.java:647)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:790)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:863)
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
        at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:287)
        at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139)
        at com.intel.realsense.camera.PreviewActivity.onCreate(PreviewActivity.java:56)
        at android.app.Activity.performCreate(Activity.java:7183)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1220)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2910)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3032)
        at android.app.ActivityThread.-wrap11(Unknown Source:0)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1696)
        at android.os.Handler.dispatchMessage(Handler.java:105)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6944)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
W/LayerDrawable: Invalid drawable added to LayerDrawable! Drawable already belongs to another owner but does not expose a constant state.
    java.lang.RuntimeException
        at android.graphics.drawable.LayerDrawable$ChildDrawable.<init>(LayerDrawable.java:1855)
        at android.graphics.drawable.LayerDrawable$LayerState.<init>(LayerDrawable.java:1975)
        at android.graphics.drawable.LayerDrawable.createConstantState(LayerDrawable.java:168)
        at android.graphics.drawable.LayerDrawable.mutate(LayerDrawable.java:1779)
        at android.graphics.drawable.LayerDrawable.mutate(LayerDrawable.java:1785)
        at android.graphics.drawable.RippleDrawable.mutate(RippleDrawable.java:997)
        at android.view.View.applyBackgroundTint(View.java:21827)
        at android.view.View.setBackgroundDrawable(View.java:21698)
        at android.support.design.widget.FloatingActionButton.access$001(FloatingActionButton.java:68)
        at android.support.design.widget.FloatingActionButton$ShadowDelegateImpl.setBackgroundDrawable(FloatingActionButton.java:824)
        at android.support.design.widget.FloatingActionButtonLollipop.setBackgroundDrawable(FloatingActionButtonLollipop.java:73)
        at android.support.design.widget.FloatingActionButton.<init>(FloatingActionButton.java:179)
        at android.support.design.widget.FloatingActionButton.<init>(FloatingActionButton.java:151)
        at java.lang.reflect.Constructor.newInstance0(Native Method)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:334)
        at android.view.LayoutInflater.createView(LayoutInflater.java:647)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:790)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:863)
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
        at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:287)
        at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139)
        at com.intel.realsense.camera.PreviewActivity.onCreate(PreviewActivity.java:56)
        at android.app.Activity.performCreate(Activity.java:7183)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1220)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2910)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3032)
        at android.app.ActivityThread.-wrap11(Unknown Source:0)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1696)
        at android.os.Handler.dispatchMessage(Handler.java:105)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6944)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
D/librs: Librealsense VERSION: 2.23.0
I/librs: Found UVC Device vid: id- 
    vid- 8086
    pid- b07
    mi- 0
    unique_id- /dev/bus/usb/001/002
    path- /dev/bus/usb/001/002
    susb specification- 210
    Found UVC Device vid: id- 
    vid- 8086
    pid- b07
    mi- 3
    unique_id- /dev/bus/usb/001/002
    path- /dev/bus/usb/001/002
    susb specification- 210
D/librs: try_fetch_usb_device(...) failed.
D/librs camera streamer: try start streaming
D/librs: Librealsense VERSION: 2.23.0
I/librs: Found UVC Device vid: id- 
    vid- 8086
    pid- b07
    mi- 0
    unique_id- /dev/bus/usb/001/002
    path- /dev/bus/usb/001/002
    susb specification- 210
    Found UVC Device vid: id- 
    vid- 8086
    pid- b07
    mi- 3
    unique_id- /dev/bus/usb/001/002
    path- /dev/bus/usb/001/002
    susb specification- 210
D/librs: try_fetch_usb_device(...) failed.
    Creating UVC Device from path: /dev/bus/usb/001/002
I/librs: Found 4 unreachable streams, 16 extrinsics deleted
D/librs: Creating UVC Device from path: /dev/bus/usb/001/002
I/librs: Found UVC Device vid: id- 
    vid- 8086
    pid- b07
    mi- 0
    unique_id- /dev/bus/usb/001/002
    path- /dev/bus/usb/001/002
    susb specification- 210
    Found UVC Device vid: id- 
    vid- 8086
    pid- b07
    mi- 3
    unique_id- /dev/bus/usb/001/002
    path- /dev/bus/usb/001/002
    susb specification- 210
D/librs: try_fetch_usb_device(...) failed.
    Creating UVC Device from path: /dev/bus/usb/001/002
I/librs: Found 68 unreachable streams, 272 extrinsics deleted
E/librs: SetXU result:-1
D/librs: Creating UVC Device from path: /dev/bus/usb/001/002
E/librs: SetXU result:-1
I/librs: USB pipe 131 reset successfully
    endpoint 131 read buffer size: 129856
D/librs: time_diff_keeper::start: _users_count = 1
I/librs: USB pipe 130 reset successfully
I/librs: endpoint 130 read buffer size: 259456
D/librs: time_diff_keeper::start: _users_count = 2
I/librs: USB pipe 132 reset successfully
    endpoint 132 read buffer size: 203776
D/librs: Transfer thread started for endpoint address: 131
D/librs: Transfer thread started for endpoint address: 132
W/librs: bulk_transfer returned error, endpoint: 132, error: Out of memory, number: 12
E/librs: USB transfer failed, the max read buffer size is smaller than the current resolution requires, try to configure lower resolution
I/librs: USB pipe 132 reset successfully
D/librs: start join stream_thread
D/librs: Transfer thread stopped for endpoint address: 132
D/librs: Transfer thread started for endpoint address: 130
W/librs: bulk_transfer returned error, endpoint: 130, error: Out of memory, number: 12
E/librs: USB transfer failed, the max read buffer size is smaller than the current resolution requires, try to configure lower resolution
I/librs: USB pipe 130 reset successfully
D/librs: start join stream_thread
D/librs: Transfer thread stopped for endpoint address: 130
W/librs: bulk_transfer returned error, endpoint: 131, error: Connection timed out, number: 110
W/librs: bulk_transfer returned error, endpoint: 131, error: Connection timed out, number: 110
W/librs: bulk_transfer returned error, endpoint: 131, error: Connection timed out, number: 110
W/librs: bulk_transfer returned error, endpoint: 131, error: Connection timed out, number: 110
W/librs: bulk_transfer returned error, endpoint: 131, error: Connection timed out, number: 110
W/librs: bulk_transfer returned error, endpoint: 131, error: Connection timed out, number: 110
W/librs: bulk_transfer returned error, endpoint: 131, error: Connection timed out, number: 110
W/librs: bulk_transfer returned error, endpoint: 131, error: Connection timed out, number: 110
W/librs: bulk_transfer returned error, endpoint: 131, error: Connection timed out, number: 110
W/librs: bulk_transfer returned error, endpoint: 131, error: Connection timed out, number: 110
W/librs: bulk_transfer returned error, endpoint: 131, error: Connection timed out, number: 110
I/chatty: uid=10603(u0_a603) com.intel.realsense.camera identical 4 lines
W/librs: bulk_transfer returned error, endpoint: 131, error: Connection timed out, number: 110
W/librs: bulk_transfer returned error, endpoint: 131, error: Connection timed out, number: 110
E/librs camera streamer: failed to start streaming
D/librs: start join cb_thread
W/librs: bulk_transfer returned error, endpoint: 131, error: Connection timed out, number: 110
I/librs: USB pipe 131 reset successfully
D/librs: start join stream_thread
D/librs: Transfer thread stopped for endpoint address: 131
D/librs: cb_thread joined
    start join cb_thread
D/librs: cb_thread joined
D/librs: time_diff_keeper::stop: _users_count = 1
    start join cb_thread
D/librs: cb_thread joined
D/librs: time_diff_keeper::stop: _users_count = 0
    time_diff_keeper::stop: stop object.
E/librs camera pr: UNKNOWN_ERROR
D/ViewRootImpl@68badc3[DetachedActivity]: MSG_WINDOW_FOCUS_CHANGED 0
D/ViewRootImpl@a51e193[Toast]: setView = android.widget.LinearLayout{24a05d0 V.E...... ......I. 0,0-0,0} TM=true MM=false
V/Toast: Text: Jnva in android.widget.Toast$TN@62a09c9
D/ViewRootImpl@a51e193[Toast]: dispatchAttachedToWindow
V/Surface: sf_framedrop debug : 0x4f4c, game : false, logging : 0
D/ViewRootImpl@a51e193[Toast]: Relayout returned: old=[0,0][0,0] new=[254,1636][826,1752] result=0x7 surface={valid=true 505948725248} changed=true
D/librs: Librealsense VERSION: 2.23.0
I/librs: Found UVC Device vid: id- 
    vid- 8086
    pid- b07
    mi- 0
    unique_id- /dev/bus/usb/001/002
    path- /dev/bus/usb/001/002
    susb specification- 210
    Found UVC Device vid: id- 
    vid- 8086
    pid- b07
    mi- 3
    unique_id- /dev/bus/usb/001/002
    path- /dev/bus/usb/001/002
    susb specification- 210
D/librs: try_fetch_usb_device(...) failed.
D/librs: Creating UVC Device from path: /dev/bus/usb/001/002
I/librs: Found 65 unreachable streams, 455 extrinsics deleted
E/librs: SetXU result:-1
D/librs: Creating UVC Device from path: /dev/bus/usb/001/002
D/ViewRootImpl@c065583[SettingsActivity]: setView = DecorView@3128300[SettingsActivity] TM=true MM=false
D/ViewRootImpl@a51e193[Toast]: MSG_RESIZED_REPORT: frame=Rect(254, 1636 - 826, 1752) ci=Rect(0, 0 - 0, 0) vi=Rect(0, 0 - 0, 0) or=1
V/InputMethodManager: Not IME target window, ignoring
D/ViewRootImpl@c065583[SettingsActivity]: dispatchAttachedToWindow
V/Surface: sf_framedrop debug : 0x4f4c, game : false, logging : 0
D/ViewRootImpl@c065583[SettingsActivity]: Relayout returned: old=[0,0][0,0] new=[0,0][1080,1920] result=0x7 surface={valid=true 505948639232} changed=true
D/mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, egl_color_buffer_format *, EGLBoolean) returns 0x3000,  [1080x1920]-format:1
D/OpenGLRenderer: eglCreateWindowSurface = 0x75e64b19f0
D/AbsListView:  in onLayout changed 
D/AbsListView:  in onLayout changed 
I/zygote64: Do full code cache collection, code=504KB, data=342KB
I/zygote64: After code cache collection, code=503KB, data=303KB
D/AbsListView:  in onLayout changed 
D/ViewRootImpl@c065583[SettingsActivity]: MSG_RESIZED_REPORT: frame=Rect(0, 0 - 1080, 1920) ci=Rect(0, 63 - 0, 0) vi=Rect(0, 63 - 0, 0) or=1
D/ViewRootImpl@c065583[SettingsActivity]: MSG_WINDOW_FOCUS_CHANGED 1
V/InputMethodManager: Starting input: tba=android.view.inputmethod.EditorInfo@b2208f0 nm : com.intel.realsense.camera ic=null
I/InputMethodManager: startInputInner - mService.startInputOrWindowGainedFocus
I/zygote64: Do partial code cache collection, code=504KB, data=310KB
    After code cache collection, code=504KB, data=310KB
    Increasing code cache capacity to 2MB
D/OpenGLRenderer: eglDestroySurface = 0x75ce20e630
D/ViewRootImpl@68badc3[DetachedActivity]: Relayout returned: old=[0,0][1080,1920] new=[0,0][1080,1920] result=0x5 surface={valid=false 0} changed=true
D/ViewRootImpl@68badc3[DetachedActivity]: dispatchDetachedFromWindow
D/InputEventReceiver: channel 'fa99c0a com.intel.realsense.camera/com.intel.realsense.camera.DetachedActivity (client)' ~ Disposing input event receiver.
    channel 'fa99c0a com.intel.realsense.camera/com.intel.realsense.camera.DetachedActivity (client)' ~NativeInputEventReceiver.
D/ViewRootImpl@a51e193[Toast]: dispatchDetachedFromWindow
D/InputEventReceiver: channel '58399ab Toast (client)' ~ Disposing input event receiver.
    channel '58399ab Toast (client)' ~NativeInputEventReceiver.

@Mad-Thanos
Copy link
Author

I got a similar result to the one from @dreifelix. I was running the example app capture on Huawei P20 + librealsense-dev v2.23.0.13.
Here is the code snippet to config and start the stream:
image

The critical error in logcat:

2019-06-17 23:22:47.432 26320-27063/com.intel.realsense.capture W/librs: bulk_transfer returned error, endpoint: 130, error: Out of memory, number: 12
2019-06-17 23:22:47.432 26320-27063/com.intel.realsense.capture E/librs: USB transfer failed, the max read buffer size is smaller than the current resolution requires, try to configure lower resolution
Click to expand the detailed log
2019-06-17 23:22:19.037 26320-26320/? I/zygote64: Late-enabling -Xcheck:jni
2019-06-17 23:22:19.052 26320-26320/? I/zygote64: Reinit property: dalvik.vm.checkjni= false
2019-06-17 23:22:19.068 26320-26320/? D/ActivityThread: Attach thread to application
2019-06-17 23:22:19.098 26320-26320/com.intel.realsense.capture D/HwFLClassLoader: get used feature list :/feature/used-list failed!
2019-06-17 23:22:19.098 26320-26320/com.intel.realsense.capture D/HwFLClassLoader: USE_FEATURE_LIST had not init! 
2019-06-17 23:22:19.111 26320-26320/com.intel.realsense.capture E/MemoryLeakMonitorManager: MemoryLeakMonitor.jar is not exist!
2019-06-17 23:22:19.112 26320-26320/com.intel.realsense.capture E/Minikin: Could not get cmap table size!
2019-06-17 23:22:19.124 26320-26320/com.intel.realsense.capture I/HwCust: Constructor found for class android.app.HwCustActivityImpl
2019-06-17 23:22:19.124 26320-26320/com.intel.realsense.capture D/HwCust: Create obj success use class android.app.HwCustActivityImpl
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64: Rejecting re-init on previously-failed class java.lang.Class<android.support.v4.view.ViewCompat$OnUnhandledKeyEventListenerWrapper>: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/view/View$OnUnhandledKeyEventListener;
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.support.v4.view.ViewCompat.setOnApplyWindowInsetsListener(android.view.View, android.support.v4.view.OnApplyWindowInsetsListener) (ViewCompat.java:2203)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at android.view.ViewGroup android.support.v7.app.AppCompatDelegateImpl.createSubDecor() (AppCompatDelegateImpl.java:637)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.support.v7.app.AppCompatDelegateImpl.ensureSubDecor() (AppCompatDelegateImpl.java:518)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.support.v7.app.AppCompatDelegateImpl.setContentView(int) (AppCompatDelegateImpl.java:466)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.support.v7.app.AppCompatActivity.setContentView(int) (AppCompatActivity.java:140)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void com.intel.realsense.capture.MainActivity.onCreate(android.os.Bundle) (MainActivity.java:45)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.app.Activity.performCreate(android.os.Bundle, android.os.PersistableBundle) (Activity.java:7352)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.app.Activity.performCreate(android.os.Bundle) (Activity.java:7343)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.app.Instrumentation.callActivityOnCreate(android.app.Activity, android.os.Bundle) (Instrumentation.java:1219)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at android.app.Activity android.app.ActivityThread.performLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent) (ActivityThread.java:3110)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.app.ActivityThread.handleLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:3268)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.app.ActivityThread.-wrap12(android.app.ActivityThread, android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:-1)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.app.ActivityThread$H.handleMessage(android.os.Message) (ActivityThread.java:1888)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:109)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.os.Looper.loop() (Looper.java:166)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:7367)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[]) (Method.java:-2)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run() (RuntimeInit.java:469)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:963)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64: Caused by: java.lang.ClassNotFoundException: Didn't find class "android.view.View$OnUnhandledKeyEventListener" on path: DexPathList[[zip file "/data/app/com.intel.realsense.capture-RGVWOwpQW6ABvh6_z3R5nQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.intel.realsense.capture-RGVWOwpQW6ABvh6_z3R5nQ==/lib/arm64, /data/app/com.intel.realsense.capture-RGVWOwpQW6ABvh6_z3R5nQ==/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64, /product/lib64]]
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:125)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:379)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:312)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.support.v4.view.ViewCompat.setOnApplyWindowInsetsListener(android.view.View, android.support.v4.view.OnApplyWindowInsetsListener) (ViewCompat.java:2203)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at android.view.ViewGroup android.support.v7.app.AppCompatDelegateImpl.createSubDecor() (AppCompatDelegateImpl.java:637)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.support.v7.app.AppCompatDelegateImpl.ensureSubDecor() (AppCompatDelegateImpl.java:518)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.support.v7.app.AppCompatDelegateImpl.setContentView(int) (AppCompatDelegateImpl.java:466)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.support.v7.app.AppCompatActivity.setContentView(int) (AppCompatActivity.java:140)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void com.intel.realsense.capture.MainActivity.onCreate(android.os.Bundle) (MainActivity.java:45)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.app.Activity.performCreate(android.os.Bundle, android.os.PersistableBundle) (Activity.java:7352)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.app.Activity.performCreate(android.os.Bundle) (Activity.java:7343)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.app.Instrumentation.callActivityOnCreate(android.app.Activity, android.os.Bundle) (Instrumentation.java:1219)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at android.app.Activity android.app.ActivityThread.performLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent) (ActivityThread.java:3110)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.app.ActivityThread.handleLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:3268)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.app.ActivityThread.-wrap12(android.app.ActivityThread, android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:-1)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.app.ActivityThread$H.handleMessage(android.os.Message) (ActivityThread.java:1888)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:109)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.os.Looper.loop() (Looper.java:166)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:7367)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[]) (Method.java:-2)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run() (RuntimeInit.java:469)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:963)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64: Rejecting re-init on previously-failed class java.lang.Class<android.support.v4.view.ViewCompat$OnUnhandledKeyEventListenerWrapper>: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/view/View$OnUnhandledKeyEventListener;
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.support.v4.view.ViewCompat.setOnApplyWindowInsetsListener(android.view.View, android.support.v4.view.OnApplyWindowInsetsListener) (ViewCompat.java:2203)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at android.view.ViewGroup android.support.v7.app.AppCompatDelegateImpl.createSubDecor() (AppCompatDelegateImpl.java:637)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.support.v7.app.AppCompatDelegateImpl.ensureSubDecor() (AppCompatDelegateImpl.java:518)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.support.v7.app.AppCompatDelegateImpl.setContentView(int) (AppCompatDelegateImpl.java:466)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.support.v7.app.AppCompatActivity.setContentView(int) (AppCompatActivity.java:140)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void com.intel.realsense.capture.MainActivity.onCreate(android.os.Bundle) (MainActivity.java:45)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.app.Activity.performCreate(android.os.Bundle, android.os.PersistableBundle) (Activity.java:7352)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.app.Activity.performCreate(android.os.Bundle) (Activity.java:7343)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.app.Instrumentation.callActivityOnCreate(android.app.Activity, android.os.Bundle) (Instrumentation.java:1219)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at android.app.Activity android.app.ActivityThread.performLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent) (ActivityThread.java:3110)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.app.ActivityThread.handleLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:3268)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.app.ActivityThread.-wrap12(android.app.ActivityThread, android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:-1)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.app.ActivityThread$H.handleMessage(android.os.Message) (ActivityThread.java:1888)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:109)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.os.Looper.loop() (Looper.java:166)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:7367)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[]) (Method.java:-2)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run() (RuntimeInit.java:469)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:963)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64: Caused by: java.lang.ClassNotFoundException: Didn't find class "android.view.View$OnUnhandledKeyEventListener" on path: DexPathList[[zip file "/data/app/com.intel.realsense.capture-RGVWOwpQW6ABvh6_z3R5nQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.intel.realsense.capture-RGVWOwpQW6ABvh6_z3R5nQ==/lib/arm64, /data/app/com.intel.realsense.capture-RGVWOwpQW6ABvh6_z3R5nQ==/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64, /product/lib64]]
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:125)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:379)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:312)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.support.v4.view.ViewCompat.setOnApplyWindowInsetsListener(android.view.View, android.support.v4.view.OnApplyWindowInsetsListener) (ViewCompat.java:2203)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at android.view.ViewGroup android.support.v7.app.AppCompatDelegateImpl.createSubDecor() (AppCompatDelegateImpl.java:637)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.support.v7.app.AppCompatDelegateImpl.ensureSubDecor() (AppCompatDelegateImpl.java:518)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.support.v7.app.AppCompatDelegateImpl.setContentView(int) (AppCompatDelegateImpl.java:466)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.support.v7.app.AppCompatActivity.setContentView(int) (AppCompatActivity.java:140)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void com.intel.realsense.capture.MainActivity.onCreate(android.os.Bundle) (MainActivity.java:45)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.app.Activity.performCreate(android.os.Bundle, android.os.PersistableBundle) (Activity.java:7352)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.app.Activity.performCreate(android.os.Bundle) (Activity.java:7343)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.app.Instrumentation.callActivityOnCreate(android.app.Activity, android.os.Bundle) (Instrumentation.java:1219)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at android.app.Activity android.app.ActivityThread.performLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent) (ActivityThread.java:3110)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.app.ActivityThread.handleLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:3268)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.app.ActivityThread.-wrap12(android.app.ActivityThread, android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:-1)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.app.ActivityThread$H.handleMessage(android.os.Message) (ActivityThread.java:1888)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:109)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.os.Looper.loop() (Looper.java:166)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:7367)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[]) (Method.java:-2)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run() (RuntimeInit.java:469)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:963)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64: Rejecting re-init on previously-failed class java.lang.Class<android.support.v4.view.ViewCompat$OnUnhandledKeyEventListenerWrapper>: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/view/View$OnUnhandledKeyEventListener;
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.support.v4.view.ViewCompat.setOnApplyWindowInsetsListener(android.view.View, android.support.v4.view.OnApplyWindowInsetsListener) (ViewCompat.java:2203)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at android.view.ViewGroup android.support.v7.app.AppCompatDelegateImpl.createSubDecor() (AppCompatDelegateImpl.java:637)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.support.v7.app.AppCompatDelegateImpl.ensureSubDecor() (AppCompatDelegateImpl.java:518)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.support.v7.app.AppCompatDelegateImpl.setContentView(int) (AppCompatDelegateImpl.java:466)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.support.v7.app.AppCompatActivity.setContentView(int) (AppCompatActivity.java:140)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void com.intel.realsense.capture.MainActivity.onCreate(android.os.Bundle) (MainActivity.java:45)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.app.Activity.performCreate(android.os.Bundle, android.os.PersistableBundle) (Activity.java:7352)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.app.Activity.performCreate(android.os.Bundle) (Activity.java:7343)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.app.Instrumentation.callActivityOnCreate(android.app.Activity, android.os.Bundle) (Instrumentation.java:1219)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at android.app.Activity android.app.ActivityThread.performLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent) (ActivityThread.java:3110)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.app.ActivityThread.handleLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:3268)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.app.ActivityThread.-wrap12(android.app.ActivityThread, android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:-1)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.app.ActivityThread$H.handleMessage(android.os.Message) (ActivityThread.java:1888)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:109)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.os.Looper.loop() (Looper.java:166)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:7367)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[]) (Method.java:-2)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run() (RuntimeInit.java:469)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:963)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64: Caused by: java.lang.ClassNotFoundException: Didn't find class "android.view.View$OnUnhandledKeyEventListener" on path: DexPathList[[zip file "/data/app/com.intel.realsense.capture-RGVWOwpQW6ABvh6_z3R5nQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.intel.realsense.capture-RGVWOwpQW6ABvh6_z3R5nQ==/lib/arm64, /data/app/com.intel.realsense.capture-RGVWOwpQW6ABvh6_z3R5nQ==/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64, /product/lib64]]
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:125)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:379)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:312)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.support.v4.view.ViewCompat.setOnApplyWindowInsetsListener(android.view.View, android.support.v4.view.OnApplyWindowInsetsListener) (ViewCompat.java:2203)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at android.view.ViewGroup android.support.v7.app.AppCompatDelegateImpl.createSubDecor() (AppCompatDelegateImpl.java:637)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.support.v7.app.AppCompatDelegateImpl.ensureSubDecor() (AppCompatDelegateImpl.java:518)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.support.v7.app.AppCompatDelegateImpl.setContentView(int) (AppCompatDelegateImpl.java:466)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.support.v7.app.AppCompatActivity.setContentView(int) (AppCompatActivity.java:140)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void com.intel.realsense.capture.MainActivity.onCreate(android.os.Bundle) (MainActivity.java:45)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.app.Activity.performCreate(android.os.Bundle, android.os.PersistableBundle) (Activity.java:7352)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.app.Activity.performCreate(android.os.Bundle) (Activity.java:7343)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.app.Instrumentation.callActivityOnCreate(android.app.Activity, android.os.Bundle) (Instrumentation.java:1219)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at android.app.Activity android.app.ActivityThread.performLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent) (ActivityThread.java:3110)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.app.ActivityThread.handleLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:3268)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.app.ActivityThread.-wrap12(android.app.ActivityThread, android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:-1)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.app.ActivityThread$H.handleMessage(android.os.Message) (ActivityThread.java:1888)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:109)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.os.Looper.loop() (Looper.java:166)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:7367)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[]) (Method.java:-2)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run() (RuntimeInit.java:469)
2019-06-17 23:22:19.158 26320-26320/com.intel.realsense.capture I/zygote64:     at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:963)
2019-06-17 23:22:19.168 26320-26320/com.intel.realsense.capture D/HwRTBlurUtils: check blur style for HwPhoneWindow, themeResId : 0x7f0c0006, context : com.intel.realsense.capture.MainActivity@432b82e, Nhwext : 0, get Blur : disable with , null
2019-06-17 23:22:19.168 26320-26320/com.intel.realsense.capture D/HwRTBlurUtils: check blur style for HwPhoneWindow, themeResId : 0x7f0c0006, context : com.intel.realsense.capture.MainActivity@432b82e, Nhwext : 0, get Blur : disable with , null
2019-06-17 23:22:19.181 26320-26320/com.intel.realsense.capture I/librs capture example: CAMERA permission granted!
2019-06-17 23:22:19.183 26320-26320/com.intel.realsense.capture D/ActivityThread: add activity client record, r= ActivityRecord{b14a592 token=android.os.BinderProxy@5e17f73 {com.intel.realsense.capture/com.intel.realsense.capture.MainActivity}} token= android.os.BinderProxy@5e17f73
2019-06-17 23:22:19.211 26320-26320/com.intel.realsense.capture W/librs UsbUtilities: getUsbDevice: failed to locate USB device, VID: 0x8086, PID: 0x0000
2019-06-17 23:22:19.211 26320-26320/com.intel.realsense.capture D/librs UsbUtilities: hasUsbPermission
2019-06-17 23:22:19.211 26320-26320/com.intel.realsense.capture W/librs UsbUtilities: hasUsbPermission: null USB device
2019-06-17 23:22:19.211 26320-26320/com.intel.realsense.capture W/librs UsbUtilities: getUsbDevice: failed to locate USB device, VID: 0x8086, PID: 0x0000
2019-06-17 23:22:19.211 26320-26320/com.intel.realsense.capture D/librs UsbUtilities: grantUsbPermissions
2019-06-17 23:22:19.211 26320-26320/com.intel.realsense.capture W/librs UsbUtilities: grantUsbPermissions: null USB device
2019-06-17 23:22:19.216 26320-26320/com.intel.realsense.capture W/VRSystemServiceManager: vr service is not alive
2019-06-17 23:22:19.222 26320-26320/com.intel.realsense.capture I/hwaps: HwAps: JNI_OnLoad
2019-06-17 23:22:19.224 26320-26320/com.intel.realsense.capture D/OpenGLRenderer:   HWUI Binary is  enabled
2019-06-17 23:22:19.227 26320-26348/com.intel.realsense.capture D/OpenGLRenderer: HWUI GL Pipeline
2019-06-17 23:22:19.266 26320-26348/com.intel.realsense.capture I/zygote64: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay retrieved: 0
2019-06-17 23:22:19.269 26320-26348/com.intel.realsense.capture I/OpenGLRenderer: Initialized EGL, version 1.4
2019-06-17 23:22:19.269 26320-26348/com.intel.realsense.capture D/OpenGLRenderer: Swap behavior 2
2019-06-17 23:22:19.276 26320-26348/com.intel.realsense.capture D/mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, egl_color_buffer_format *, EGLBoolean) returns 0x3000
2019-06-17 23:22:19.287 26320-26344/com.intel.realsense.capture D/mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, egl_color_buffer_format *, EGLBoolean) returns 0x3000
2019-06-17 23:22:19.312 26320-26320/com.intel.realsense.capture W/InputMethodManager: startInputReason = 1
2019-06-17 23:22:19.325 26320-26320/com.intel.realsense.capture W/InputMethodManager: startInputReason = 5
2019-06-17 23:22:45.027 26320-26320/com.intel.realsense.capture I/librs Enumerator: onReceive: android.hardware.usb.action.USB_DEVICE_ATTACHED
2019-06-17 23:22:45.058 26320-26320/com.intel.realsense.capture D/librs UsbUtilities: hasUsbPermission
2019-06-17 23:22:45.059 26320-26320/com.intel.realsense.capture D/librs UsbUtilities: grantUsbPermissions
2019-06-17 23:22:45.060 26320-26320/com.intel.realsense.capture I/librs UsbUtilities: grantUsbPermissions:
    device: UsbDevice[mName=/dev/bus/usb/003/002,mVendorId=32902,mProductId=2771,mClass=239,mSubclass=2,mProtocol=1,mManufacturerName=Intel(R) RealSense(TM) Depth Camera 415 ,mProductName=Intel(R) RealSense(TM) Depth Camera 415 ,mVersion=3.32,mSerialNumber=843613022726,mConfigurations=[
    UsbConfiguration[mId=1,mName=null,mAttributes=192,mMaxPower=55,mInterfaces=[
    UsbInterface[mId=0,mAlternateSetting=0,mName=Intel(R) RealSense(TM) Depth Camera 415  Depth,mClass=14,mSubclass=1,mProtocol=0,mEndpoints=[
    UsbEndpoint[mAddress=135,mAttributes=3,mMaxPacketSize=64,mInterval=6]]
    UsbInterface[mId=1,mAlternateSetting=0,mName=Intel(R) RealSense(TM) Depth Camera 415  Depth,mClass=14,mSubclass=2,mProtocol=0,mEndpoints=[
    UsbEndpoint[mAddress=130,mAttributes=2,mMaxPacketSize=1024,mInterval=0]]
    UsbInterface[mId=2,mAlternateSetting=0,mName=Intel(R) RealSense(TM) Depth Camera 415  Y,mClass=14,mSubclass=2,mProtocol=0,mEndpoints=[
    UsbEndpoint[mAddress=131,mAttributes=2,mMaxPacketSize=1024,mInterval=0]]
    UsbInterface[mId=3,mAlternateSetting=0,mName=Intel(R) RealSense(TM) Depth Camera 415  RGB,mClass=14,mSubclass=1,mProtocol=0,mEndpoints=[]
    UsbInterface[mId=4,mAlternateSetting=0,mName=Intel(R) RealSense(TM) Depth Camera 415  RGB,mClass=14,mSubclass=2,mProtocol=0,mEndpoints=[
    UsbEndpoint[mAddress=132,mAttributes=2,mMaxPacketSize=1024,mInterval=0]]]]
2019-06-17 23:22:45.325 26320-26348/com.intel.realsense.capture W/libEGL: EGLNativeWindowType 0x78f6a8c010 disconnect failed
2019-06-17 23:22:45.325 26320-26348/com.intel.realsense.capture D/mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, egl_color_buffer_format *, EGLBoolean) returns 0x3000
2019-06-17 23:22:45.342 26320-26344/com.intel.realsense.capture W/libEGL: EGLNativeWindowType 0x78f6a8d010 disconnect failed
2019-06-17 23:22:45.342 26320-26344/com.intel.realsense.capture D/mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, egl_color_buffer_format *, EGLBoolean) returns 0x3000
2019-06-17 23:22:46.240 26320-26320/com.intel.realsense.capture I/librs Enumerator: onReceive: USB_CONTROL_PERMISSION
2019-06-17 23:22:46.240 26320-26320/com.intel.realsense.capture D/librs UsbUtilities: hasUsbPermission
2019-06-17 23:22:46.240 26320-26325/com.intel.realsense.capture I/zygote64: Do partial code cache collection, code=24KB, data=29KB
2019-06-17 23:22:46.241 26320-26325/com.intel.realsense.capture I/zygote64: After code cache collection, code=24KB, data=29KB
2019-06-17 23:22:46.241 26320-26325/com.intel.realsense.capture I/zygote64: Increasing code cache capacity to 128KB
2019-06-17 23:22:46.241 26320-26320/com.intel.realsense.capture D/librs UsbUtilities: hasUsbPermission
2019-06-17 23:22:46.242 26320-26345/com.intel.realsense.capture I/librs MessagesHandler: handleMessage: realsense device attached
2019-06-17 23:22:46.242 26320-26345/com.intel.realsense.capture I/librs Enumerator: notifyOnAttach
2019-06-17 23:22:46.244 26320-26345/com.intel.realsense.capture I/usbhost: usb_device_new /dev/bus/usb/003/002 fd: 77
2019-06-17 23:22:46.244 26320-26345/com.intel.realsense.capture I/usbhost: usb_device_new read returned 2866 errno 0
2019-06-17 23:22:46.244 26320-26345/com.intel.realsense.capture D/librs DeviceWatcher: Adding device: /dev/bus/usb/003/002
2019-06-17 23:22:46.244 26320-26345/com.intel.realsense.capture I/librs: Found UVC Device vid: id- 
    vid- 8086
    pid- ad3
    mi- 0
    unique_id- /dev/bus/usb/003/002
    path- /dev/bus/usb/003/002
    susb specification- 320
2019-06-17 23:22:46.244 26320-26345/com.intel.realsense.capture I/librs: Found UVC Device vid: id- 
    vid- 8086
    pid- ad3
    mi- 3
    unique_id- /dev/bus/usb/003/002
    path- /dev/bus/usb/003/002
    susb specification- 320
2019-06-17 23:22:46.244 26320-26345/com.intel.realsense.capture D/librs DeviceWatcher: Device: /dev/bus/usb/003/002 added successfully
2019-06-17 23:22:47.314 26320-26320/com.intel.realsense.capture D/HwCust: Create obj success use class android.app.HwCustActivityImpl
2019-06-17 23:22:47.335 26320-26320/com.intel.realsense.capture D/HwGalleryCacheManagerImpl: mIsEffect:false
2019-06-17 23:22:47.340 26320-26320/com.intel.realsense.capture D/ActivityThread: add activity client record, r= ActivityRecord{97431af token=android.os.BinderProxy@3c1d5b6 {com.intel.realsense.capture/com.intel.realsense.librealsense.DeviceWatcherActivity}} token= android.os.BinderProxy@3c1d5b6
2019-06-17 23:22:47.397 26320-26320/com.intel.realsense.capture I/librs: Found UVC Device vid: id- 
    vid- 8086
    pid- ad3
    mi- 0
    unique_id- /dev/bus/usb/003/002
    path- /dev/bus/usb/003/002
    susb specification- 320
2019-06-17 23:22:47.398 26320-26320/com.intel.realsense.capture I/librs: Found UVC Device vid: id- 
    vid- 8086
    pid- ad3
    mi- 3
    unique_id- /dev/bus/usb/003/002
    path- /dev/bus/usb/003/002
    susb specification- 320
2019-06-17 23:22:47.399 26320-26320/com.intel.realsense.capture I/librs: Found UVC Device vid: id- 
    vid- 8086
    pid- ad3
    mi- 0
    unique_id- /dev/bus/usb/003/002
    path- /dev/bus/usb/003/002
    susb specification- 320
2019-06-17 23:22:47.399 26320-26320/com.intel.realsense.capture I/librs: Found UVC Device vid: id- 
    vid- 8086
    pid- ad3
    mi- 3
    unique_id- /dev/bus/usb/003/002
    path- /dev/bus/usb/003/002
    susb specification- 320
2019-06-17 23:22:47.400 26320-26320/com.intel.realsense.capture D/librs capture example: try start streaming
2019-06-17 23:22:47.400 26320-26320/com.intel.realsense.capture I/librs: Found UVC Device vid: id- 
    vid- 8086
    pid- ad3
    mi- 0
    unique_id- /dev/bus/usb/003/002
    path- /dev/bus/usb/003/002
    susb specification- 320
2019-06-17 23:22:47.400 26320-26320/com.intel.realsense.capture I/librs: Found UVC Device vid: id- 
    vid- 8086
    pid- ad3
    mi- 3
    unique_id- /dev/bus/usb/003/002
    path- /dev/bus/usb/003/002
    susb specification- 320
2019-06-17 23:22:47.428 26320-27063/com.intel.realsense.capture I/librs: USB pipe 130 reset successfully
2019-06-17 23:22:47.428 26320-27063/com.intel.realsense.capture I/librs: endpoint 130 read buffer size: 614648
2019-06-17 23:22:47.431 26320-26320/com.intel.realsense.capture D/librs capture example: streaming started successfully
2019-06-17 23:22:47.432 26320-27063/com.intel.realsense.capture W/librs: bulk_transfer returned error, endpoint: 130, error: Out of memory, number: 12
2019-06-17 23:22:47.432 26320-27063/com.intel.realsense.capture E/librs: USB transfer failed, the max read buffer size is smaller than the current resolution requires, try to configure lower resolution
2019-06-17 23:22:47.432 26320-27064/com.intel.realsense.capture I/librs: USB pipe 132 reset successfully
2019-06-17 23:22:47.432 26320-27064/com.intel.realsense.capture I/librs: endpoint 132 read buffer size: 614648
2019-06-17 23:22:47.433 26320-27063/com.intel.realsense.capture I/librs: USB pipe 130 reset successfully
2019-06-17 23:22:47.438 26320-27064/com.intel.realsense.capture W/librs: bulk_transfer returned error, endpoint: 132, error: Out of memory, number: 12
2019-06-17 23:22:47.438 26320-27064/com.intel.realsense.capture E/librs: USB transfer failed, the max read buffer size is smaller than the current resolution requires, try to configure lower resolution
2019-06-17 23:22:47.438 26320-27064/com.intel.realsense.capture I/librs: USB pipe 132 reset successfully
2019-06-17 23:22:48.443 26320-26320/com.intel.realsense.capture E/librs capture example: streaming, error: UNKNOWN_ERROR
2019-06-17 23:22:48.448 26320-26320/com.intel.realsense.capture D/ActivityThread: Remove activity client record, r= ActivityRecord{97431af token=android.os.BinderProxy@3c1d5b6 {com.intel.realsense.capture/com.intel.realsense.librealsense.DeviceWatcherActivity}} token= android.os.BinderProxy@3c1d5b6

@matkatz
Copy link
Contributor

matkatz commented Jun 17, 2019

Thanks again for your help!

@dreifelix, do you see the same behavior with the Pixel? did you try to reboot the phone?
Also, I see some strange issues with specific configurations (6 FPS) on my platforms when connecting via USB2.
If you get to test it again please try to config only depth 640x480x30 as first step.

I also want to share with you the reason for trying to solve this issue and not revert the backend changes.

This is the performance of v2.23.0 (when it does work (: )
v2 23 0

While this is v2.20.0 results:
v2 20 0

I'll keep digging...

@dreifelix
Copy link

dreifelix commented Jun 18, 2019

Rebooting helped! :)

In my S7, I am able to stream up to 60 fps when running 2 streams at a time, and up to 30 fps when running all 3 streams simultaneously, at the lowest resolution (424x240 for color, 480x270 for infrared and depth). At 640x480 resolution, only infrared works, up to 30 fps.

I noticed the performance improvement as well. I wasn't able to reach the above frame rates in the android_bulk_transfer branch - the streams were freezing intermittently at 30 fps when running simultaneously.

As you noted, I am unable to run any of the streams at 6 fps at any resolution, but that's fine :) I will try it on the Pixel 3 when I get the chance - i'm just borrowing the device from another project team.

Looking forward to have your changes merged in the next release. Thanks so much for looking into this!

@matkatz
Copy link
Contributor

matkatz commented Jun 18, 2019

Thanks @dreifelix
I still need to understand what is bringing the phone to this state.

@GucciPrada, I guess reboot didn't help with the P20?

@Mad-Thanos
Copy link
Author

Hi @matkatz I've never tried to reboot the phone. I'll try it today.

@kafan1986
Copy link

@GucciPrada As your connection type is USB 2.1, only 6fps is supported for 1280x720. If you want higher fps such as 15fps or 30fps, you need switch to USB3 connection.

@kafan1986 What's your android device when you get the issue with latest v2.30? And could you please provice the full logcat log when the issue happened? Thanks!

My device is Odroid N2 running android 9 and I am using SDK v 2.30. I have pasted logs on separate issue thread #5328

@kafan1986
Copy link

@matkatz @RealSenseCustomerSupport @dorodnic @RealSense-Customer-Engineering
I have tested and tried many things on android platform and none of them helped with the Out of memory error. I am using Odroid N2 SBC running android 9 through USB 3.0. At 15 or even 6 fps I get OOM error after few minutes and the device stalls. Depth set at 1280x720 and colour at 1920x1080.

I have written custom android code to recover the device using hardware_reset API provided by librealsense SDK but it keeps on trying to recover device and I have also tried it with and without Odroid's solution to reset the USB hub but without much success as even after reboot most times at least one the stream is stuck. The code for this class is as below.

Streamer.java.txt

Following this microsoft/Azure-Kinect-Sensor-SDK#485 , https://stackoverflow.com/questions/23005708/kernel-crashes-due-to-oom-error-usb-submit-urb , https://discuss.aerospike.com/t/how-to-tune-the-linux-kernel-for-memory-performance/4195 I increased usbfs_memory_mb value.

/sys/module/usbcore/parameters/usbfs_memory_mb 128        #Increased from default 16mb 

/proc/sys/vm/min_free_kbytes 40000                                        #Changed to 1% percent of my device 4GB RAM

Following https://www.bo-yang.net/2015/03/30/debug-kernel-space-memory-leak I looked for any memory leaks. The plots and logs are attached below.

mem_plot_2
mem_plot_1
monitor_output_localhost.txt

Part of dmesg from android during error is attached below.
android_dmesg.txt

The logcat messages generated by librs is attached below.
logcat.txt

I have asked this forum multiple times but haven't heard anything promising. Given the issue was first reported almost 6-7 months back and has not been resolved yet, I hope someone soon takes a look at this issue and gets this resolved.

@matkatz matkatz removed their assignment Dec 8, 2019
@matkatz
Copy link
Contributor

matkatz commented Dec 8, 2019

@alowenst01 please take a look.

@kafan1986
Copy link

@alowenst01 @matkatz Was isochronous data transfer ever tried for Android? I found a repo where someone implemented the same for Android. https://github.com/Peter-St/Android-UVC-Camera

@kafan1986
Copy link

UPDATE
I am running streaming depth and colour frame on android for last 36+ hours at 720p 15fps without any crash. I do get some messages like below every few minutes but it has yet to give any additional critical error like OOM.

W/librs: control_transfer returned error, index: 768, error: Broken pipe, number: 32

Basically currently my code is just getting the depth and colour frame with just some post processing filter and nothing else. Top command shows the CPU usage to be around 40-45%. Earlier I was also drawing the eachb colour frame to UI and usually the app would crash in minutes.

It means although the data transfer is the culprit and the memory leak is not in the SDK itself but in the way how the RSUSB is implemented. When the CPU is not stressed then RSUSB can work fine but when it is stressed the USB request fail and then I believe the method of cancelling USB request, that should cancel the filled URB queues held with the linux kernel is not working properly releasing the queue and thus causes Out of memory error.

As expected in such case hardware reset or even custom USB controller reset is not able to recover and only option is to reboot the entire system.

@RealSenseCustomerSupport
Copy link
Collaborator


@kafan1986 Glad to see 720p 15fps work for you. We did see some stability issue with HD or FHD resolution due to Android platform limitation. So please use the working configuration as workaround at this point. Thanks!

@kafan1986
Copy link

@kafan1986 Glad to see 720p 15fps work for you. We did see some stability issue with HD or FHD resolution due to Android platform limitation. So please use the working configuration as workaround at this point. Thanks!

Actually I posted a little earlier. Although the camera was working but the colour frame was stuck, which I did not know at that point of time. Currently at 720p the device works from 4-7 hrs before it eventually faces the colour frame stuck or out of memory error. Happens in 1 - 1.5 hrs when set up at 1080p.

@RealSenseCustomerSupport
Copy link
Collaborator


@kafan1986 So previously what you said "I am running streaming depth and colour frame on android for last 36+ hours at 720p 15fps without any crash" is not always what you get, right? What format did you set for color frame? Could you please try YUYV format to see if any improvement?

@kafan1986
Copy link

kafan1986 commented Feb 3, 2020

@kafan1986 So previously what you said "I am running streaming depth and colour frame on android for last 36+ hours at 720p 15fps without any crash" is not always what you get, right? What format did you set for color frame? Could you please try YUYV format to see if any improvement?

@RealSenseCustomerSupport
What I mean is that when I made that comment, my test setup was incorrect. I was working on the depth data only. When one streams color frame too then the system will crash quickly on Android. This either happens silently, i.e. the color stream gets stuck and then one needs to either check visually or check by comparing frame id with previous frame id to know this programmatically; otherwise the it throws out of memory error and it leads to frame timeout.

At 720p colour frame stream this eventually happens every 5-7 hours and at 1080p it happens within 1-2 hours. In all above cases, the only confirmed way to recover is to reboot the entire system. "Resetting" device through official API or even resetting USB controller on the system does not guarantee recovery.

Also, in the meanwhile can you update the status of the team's internal status on issue: (DSO-13539) - [Android] Camera disconnected after streaming some duration with Android Camera Sample

@rafaelspring
Copy link

rafaelspring commented Feb 25, 2020

@matkatz @RealSenseCustomerSupport @RealSense-Customer-Engineering @dorodnic

Sorry for the long silence. I changed my GitHub name (used to be @xtrawurst).

We have tried the latest 2.32.1 librealsense and we still get frequent loss of connection on the Samsung Galaxy Tab S4 running Android 9.

Interestingly we sometimes get a more stable connection using the "RS Camera" Android app instead of our capturing app, even if we use the same configuration (resolutions and frame rate).

Would it be possible to open-source the RS Camera app code so the community can see how it performs configuration etc?

Update: This seems to be a cable issue! Using a proper Thunderbolt 3 cable instead of anything labeled "USB" (even USB 3.2 compliant cables) makes all the difference. I couldn't reproduce any of the above problems when using a Thunderbolt 3 cable.
@kafan1986 Please let us know if you are seeing the same.

Update 2: Actually it seems to be more subtle than that. While I haven't found a Thunderbolt cable that doesn't work, I have also found a USB 3.1 Gen2 compliant C-to-C cable that does work: https://www.amazon.com/AmazonBasics-Double-Braided-Nylon-Type-C/dp/B07D7RZ1VS

@kafan1986
Copy link

kafan1986 commented Feb 25, 2020

@matkatz @RealSenseCustomerSupport @RealSense-Customer-Engineering @dorodnic

Sorry for the long silence. I changed my GitHub name (used to be @xtrawurst).

We have tried the latest 2.32.1 librealsense and we still get frequent loss of connection on the Samsung Galaxy Tab S4 running Android 9.

Interestingly we sometimes get a more stable connection using the "RS Camera" Android app instead of our capturing app, even if we use the same configuration (resolutions and frame rate).

Would it be possible to open-source the RS Camera app code so the community can see how it performs configuration etc?

Update: This seems to be a cable issue! Using a proper Thunderbolt 3 cable instead of anything labeled "USB" (even USB 3.2 compliant cables) makes all the difference. I couldn't reproduce any of the above problems when using a Thunderbolt 3 cable.
@kafan1986 Please let us know if you are seeing the same.

Update 2: Actually it seems to be more subtle than that. While I haven't found a Thunderbolt cable that doesn't work, I have also found a USB 3.1 Gen2 compliant C-to-C cable that does work: https://www.amazon.com/AmazonBasics-Double-Braided-Nylon-Type-C/dp/B07D7RZ1VS

The RS Camera app code is already present in the github. The camera app that builds the SDK is the official RS camera app code.

I have tested two approach to create a pipeline of depth and RGB data.
A) Start a high priority thread and loop to get the frameset.
B) Using a Looper/Handler approach for frameset callback.

Although there should not be any difference in either approach A or B but after months of testing. I can say approach A is OK, only if you are not doing much on the android platform. Once the CPU cores are stressed even a little, maybe due to some parallel processing, it crashes with all sort of USB data transfer issues.

The 2nd approach (B) is the one used by the RS camera app. With this I can run my system somewhat stable at (720p colour + depth) at 15 fps stable for 7-8 hours before the crash and I need to reboot the system.

I can not use thunderbolt cable as I am using the depth camera with single board computer (SBC) running android and it only has USB type A ports. Also, the thunderbolt cable will probably increase my setup cost given my future use case. I have used the below cable (10 gbps) for my use case and another USB 3.0 (5 gbps) cable and both of them provided same stability and none resolved issue in entirety.
https://www.amazon.in/gp/product/B016RNC8AS/ref=ppx_yo_dt_b_asin_title_o03_s00?ie=UTF8&psc=1

@RealSenseCustomerSupport
Copy link
Collaborator


@GucciPrada Any questions about this issue?

@kafan1986 Did you try color using YUYV format to see if any improvement? Thanks!

@Mad-Thanos
Copy link
Author

Due to the problem and possible solutions mentioned in this issue, I finally decided turn to Linux, give up trying android.

@kafan1986
Copy link

@GucciPrada Any questions about this issue?

@kafan1986 Did you try color using YUYV format to see if any improvement? Thanks!

I am using YUYV and the error is still there. At lower frame rate i.e. 15 FPS and 720p color + 720p depth. The error occurs after every 6-7 hours and then I need to restart the entire system.

@RealSenseCustomerSupport
Copy link
Collaborator


@kafan1986 Did you try to lower the resolution such as 640x480 to see if any improvement? Thanks!

@kafan1986
Copy link

@kafan1986 Did you try to lower the resolution such as 640x480 to see if any improvement? Thanks!

I am already using lower resolution of 720p rather than 1080p. Any lower resolution will impact my other deep learning models.

@RealSenseCustomerSupport
Copy link
Collaborator


@GucciPrada Sorry for the inconvenience on android platform. If lower resolution on android can't be accepted for you, then switch to Linux will be good choice.

@kafan1986 Sorry for the inconvenience. For the issues on android platform, our engineering team did investigations including the analysis of USB trace, however we didn't find clear clue to resolve it from librealsense. It might need the investigation from android host which is out of our scope. Sorry for that.

@RealSenseCustomerSupport
Copy link
Collaborator


@GucciPrada Any other questions about this? Thanks!

@Mad-Thanos
Copy link
Author

Nope, I close this issue for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants