saki4510t / UVCCamera

library and sample to access to UVC web camera on non-rooted Android device
3.02k stars 1.21k forks source link

Pixel 2 XL on Android 8.1 #295

Open SimonMarquis opened 6 years ago

SimonMarquis commented 6 years ago

I try to run the sample code on a Pixel 2 XL running Android 8.1 (through USB C port) and it crashes after validating the USB permission system dialog.

Note: The usb camera is working fine with another app on the same device. And it was also working just fine on USB C port running Android 7.X

Here is the stacktrace, tell me if you need more data to troubleshoot this issue:


12-20 14:56:22.587 750-1439/? I/android.hardware.usb@1.1-service.wahoo: uevent received DEVTYPE=typec_port
12-20 14:56:22.590 750-1439/? I/android.hardware.usb@1.1-service.wahoo: port0
12-20 14:56:22.590 750-1439/? I/android.hardware.usb@1.1-service.wahoo: connected:0 canChangeMode:1 canChagedata:0 canChangePower:0
12-20 14:56:22.591 1108-11043/? I/UsbPortManager: ClientCallback: port0
12-20 14:56:22.592 750-1439/? I/android.hardware.usb@1.1-service.wahoo: uevent received DEVTYPE=typec_port
12-20 14:56:22.602 750-1439/? I/android.hardware.usb@1.1-service.wahoo: port0
12-20 14:56:22.602 750-1439/? I/android.hardware.usb@1.1-service.wahoo: connected:0 canChangeMode:1 canChagedata:0 canChangePower:0
12-20 14:56:22.603 1108-11043/? I/UsbPortManager: ClientCallback: port0
12-20 14:56:23.487 1108-1130/? D/UsbAlsaManager: Adding ALSA device AlsaDevice: [card: 1, device: 0, type: 2]
12-20 14:56:23.505 1108-1574/? D/UsbHostManager: Added device UsbDevice[mName=/dev/bus/usb/001/002,mVendorId=1133,mProductId=2061,mClass=239,mSubclass=2,mProtocol=1,mManufacturerName=null,mProductName=Acer Camera,mVersion=2.0,mSerialNumber=B49C2B50,mConfigurations=[
                                                 UsbConfiguration[mId=1,mName=null,mAttributes=128,mMaxPower=250,mInterfaces=[
                                                 UsbInterface[mId=0,mAlternateSetting=0,mName=null,mClass=14,mSubclass=1,mProtocol=0,mEndpoints=[
                                                 UsbEndpoint[mAddress=135,mAttributes=3,mMaxPacketSize=16,mInterval=8]]
                                                 UsbInterface[mId=1,mAlternateSetting=0,mName=null,mClass=14,mSubclass=2,mProtocol=0,mEndpoints=[]
                                                 UsbInterface[mId=1,mAlternateSetting=1,mName=null,mClass=14,mSubclass=2,mProtocol=0,mEndpoints=[
                                                 UsbEndpoint[mAddress=129,mAttributes=5,mMaxPacketSize=192,mInterval=1]]
                                                 UsbInterface[mId=1,mAlternateSetting=2,mName=null,mClass=14,mSubclass=2,mProtocol=0,mEndpoints=[
                                                 UsbEndpoint[mAddress=129,mAttributes=5,mMaxPacketSize=384,mInterval=1]]
                                                 UsbInterface[mId=1,mAlternateSetting=3,mName=null,mClass=14,mSubclass=2,mProtocol=0,mEndpoints=[
                                                 UsbEndpoint[mAddress=129,mAttributes=5,mMaxPacketSize=512,mInterval=1]]
                                                 UsbInterface[mId=1,mAlternateSetting=4,mName=null,mClass=14,mSubclass=2,mProtocol=0,mEndpoints=[
                                                 UsbEndpoint[mAddress=129,mAttributes=5,mMaxPacketSize=640,mInterval=1]]
                                                 UsbInterface[mId=1,mAlternateSetting=5,mName=null,mClass=14,mSubclass=2,mProtocol=0,mEndpoints=[
                                                 UsbEndpoint[mAddress=129,mAttributes=5,mMaxPacketSize=800,mInterval=1]]
                                                 UsbInterface[mId=1,mAlternateSetting=6,mName=null,mClass=14,mSubclass=2,mProtocol=0,mEndpoints=[
                                                 UsbEndpoint[mAddress=129,mAttributes=5,mMaxPacketSize=944,mInterval=1]]
                                                 UsbInterface[mId=1,mAlternateSetting=7,mName=null,mClass=14,mSubclass=2,mProtocol=0,mEndpoints=[
                                                 UsbEndpoint[mAddress=129,mAttributes=5,mMaxPacketSize=2688,mInterval=1]]
                                                 UsbInterface[mId=1,mAlternateSetting=8,mName=null,mClass=14,mSubclass=2,mProtocol=0,mEndpoints=[
                                                 UsbEndpoint[mAddress=129,mAttributes=5,mMaxPacketSize=2848,mInterval=1]]
                                                 UsbInterface[mId=1,mAlternateSetting=9,mName=null,mClass=14,mSubclass=2,mProtocol=0,mEndpoints=[
                                                 UsbEndpoint[mAddress=129,mAttributes=5,mMaxPacketSize=3040,mInterval=1]]
                                                 UsbInterface[mId=1,mAlternateSetting=10,mName=null,mClass=14,mSubclass=2,mProtocol=0,mEndpoints=[
                                                 UsbEndpoint[mAddress=129,mAttributes=5,mMaxPacketSize=4992,mInterval=1]]
                                                 UsbInterface[mId=1,mAlternateSetting=11,mName=null,mClass=14,mSubclass=2,mProtocol=0,mEndpoints=[
                                                 UsbEndpoint[mAddress=129,mAttributes=5,mMaxPacketSize=5116,mInterval=1]]
                                                 UsbInterface[mId=2,mAlternateSetting=0,mName=null,mClass=1,mSubclass=1,mProtocol=0,mEndpoints=[]
                                                 UsbInterface[mId=3,mAlternateSetting=0,mName=null,mClass=1,mSubclass=2,mProtocol=0,mEndpoints=[]
                                                 UsbInterface[mId=3,mAlternateSetting=1,mName=null,mClass=1,mSubclass=2,mProtocol=0,mEndpoints=[
                                                 UsbEndpoint[mAddress=134,mAttributes=5,mMaxPacketSize=68,mInterval=4]]
                                                 UsbInterface[mId=3,mAlternateSetting=2,mName=null,mClass=1,mSubclass=2,mProtocol=0,mEndpoints=[
                                                 UsbEndpoint[mAddress=134,mAttributes=5,mMaxPacketSize=100,mInterval=4]]
                                                 UsbInterface[mId=3,mAlternateSetting=3,mName=null,mClass=1,mSubclass=2,mProtocol=0,mEndpoints=[
                                                 UsbEndpoint[mAddress=134,mAttributes=5,mMaxPacketSize=132,mInterval=4]]
                                                 UsbInterface[mId=3,mAlternateSetting=4,mName=null,mClass=1,mSubclass=2,mProtocol=0,mEndpoints=[
                                                 UsbEndpoint[mAddress=134,mAttributes=5,mMaxPacketSize=196,mInterval=4]]]]
12-20 14:56:23.560 1108-1574/? I/UsbAlsaManager: USB Audio Device Added: UsbAudioDevice: [card: 1, device: 0, name: USB-Audio - Acer Camera, hasPlayback: false, hasCapture: true, class: 0x80000002]
12-20 14:56:26.706 1108-2568/? I/ActivityManager: START u0 {flg=0x10000000 cmp=com.android.systemui/.usb.UsbPermissionActivity (has extras)} from uid 1000
12-20 14:56:27.650 2880-2901/? D/UsbDeviceConnectionJNI: close
12-20 14:56:27.659 2880-2901/? I/USBMonitor: name=/dev/bus/usb/001/002,desc=60,busnum=1,devnum=2,rawDesc=[B@1a0035b
12-20 14:56:27.659 2880-2901/? V/MainActivity: onConnect:
12-20 14:56:27.672 2880-2900/? D/UsbDeviceConnectionJNI: close
12-20 14:56:27.672 2880-2900/? I/libusb/core: [2900*core.c:2085:libusb_init2]:libusb v1.0.19.10903
12-20 14:56:27.672 2880-2900/? I/libusb/usbfs: [2900*android_usbfs.c:504:op_init2]:start up hotplug event handler
12-20 14:56:27.672 2880-2900/? I/libusb/usbfs: [2900*android_usbfs.c:512:op_init2]:call android_scan_devices
12-20 14:56:27.672 2880-2900/? E/UVCCamera: [2900*UVCCamera.cpp:172:connect]:could not open camera:err=-1
12-20 14:56:27.674 2880-2900/? E/AndroidRuntime: FATAL EXCEPTION: BaseActivity
                                                 Process: com.serenegiant.usbcameratest0, PID: 2880
                                                 java.lang.UnsupportedOperationException: open failed:result=-1
                                                     at com.serenegiant.usb.UVCCamera.open(UVCCamera.java:204)
                                                     at com.serenegiant.usbcameratest0.MainActivity$2$1.run(MainActivity.java:149)
                                                     at android.os.Handler.handleCallback(Handler.java:790)
                                                     at android.os.Handler.dispatchMessage(Handler.java:99)
                                                     at android.os.Looper.loop(Looper.java:164)
                                                     at android.os.HandlerThread.run(HandlerThread.java:65)
12-20 14:56:27.676 1108-2568/? W/ActivityManager:   Force finishing activity com.serenegiant.usbcameratest0/.MainActivity
12-20 14:56:27.693 1108-1127/? I/ActivityManager: Showing crash dialog for package com.serenegiant.usbcameratest0 u0
HowICanBeWithYou commented 6 years ago

I also use the device like this (Android 8.0.0,type-c), my device willnot cash after the he USB permission system dialog,but the preview window did not display the image and the window always be black