Giter Club home page Giter Club logo

android-uvc-camera's People

Contributors

nsknyc avatar peter-st avatar poussinou avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

android-uvc-camera's Issues

WebRtc USB camera support

Hi Peter,

Thank you so much for posting this project, it is really helpful.
This is not really an issue, I was just wandering if you tried sending the frames captured by the camera to another device using webrtc. I've tried for some time to implement this but with no luck and I'm really curious how I can do this.
If you have any info regarding this, it will be very much appreciated.

Cheers,

Preview will freeze

Hello, we are pulling the code to compile and install it on the mobile phone, and the external USB camera, the preview is all OK; but when the USB camera is facing the dense square cloth, the phenomenon of freezing will occur, please see what the problem is

760e118167dd3bc22079a10fae70b32b.mp4

got crash on record button click

libusb -- off----> Able to see preview ---> but on record click got crash

ExtendedACodec: vendor/qcom/proprietary/avenhancements/av/stagefright/ExtendedACodec.cpp:1849 CHECK_GT( val,(OMX_U32)1) failed: 1 vs. 102-18 19:38:25.453 7495 7579 F libc : Fatal signal 6 (SIGABRT), code -6 in tid 7579 (CodecLooper), pid 7495 (umer.uvc_camera)
not find suitable Encoder parameter

Can't skip the data loss frame in the IsochronousStream class

Hi, Peter-St

I found that in the Galaxy(android 9 series) accepts packets with data loss without skipping them.

As far as I've checked, IsochronousStream Class can't skip the problematic frame.
The reason seems to be the lack of defensive code to detect frames.

In IsochronousStream class, the current header length, flag, and data length are only detected,
So frame detection is improved by adding FID and EOF, but skip is not perfect.

26 03 2020_18 05 17

WebRTC crashing

Compiled the source and uvc camera working on Android 9.

But testing the webrtc, the device is crashing and throwing the following message

11-24 07:11:37.689 6366 6618 D From Native: UVC_STREAM_ERR --> Package 12
11-24 07:11:37.689 6366 6618 D From Native: UVC_STREAM_ERR --> Package 13
11-24 07:11:37.689 6366 6618 F libc : Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x3 in tid 6618 (IntentService[W), pid 6366 (umer.uvc_camera)
11-24 07:11:37.811 6629 6629 I crash_dump32: obtaining output fd from tombstoned, type: kDebuggerdTombstone
11-24 07:11:37.812 3272 3272 I /system/bin/tombstoned: received crash request for pid 6618
11-24 07:11:37.812 6629 6629 I crash_dump32: performing dump of process 6366 (target tid = 6618)
11-24 07:11:37.849 6629 6629 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
11-24 07:11:37.849 6629 6629 F DEBUG : Build fingerprint: 'Amlogic/franklin/franklin:9/PPR1.180610.011/20210913:userdebug/test-keys'
11-24 07:11:37.849 6629 6629 F DEBUG : Revision: '0'
11-24 07:11:37.849 6629 6629 F DEBUG : ABI: 'arm'
11-24 07:11:37.849 6629 6629 F DEBUG : pid: 6366, tid: 6618, name: IntentService[W >>> humer.uvc_camera <<<
11-24 07:11:37.849 6629 6629 F DEBUG : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x3
11-24 07:11:37.849 6629 6629 F DEBUG : Cause: null pointer dereference
11-24 07:11:37.849 6629 6629 F DEBUG : r0 0000008d r1 00000020 r2 9a9fa5f9 r3 00000003
11-24 07:11:37.849 6629 6629 F DEBUG : r4 93ab624c r5 0000000e r6 93ab6324 r7 0000000c
11-24 07:11:37.849 6629 6629 F DEBUG : r8 00000000 r9 926b1040 r10 8eb27400 r11 8ee8ade8
11-24 07:11:37.849 6629 6629 F DEBUG : ip 926b1014 sp 8ee8adc0 lr 926aabe0 pc 926aac30
11-24 07:11:38.075 6629 6629 F DEBUG :
11-24 07:11:38.075 6629 6629 F DEBUG : backtrace:
11-24 07:11:38.075 6629 6629 F DEBUG : #00 pc 0000ec30 /data/app/humer.uvc_camera-LwypGrpriOEug48kSJD0PA==/lib/arm/libUvc_Support.so (cb_jni_WebRtc_Service+204)
11-24 07:11:38.075 6629 6629 F DEBUG : #1 pc 00006f11 /data/app/humer.uvc_camera-LwypGrpriOEug48kSJD0PA==/lib/arm/libusb1.0.so
11-24 07:11:38.075 6629 6629 F DEBUG : #2 pc 0000ad97 /data/app/humer.uvc_camera-LwypGrpriOEug48kSJD0PA==/lib/arm/libusb1.0.so
11-24 07:11:38.075 6629 6629 F DEBUG : #3 pc 00009b4f /data/app/humer.uvc_camera-LwypGrpriOEug48kSJD0PA==/lib/arm/libusb1.0.so
11-24 07:11:38.075 6629 6629 F DEBUG : #4 pc 0000773b /data/app/humer.uvc_camera-LwypGrpriOEug48kSJD0PA==/lib/arm/libusb1.0.so
11-24 07:11:38.075 6629 6629 F DEBUG : #5 pc 00007333 /data/app/humer.uvc_camera-LwypGrpriOEug48kSJD0PA==/lib/arm/libusb1.0.so (libusb_handle_events_timeout_completed+238)
11-24 07:11:38.075 6629 6629 F DEBUG : #6 pc 000077bf /data/app/humer.uvc_camera-LwypGrpriOEug48kSJD0PA==/lib/arm/libusb1.0.so (libusb_handle_events+16)
11-24 07:11:38.075 6629 6629 F DEBUG : #7 pc 0000f264 /data/app/humer.uvc_camera-LwypGrpriOEug48kSJD0PA==/lib/arm/libUvc_Support.so (lunchTheStream_WebRtc_Service+524)
11-24 07:11:38.075 6629 6629 F DEBUG : #8 pc 00010ce0 /data/app/humer.uvc_camera-LwypGrpriOEug48kSJD0PA==/lib/arm/libjnidispatch.so (ffi_call_SYSV+44)
11-24 07:11:38.075 6629 6629 F DEBUG : #9 pc 00010840 /data/app/humer.uvc_camera-LwypGrpriOEug48kSJD0PA==/lib/arm/libjnidispatch.so (ffi_call+304)
11-24 07:11:38.075 6629 6629 F DEBUG : #10 pc 000057b0 /data/app/humer.uvc_camera-LwypGrpriOEug48kSJD0PA==/lib/arm/libjnidispatch.so
11-24 07:11:38.075 6629 6629 F DEBUG : #11 pc 000079b4 /data/app/humer.uvc_camera-LwypGrpriOEug48kSJD0PA==/lib/arm/libjnidispatch.so (Java_com_sun_jna_Native_invokeVoid+44)
11-24 07:11:38.075 6629 6629 F DEBUG : #12 pc 0041c279 /system/lib/libart.so (art_quick_generic_jni_trampoline+40)
11-24 07:11:38.075 6629 6629 F DEBUG : #13 pc 00417d75 /system/lib/libart.so (art_quick_invoke_stub_internal+68)
11-24 07:11:38.075 6629 6629 F DEBUG : #14 pc 003f13eb /system/lib/libart.so (art_quick_invoke_static_stub+222)
11-24 07:11:38.075 6629 6629 F DEBUG : #15 pc 000a1043 /system/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+154)
11-24 07:11:38.075 6629 6629 F DEBUG : #16 pc 001e8835 /system/lib/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+232)
11-24 07:11:38.075 6629 6629 F DEBUG : #17 pc 001e3511 /system/lib/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+776)
11-24 07:11:38.075 6629 6629 F DEBUG : #18 pc 003eceeb /system/lib/libart.so (MterpInvokeStatic+130)
11-24 07:11:38.076 6629 6629 F DEBUG : #19 pc 0040ab94 /system/lib/libart.so (ExecuteMterpImpl+14612)
11-24 07:11:38.076 6629 6629 F DEBUG : #20 pc 00267284 /dev/ashmem/dalvik-classes.dex extracted in memory from /data/app/humer.uvc_camera-LwypGrpriOEug48kSJD0PA==/base.apk (deleted) (com.sun.jna.Function.invoke+960)
11-24 07:11:38.076 6629 6629 F DEBUG : #21 pc 001c7e89 /system/lib/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.2193211614+352)
11-24 07:11:38.076 6629 6629 F DEBUG : #22 pc 001cc757 /system/lib/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+146)
11-24 07:11:38.076 6629 6629 F DEBUG : #23 pc 001e34fb /system/lib/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+754)
11-24 07:11:38.076 6629 6629 F DEBUG : #24 pc 003ebf0f /system/lib/libart.so (MterpInvokeVirtual+442)
11-24 07:11:38.076 6629 6629 F DEBUG : #25 pc 0040aa14 /system/lib/libart.so (ExecuteMterpImpl+14228)
11-24 07:11:38.076 6629 6629 F DEBUG : #26 pc 002673fc /dev/ashmem/dalvik-classes.dex extracted in memory from /data/app/humer.uvc_camera-LwypGrpriOEug48kSJD0PA==/base.apk (deleted) (com.sun.jna.Function.invoke+348)
11-24 07:11:38.076 6629 6629 F DEBUG : #27 pc 001c7e89 /system/lib/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.2193211614+352)
11-24 07:11:38.076 6629 6629 F DEBUG : #28 pc 001cc757 /system/lib/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+146)
11-24 07:11:38.076 6629 6629 F DEBUG : #29 pc 001e4377 /system/lib/libart.so (bool art::interpreter::DoCall<true, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+674)
11-24 07:11:38.076 6629 6629 F DEBUG : #30 pc 003ed149 /system/lib/libart.so (MterpInvokeVirtualRange+424)
11-24 07:11:38.076 6629 6629 F DEBUG : #31 pc 0040ad14 /system/lib/libart.so (ExecuteMterpImpl+14996)
11-24 07:11:38.076 6629 6629 F DEBUG : #32 pc 00268420 /dev/ashmem/dalvik-classes.dex extracted in memory from /data/app/humer.uvc_camera-LwypGrpriOEug48kSJD0PA==/base.apk (deleted) (com.sun.jna.Library$Handler.invoke+520)
11-24 07:11:38.076 6629 6629 F DEBUG : #33 pc 001c7e89 /system/lib/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.2193211614+352)
11-24 07:11:38.076 6629 6629 F DEBUG : #34 pc 001cc757 /system/lib/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+146)
11-24 07:11:38.076 6629 6629 F DEBUG : #35 pc 001e34fb /system/lib/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+754)
11-24 07:11:38.077 6629 6629 F DEBUG : #36 pc 003ecadd /system/lib/libart.so (MterpInvokeInterface+1020)
11-24 07:11:38.077 6629 6629 F DEBUG : #37 pc 0040ac14 /system/lib/libart.so (ExecuteMterpImpl+14740)
11-24 07:11:38.077 6629 6629 F DEBUG : #38 pc 000cd0be /system/framework/boot.vdex (java.lang.reflect.Proxy.invoke+4)
11-24 07:11:38.077 6629 6629 F DEBUG : #39 pc 001c7e89 /system/lib/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.2193211614+352)
11-24 07:11:38.077 6629 6629 F DEBUG : #40 pc 001cc6a3 /system/lib/libart.so (art::interpreter::EnterInterpreterFromEntryPoint(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*)+82)
11-24 07:11:38.077 6629 6629 F DEBUG : #41 pc 003df753 /system/lib/libart.so (artQuickToInterpreterBridge+890)
11-24 07:11:38.077 6629 6629 F DEBUG : #42 pc 0041c2ff /system/lib/libart.so (art_quick_to_interpreter_bridge+30)
11-24 07:11:38.077 6629 6629 F DEBUG : #43 pc 00417d75 /system/lib/libart.so (art_quick_invoke_stub_internal+68)
11-24 07:11:38.077 6629 6629 F DEBUG : #44 pc 003f13eb /system/lib/libart.so (art_quick_invoke_static_stub+222)
11-24 07:11:38.077 6629 6629 F DEBUG : #45 pc 000a1043 /system/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+154)
11-24 07:11:38.077 6629 6629 F DEBUG : #46 pc 00350a6d /system/lib/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::(anonymous namespace)::ArgArray*, art::JValue*, char const*)+52)
11-24 07:11:38.077 6629 6629 F DEBUG : #47 pc 00351505 /system/lib/libart.so (art::InvokeWithJValues(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, jvalue*)+304)
11-24 07:11:38.077 6629 6629 F DEBUG : #48 pc 0028b213 /system/lib/libart.so (art::JNI::CallStaticObjectMethodA(_JNIEnv*, _jclass*, _jmethodID*, jvalue*)+478)
11-24 07:11:38.077 6629 6629 F DEBUG : #49 pc 000c852d /system/lib/libart.so (art::(anonymous namespace)::CheckJNI::CallMethodA(char const*, _JNIEnv*, _jobject*, _jclass*, _jmethodID*, jvalue*, art::Primitive::Type, art::InvokeType)+1172)
11-24 07:11:38.077 6629 6629 F DEBUG : #50 pc 000b9055 /system/lib/libart.so (art::(anonymous namespace)::CheckJNI::CallStaticObjectMethodA(_JNIEnv*, _jclass*, _jmethodID*, jvalue*)+40)
11-24 07:11:38.077 6629 6629 F DEBUG : #51 pc 003c90b7 /system/lib/libart.so (art::InvokeProxyInvocationHandler(art::ScopedObjectAccessAlreadyRunnable&, char const*, _jobject*, _jobject*, std::__1::vector<jvalue, std::__1::allocator>&)+446)
11-24 07:11:38.077 6629 6629 F DEBUG : #52 pc 003e0261 /system/lib/libart.so (artQuickProxyInvokeHandler+760)
11-24 07:11:38.077 6629 6629 F DEBUG : #53 pc 0041c0d5 /system/lib/libart.so (art_quick_proxy_invoke_handler+20)
11-24 07:11:38.077 6629 6629 F DEBUG : #54 pc 00417d75 /system/lib/libart.so (art_quick_invoke_stub_internal+68)
11-24 07:11:38.077 6629 6629 F DEBUG : #55 pc 003f12e7 /system/lib/libart.so (art_quick_invoke_stub+226)
11-24 07:11:38.077 6629 6629 F DEBUG : #56 pc 000a1031 /system/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+136)
11-24 07:11:38.077 6629 6629 F DEBUG : #57 pc 001e8835 /system/lib/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+232)
11-24 07:11:38.078 6629 6629 F DEBUG : #58 pc 001e3511 /system/lib/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+776)
11-24 07:11:38.078 6629 6629 F DEBUG : #59 pc 003ecadd /system/lib/libart.so (MterpInvokeInterface+1020)
11-24 07:11:38.078 6629 6629 F DEBUG : #60 pc 0040ac14 /system/lib/libart.so (ExecuteMterpImpl+14740)
11-24 07:11:38.078 6629 6629 F DEBUG : #61 pc 00261ac6 /dev/ashmem/dalvik-classes.dex extracted in memory from /data/app/humer.uvc_camera-LwypGrpriOEug48kSJD0PA==/base.apk (deleted) (com.example.androidthings.videortc.WebRtcService.onHandleIntent+82)
11-24 07:11:38.078 6629 6629 F DEBUG : #62 pc 001c7e89 /system/lib/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.2193211614+352)
11-24 07:11:38.078 6629 6629 F DEBUG : #63 pc 001cc757 /system/lib/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+146)
11-24 07:11:38.078 6629 6629 F DEBUG : #64 pc 001e34fb /system/lib/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+754)
11-24 07:11:38.078 6629 6629 F DEBUG : #65 pc 003ebf0f /system/lib/libart.so (MterpInvokeVirtual+442)
11-24 07:11:38.078 6629 6629 F DEBUG : #66 pc 0040aa14 /system/lib/libart.so (ExecuteMterpImpl+14228)
11-24 07:11:38.078 6629 6629 F DEBUG : #67 pc 003a83f4 /system/framework/boot-framework.vdex (android.app.IntentService$ServiceHandler.handleMessage+12)
11-24 07:11:38.078 6629 6629 F DEBUG : #68 pc 001c7e89 /system/lib/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.2193211614+352)
11-24 07:11:38.078 6629 6629 F DEBUG : #69 pc 001cc6a3 /system/lib/libart.so (art::interpreter::EnterInterpreterFromEntryPoint(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*)+82)
11-24 07:11:38.078 6629 6629 F DEBUG : #70 pc 003df753 /system/lib/libart.so (artQuickToInterpreterBridge+890)
11-24 07:11:38.078 6629 6629 F DEBUG : #71 pc 0041c2ff /system/lib/libart.so (art_quick_to_interpreter_bridge+30)
11-24 07:11:38.078 6629 6629 F DEBUG : #72 pc 0000f117 /dev/ashmem/dalvik-jit-code-cache (deleted) (android.os.Handler.dispatchMessage+126)
11-24 07:11:38.078 6629 6629 F DEBUG : #73 pc 000230ad /dev/ashmem/dalvik-jit-code-cache (deleted) (android.os.Looper.loop+1020)
11-24 07:11:38.078 6629 6629 F DEBUG : #74 pc 00417d75 /system/lib/libart.so (art_quick_invoke_stub_internal+68)
11-24 07:11:38.078 6629 6629 F DEBUG : #75 pc 003f13eb /system/lib/libart.so (art_quick_invoke_static_stub+222)
11-24 07:11:38.078 6629 6629 F DEBUG : #76 pc 000a1043 /system/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+154)
11-24 07:11:38.078 6629 6629 F DEBUG : #77 pc 001e8835 /system/lib/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+232)
11-24 07:11:38.079 6629 6629 F DEBUG : #78 pc 001e3511 /system/lib/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+776)
11-24 07:11:38.079 6629 6629 F DEBUG : #79 pc 003eceeb /system/lib/libart.so (MterpInvokeStatic+130)
11-24 07:11:38.079 6629 6629 F DEBUG : #80 pc 0040ab94 /system/lib/libart.so (ExecuteMterpImpl+14612)
11-24 07:11:38.079 6629 6629 F DEBUG : #81 pc 00ae3484 /system/framework/boot-framework.vdex (android.os.HandlerThread.run+56)
11-24 07:11:38.079 6629 6629 F DEBUG : #82 pc 001c7e89 /system/lib/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.2193211614+352)
11-24 07:11:38.079 6629 6629 F DEBUG : #83 pc 001cc6a3 /system/lib/libart.so (art::interpreter::EnterInterpreterFromEntryPoint(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*)+82)
11-24 07:11:38.079 6629 6629 F DEBUG : #84 pc 003df753 /system/lib/libart.so (artQuickToInterpreterBridge+890)
11-24 07:11:38.079 6629 6629 F DEBUG : #85 pc 0041c2ff /system/lib/libart.so (art_quick_to_interpreter_bridge+30)
11-24 07:11:38.079 6629 6629 F DEBUG : #86 pc 00417d75 /system/lib/libart.so (art_quick_invoke_stub_internal+68)
11-24 07:11:38.079 6629 6629 F DEBUG : #87 pc 003f12e7 /system/lib/libart.so (art_quick_invoke_stub+226)
11-24 07:11:38.079 6629 6629 F DEBUG : #88 pc 000a1031 /system/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+136)
11-24 07:11:38.079 6629 6629 F DEBUG : #89 pc 00350a6d /system/lib/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::(anonymous namespace)::ArgArray*, art::JValue*, char const*)+52)
11-24 07:11:38.079 6629 6629 F DEBUG : #90 pc 003517f9 /system/lib/libart.so (art::InvokeVirtualOrInterfaceWithJValues(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, jvalue*)+316)
11-24 07:11:38.079 6629 6629 F DEBUG : #91 pc 00373369 /system/lib/libart.so (art::Thread::CreateCallback(void*)+900)
11-24 07:11:38.079 6629 6629 F DEBUG : #92 pc 00063c15 /system/lib/libc.so (__pthread_start(void*)+22)
11-24 07:11:38.079 6629 6629 F DEBUG : #93 pc 0001e065 /system/lib/libc.so (__start_thread+22)
11-24 07:11:38.111 3180 5761 D audio_hw_subMixingFactory: out_standby_subMixingPCM: out_stream(0xa88de000) usecase: STREAM_PCM_NORMAL
11-24 07:11:38.111 3180 5761 I audio_hw_subMixingFactory: ++usecase_change_validate_l_sm(), dev usecase masks = 0x1, is_standby = 1, out usecase STREAM_PCM_NORMAL
11-24 07:11:38.111 3180 5761 I audio_hw_subMixingFactory: --usecase_change_validate_l_sm(), dev usecase masks = 0, is_standby = 1, out usecase STREAM_PCM_NORMAL
11-24 07:11:38.111 3180 5761 I amlaudioMixer: ++delete_mixer_input_port port ID: 0
11-24 07:11:38.111 3180 3400 E amlaudioMixer: mixer_do_mixing_16bit(), sys or direct pcm must exist!!!
11-24 07:11:38.450 6366 6625 D de.tavendo.autobahn.WebSocketReader: WebSocker reader running.
11-24 07:11:38.451 6366 6626 D de.tavendo.autobahn.WebSocketWriter: WebSocker writer running.
11-24 07:11:38.451 6366 6597 D de.tavendo.autobahn.WebSocketConnection: WebSocket writer created and started.
11-24 07:11:38.452 6366 6597 W WSChannelRTCClient: WebSocket register() in state NEW
11-24 07:11:38.461 6366 6597 D WSRTCClient: C->GAE: https://appr.tc/message/6164317/26579593. Message: {"sdp":"v=0\r\no=- 3622922814870200375 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=group:BUNDLE audio video\r\na=msid-semantic: WMS ARDAMS\r\nm=audio 9 UDP/TLS/RTP/SAVPF 111 103 9 102 0 8 105 13 110 113 126\r\nc=IN IP4 0.0.0.0\r\na=rtcp:9 IN IP4 0.0.0.0\r\na=ice-ufrag:J/m3\r\na=ice-pwd:tNSGDql9Db9zBgfqjHGfaYov\r\na=ice-options:trickle renomination\r\na=fingerprint:sha-256 BD:89:6D:8D:A0:06:16:53:7A:A9:3B:A4:7B:3A:79:D8:B3:95:1B:B4:98:68:57:5D:06:31:A9:9B:FB:10:DA:FE\r\na=setup:actpass\r\na=mid:audio\r\na=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level\r\na=sendrecv\r\na=rtcp-mux\r\na=rtpmap:111 opus/48000/2\r\na=rtcp-fb:111 transport-cc\r\na=fmtp:111 minptime=10;useinbandfec=1\r\na=rtpmap:103 ISAC/16000\r\na=rtpmap:9 G722/8000\r\na=rtpmap:102 ILBC/8000\r\na=rtpmap:0 PCMU/8000\r\na=rtpmap:8 PCMA/8000\r\na=rtpmap:105 CN/16000\r\na=rtpmap:13 CN/8000\r\na=rtpmap:110 telephone-event/48000\r\na=rtpmap:113 telephone-event/16000\r\na=rtpmap:126 telephone-event/8000\r\na=ssrc:3996715550 cname:55TBSGefo/7DpG0+\r\na=ssrc:3996715550 msid:ARDAMS ARDAMSa0\r\na=ssrc:3996715550 mslabel:ARDAMS\r\na=ssrc:3996715550 label:ARDAMSa0\r\nm=video 9 UDP/TLS/RTP/SAVPF 96 97 98 99 100 101 127\r\nc=IN IP4 0.0.0.0\r\na=rtcp:9 IN IP4 0.0.0.0\r\na=ice-ufrag:J/m3\r\na=ice-pwd:tNSGDql9Db9zBgfqjHGfaYov\r\na=ice-options:trickle renomination\r\na=fingerprint:sha-256 BD:89:6D:8D:A0:06:16:53:7A:A9:3B:A4:7B:3A:79:D8:B3:95:1B:B4:98:68:57:5D:06:31:A9:9B:FB:10:DA:FE\r\na=setup:actpass\r\na=mid:video\r\na=extmap:2 urn:ietf:params:rtp-hdrext:toffset\r\na=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time\r\na=extmap:4 urn:3gpp:video-orientation\r\na=extmap:5 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01\r\na=extmap:6 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay\r\na=extmap:7 http://www.webrtc.org/experiments/rtp-hdrext/video-content-type\r\na=extmap:8 http://www.webrtc.org/experiments/rtp-hdrext/video-timing\r\na=sendrecv\r\na=rtcp-mux\r\na=rtcp-rsize\r\na=rtpmap:96 VP8/90000\r\na=rtcp-fb:96 goog-remb\r\na=rtcp-fb:96 transport-cc\r\na=rtcp-fb:96 ccm fir\r\na=rtcp-fb:96 nack\r\na=rtcp-fb:96 nack pli\r\na=rtpmap:97 rtx/90000\r\na=fmtp:97 apt=96\r\na=rtpmap:98 VP9/90000\r\na=rtcp-fb:98 goog-remb\r\na=rtcp-fb:98 transport-cc\r\na=rtcp-fb:98 ccm fir\r\na=rtcp-fb:98 nack\r\na=rtcp-fb:98 nack pli\r\na=rtpmap:99 rtx/90000\r\na=fmtp:99 apt=98\r\na=rtpmap:100 red/90000\r\na=rtpmap:101 rtx/90000\r\na=fmtp:101 apt=100\r\na=rtpmap:127 ulpfec/90000\r\na=ssrc-group:FID 2987521672 3652136281\r\na=ssrc:2987521672 cname:55TBSGefo/7DpG0+\r\na=ssrc:2987521672 msid:ARDAMS ARDAMSv0\r\na=ssrc:2987521672 mslabel:ARDAMS\r\na=ssrc:2987521672 label:ARDAMSv0\r\na=ssrc:3652136281 cname:55TBSGefo/7DpG0+\r\na=ssrc:3652136281 msid:ARDAMS ARDAMSv0\r\na=ssrc:3652136281 mslabel:ARDAMS\r\na=ssrc:3652136281 label:ARDAMSv0\r\n","type":"offer"}
11-24 07:11:38.463 6366 6597 D WSRTCClient: C->GAE: https://appr.tc/message/6164317/26579593. Message: {"type":"candidate","label":0,"id":"audio","candidate":"candidate:640748585 1 udp 2122262783 2409:4071:2004:2fc0:2857:1514:c104:c127 43526 typ host generation 0 ufrag J/m3 network-id 4 network-cost 10"}
11-24 07:11:38.465 6366 6597 D WSRTCClient: C->GAE: https://appr.tc/message/6164317/26579593. Message: {"type":"candidate","label":0,"id":"audio","candidate":"candidate:540798933 1 udp 2122194687 192.168.43.77 47713 typ host generation 0 ufrag J/m3 network-id 3 network-cost 10"}
11-24 07:11:38.477 6366 6597 D WSRTCClient: C->GAE: https://appr.tc/message/6164317/26579593. Message: {"type":"candidate","label":0,"id":"audio","candidate":"candidate:842163049 1 udp 1685987071 157.45.95.4 47713 typ srflx raddr 192.168.43.77 rport 47713 generation 0 ufrag J/m3 network-id 3 network-cost 10"}
11-24 07:11:38.545 3691 3834 W ServiceManagement: Waited one second for [email protected]::IRadio/slot1. Waiting another...
11-24 07:11:38.618 3463 3546 E WifiVendorHal: getWifiLinkLayerStats(l.937) failed {.code = ERROR_NOT_AVAILABLE, .description = }
11-24 07:11:38.737 6366 6625 W de.tavendo.autobahn.WebSocketReader: Status: 101 (Switching Protocols)
11-24 07:11:38.741 6366 6597 D de.tavendo.autobahn.WebSocketConnection: opening handshake received
11-24 07:11:38.741 6366 6597 D WSChannelRTCClient: WebSocket connection opened to: wss://apprtc-ws.webrtc.org:443/ws
11-24 07:11:38.742 6366 6597 D WSChannelRTCClient: Registering WebSocket for room 6164317. ClientID: 26579593
11-24 07:11:38.742 6366 6597 D WSChannelRTCClient: C->WSS: {"cmd":"register","roomid":"6164317","clientid":"26579593"}
11-24 07:11:38.921 3463 3486 W WindowManager: Unable to start animation, surface is null or no children.
11-24 07:11:39.039 6366 6615 W libjingle: (paced_sender.cc:261): Elapsed time (2005 ms) longer than expected, limiting to 2000 ms
11-24 07:11:39.116 3180 3400 I amlaudioMixer: ++mixer_output_standby standby
11-24 07:11:39.116 3180 3400 I audio_hw_port: output_port_standby()
11-24 07:11:39.116 3180 3400 I amlaudioMixer: mixer_16b_threadloop() sleep
11-24 07:11:39.203 3206 3280 E BufferQueueProducer: [Toast#2] disconnect: not connected (req=1)
11-24 07:11:39.204 6366 6396 W libEGL : EGLNativeWindowType 0x93b73008 disconnect failed
11-24 07:11:39.209 3463 3685 W NotificationService: Toast already killed. pkg=humer.uvc_camera callback=android.app.ITransientNotification$Stub$Proxy@c6b5304
11-24 07:11:39.214 3272 3272 E /system/bin/tombstoned: Tombstone written to: /data/tombstones/tombstone_12
11-24 07:11:39.217 3463 6644 W ActivityManager: Force finishing activity humer.uvc_camera/com.example.androidthings.videortc.WebRtc_MainActivity
11-24 07:11:39.239 3463 6644 W ActivityManager: Force finishing activity humer.uvc_camera/com.example.androidthings.videortc.CallActivity
11-24 07:11:39.251 3463 3478 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.DROPBOX_ENTRY_ADDED flg=0x10 (has extras) } to com.google.android.gms/.stats.service.DropBoxEntryAddedReceiver

预览会卡顿问题

您好,我们在拉取代码编译安装到手机上,外接usb相机,预览都是OK的;但是usb相机对着密密麻麻的方格布块时,会出现卡顿的现象,麻烦看看是什么问题。

760e118167dd3bc22079a10fae70b32b.mp4

Randomly freeze

Hi, currently i am trying your library to use external camera with my app, but sometime it will freeze randomly. what are the possible root caused or any idea on how to check?

When it freeze, it wont become workable again until i exit the activity and reenter. I try the your app on play store also facing same issue. One more thing is when it freeze, it dont have any log show out, then i try click capture button, it will have sound but freeze too.

Currently I am using 杰锐微通 DF200 camera with Samsung Galaxy M21 (Android 12)

Intent intent = new Intent(this, StartIsoStreamActivityUvc.class);
Bundle bundle = new Bundle();
bundle.putInt("camStreamingAltSetting", 7);
bundle.putString("videoformat", "YUY2");
bundle.putInt("camFormatIndex", 2);
bundle.putInt("imageWidth", 640);
bundle.putInt("imageHeight", 480);
bundle.putInt("camFrameIndex", 3);
long fps = 10;
bundle.putInt("camFrameInterval", (int) (10000000 / fps));//
bundle.putInt("packetsPerRequest", 8);
bundle.putInt("maxPacketSize", 3072);
bundle.putInt("activeUrbs", 10);
bundle.putByte("bUnitID", (byte) 0);
bundle.putByte("bTerminalID", (byte) 0);
bundle.putByteArray("bNumControlTerminal", null);
bundle.putByteArray("bNumControlUnit", null);
bundle.putByteArray("bcdUVC", null);
bundle.putByte("bStillCaptureMethod", (byte) 0);
bundle.putBoolean("libUsb", true);
bundle.putBoolean("moveToNative", false);
bundle.putBoolean("bulkMode", false);
bundle.putLong("mNativePtr", mNativePtr);
bundle.putInt("connected_to_camera", 0);
intent.putExtra("bun", bundle);
pendingResult = result;
//@return imagePath: null || String = if user click back button will return null
//@return swapCamera: boolean = if user click swap button on top right will return true
startActivityForResult(intent, ActivityStartIsoStreamRequestCode);

Please assist. I had stuck at this part for few days,

Crash on setting manual settings

I am seeing a new crash when attempting to set the manual settings for my camera.

I am also unable to pull the latest commit because of an invalid path, it looks like there is a file ending with "." instead of ".jpeg"

I am doing the following:

  • Plug in camera and open the app (Permissions already allowed)
  • Click SET UP THE CAMERA DEVICE
  • Click FIND THE CAMERA (successful)
  • Click LIST UP THE CAMERA (successful)
  • Click SET UP WITH UVC SETTINGS
  • Click MANUAL on dialog box
    App Crash

Here is the logcat from where the crash occurs (removed timestamps for readability):

from_LibUVC             humer.uvc_camera                     D  _prepare_stream_ctrl sucessfully
from_LibUVC             humer.uvc_camera                     E  _uvc_get_stream_ctrl_format failed
from_LibUVC             humer.uvc_camera                     D  _uvc_get_stream_ctrl_format failed: -51
From libuvc_support     humer.uvc_camera                     E  could not negotiate with camera:err=-51
 From UVCPreviw          humer.uvc_camera                     D  end (-51)
libc                    humer.uvc_camera                     A  Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x42bbcf9842bbcf98 in tid 28752 (umer.uvc_camera), pid 28696 (umer.uvc_camera)
WindowManager           system_server                        E  win=Window{4a45d90 u0 humer.uvc_camera/humer.UvcCamera.SetUpTheUsbDeviceUvc EXITING} destroySurfaces: appStopped=false cleanupOnResume=false win.mWindowRemovalAllowed=true win.mRemoveOnExit=true win.mViewVisibility=0 caller=com.android.server.wm.WindowState.onExitAnimationDone:5997 com.android.server.wm.WindowStateAnimator.onAnimationFinished:225 com.android.server.wm.WindowState.onAnimationFinished:6222 com.android.server.wm.WindowContainer$$ExternalSyntheticLambda4.onAnimationFinished:2 com.android.server.wm.SurfaceAnimator.lambda$getFinishedCallback$0:140 com.android.server.wm.SurfaceAnimator.$r8$lambda$lRxTVOJy8fX752UbrFno9INW9hE:0 com.android.server.wm.SurfaceAnimator$$ExternalSyntheticLambda1.run:8 
DEBUG                   crash_dump64                         A  Cmdline: humer.uvc_camera
DEBUG                   crash_dump64                         A  pid: 28696, tid: 28752, name: umer.uvc_camera  >>> humer.uvc_camera <<<
DEBUG                   crash_dump64                         A        #05 pc 000000000001b48c  /data/app/~~<removed>==/humer.uvc_camera-px-<removed>==/lib/arm64/libuvc_preview.so (UVCPreview::preview_thread_func(void*)+200) (BuildId: <removed>)

Video Probe-Commit Control failed!

Hi !
I'm sorry for making these pictures below so big.
I downloaded the app from the google play.
I tried to set different parameters. One of these is shown as follows.
07433f01e0cd57d16a1b9999733f9eb
However, when I click the "Video Probe-Commit Control" button, the message always shows below.
c78a90e4d630e607e85463de462a14f
I don't know why the 'Camera Frame Index' from the Camera Controltransfer is always equal to 0.
I will be appreciate it if you can help me.
Thank you very much for your contribution.
Some information is as follows.
d99fb0201f0c1a82dce2fac763279e6

157d0e99f7615df674e65f83bfad894

6b7a4b2dc37c4e988ed333ad6fd04d4

Request: Create libuvc separate fork

Hello Peter,
I noticed that the libuvc library you have included in the repo has a readme to ktossell github. I checked and that seems to be the old name. Anyways I was wondering if it's possible for you to fork libuvc to keep track of changes. The reason I ask is that groupgets (purethermal) also has some modifications to libuvc, and I'd hate to cause some conflicts. I also don't want to replace your libuvc version with a potentially older version (when I do pull requests). With a fork I can compare the official repo, with your modifications and merge groupgets' as well.

I hope I wasn't too confusing. I have radiometric data working on a test app with Y16 and would like to implement it here. I don't have much experience with other thermal cameras, but I can assume that they function the same way. Maybe this addition will help other.

Thanks!

Purethermal 2

I noticed that there's a config for 'groupgets' that sets the proper resolution for a purethermal 2 and lepton 3.5 module.
Surprisingly when i hit the stream video it activates the camera (light blinks quickly), but there is no image (it just stays white). This is the farthest I've gotten with this camera on android so far. I've tried UVCcamera and its variants without any success. Unfortunately, the only android device I have is a DJI smart controller which, If I'm not mistaken, runs on Android 7.1.2. I have never developed for android before, so please bear with me.

First, I'd like to point out that I get a build failed under android studio. I get a
Process 'command '/Users/nsk/Library/Android/sdk/ndk/21.1.6352462/ndk-build'' finished with non-zero exit value 2
I got figured out that it has to do to app/src/jni/Android.mk includes that don't exist. After commenting those out, one needs to allow_missing_deps, after this build succeeds.
I'm aiming for this path, because I figured I could get more info debugging this way.

I know that there are a bunch of factors here, dji device(probably a custom android version), thermal camera(luckily its very well documented), and android version on host device, but any help on directing me how to debug this would be greatly appreciated.

How do I setup this camera?

Played with settings a lot, but could not get anything but a white screen.

Bus 001 Device 006: ID 1902:8301 Generic HD camera 
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass          239 Miscellaneous Device
  bDeviceSubClass         2 [unknown]
  bDeviceProtocol         1 Interface Association
  bMaxPacketSize0        64
  idVendor           0x1902 Generic
  idProduct          0x8301 HD camera 
  bcdDevice            1.00
  iManufacturer           1 Generic
  iProduct                2 HD camera 
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x00ef
    bNumInterfaces          2
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              256mA
    Interface Association:
      bLength                 8
      bDescriptorType        11
      bFirstInterface         0
      bInterfaceCount         2
      bFunctionClass         14 Video
      bFunctionSubClass       3 Video Interface Collection
      bFunctionProtocol       0 
      iFunction               2 HD camera 
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass        14 Video
      bInterfaceSubClass      1 Video Control
      bInterfaceProtocol      0 
      iInterface              2 HD camera 
      VideoControl Interface Descriptor:
        bLength                13
        bDescriptorType        36
        bDescriptorSubtype      1 (HEADER)
        bcdUVC               1.00
        wTotalLength       0x0033
        dwClockFrequency       24.000000MHz
        bInCollection           1
        baInterfaceNr( 0)       1
      VideoControl Interface Descriptor:
        bLength                18
        bDescriptorType        36
        bDescriptorSubtype      2 (INPUT_TERMINAL)
        bTerminalID             1
        wTerminalType      0x0201 Camera Sensor
        bAssocTerminal          0
        iTerminal               0 
        wObjectiveFocalLengthMin      0
        wObjectiveFocalLengthMax      0
        wOcularFocalLength            0
        bControlSize                  3
        bmControls           0x00000000
      VideoControl Interface Descriptor:
        bLength                11
        bDescriptorType        36
        bDescriptorSubtype      5 (PROCESSING_UNIT)
      Warning: Descriptor too short
        bUnitID                 2
        bSourceID               1
        wMaxMultiplier          0
        bControlSize            2
        bmControls     0x00000000
        iProcessing             0 
        bmVideoStandards     0x09
          None
          SECAM - 625/50
      VideoControl Interface Descriptor:
        bLength                 9
        bDescriptorType        36
        bDescriptorSubtype      3 (OUTPUT_TERMINAL)
        bTerminalID             3
        wTerminalType      0x0101 USB Streaming
        bAssocTerminal          0
        bSourceID               2
        iTerminal               0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x000a  1x 10 bytes
        bInterval               5
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass        14 Video
      bInterfaceSubClass      2 Video Streaming
      bInterfaceProtocol      0 
      iInterface              0 
      VideoStreaming Interface Descriptor:
        bLength                            14
        bDescriptorType                    36
        bDescriptorSubtype                  1 (INPUT_HEADER)
        bNumFormats                         1
        wTotalLength                   0x007d
        bEndpointAddress                 0x83  EP 3 IN
        bmInfo                              0
        bTerminalLink                       3
        bStillCaptureMethod                 2
        bTriggerSupport                     1
        bTriggerUsage                       0
        bControlSize                        1
        bmaControls( 0)                     0
      VideoStreaming Interface Descriptor:
        bLength                            27
        bDescriptorType                    36
        bDescriptorSubtype                  4 (FORMAT_UNCOMPRESSED)
        bFormatIndex                        1
        bNumFrameDescriptors                2
        guidFormat                            {32595559-0000-0010-8000-00aa00389b71}
        bBitsPerPixel                      16
        bDefaultFrameIndex                  1
        bAspectRatioX                       0
        bAspectRatioY                       0
        bmInterlaceFlags                 0x00
          Interlaced stream or variable: No
          Fields per frame: 2 fields
          Field 1 first: No
          Field pattern: Field 1 only
        bCopyProtect                        0
      VideoStreaming Interface Descriptor:
        bLength                            34
        bDescriptorType                    36
        bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)
        bFrameIndex                         1
        bmCapabilities                   0x00
          Still image unsupported
        wWidth                            640
        wHeight                           480
        dwMinBitRate                 73728000
        dwMaxBitRate                147456000
        dwMaxVideoFrameBufferSize      614400
        dwDefaultFrameInterval         666667
        bFrameIntervalType                  2
        dwFrameInterval( 0)            333333
        dwFrameInterval( 1)           2000000
      VideoStreaming Interface Descriptor:
        bLength                            34
        bDescriptorType                    36
        bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)
        bFrameIndex                         2
        bmCapabilities                   0x00
          Still image unsupported
        wWidth                            320
        wHeight                           240
        dwMinBitRate                   153600
        dwMaxBitRate                  4608000
        dwMaxVideoFrameBufferSize      153600
        dwDefaultFrameInterval         666667
        bFrameIntervalType                  2
        dwFrameInterval( 0)            666667
        dwFrameInterval( 1)           2000000
      VideoStreaming Interface Descriptor:
        bLength                            10
        bDescriptorType                    36
        bDescriptorSubtype                  3 (STILL_IMAGE_FRAME)
        bEndpointAddress                 0x00  EP 0 OUT
        bNumImageSizePatterns               1
        wWidth( 0)                        640
        wHeight( 0)                       480
        bNumCompressionPatterns             0
      VideoStreaming Interface Descriptor:
        bLength                             6
        bDescriptorType                    36
        bDescriptorSubtype                 13 (COLORFORMAT)
        bColorPrimaries                     0 (Unspecified)
        bTransferCharacteristics            0 (Unspecified)
        bMatrixCoefficients                 0 (Unspecified)
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       1
      bNumEndpoints           1
      bInterfaceClass        14 Video
      bInterfaceSubClass      2 Video Streaming
      bInterfaceProtocol      0 
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            5
          Transfer Type            Isochronous
          Synch Type               Asynchronous
          Usage Type               Data
        wMaxPacketSize     0x13e8  3x 1000 bytes
        bInterval               1
Device Qualifier (for other device speed):
  bLength                10
  bDescriptorType         6
  bcdUSB               2.00
  bDeviceClass            0 [unknown]
  bDeviceSubClass         0 [unknown]
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  bNumConfigurations      1
Device Status:     0x0000
  (Bus Powered)

setup for Huawei P8 with AN97

Dear Peter Stroiber
now i have some time to try the UVC app.
but a lot of things are new to me, unknown.
How to set up a Huawei P8 (non-lite) mobile phone with AN97 endoscope.
i have tried many apps but all of them only work with the high-end and samsung device only.
and I think the huawei p8 isn't weak either

Unable To See Preview

After set targetSdkVersion to 27, in Samsung Tab A7 (Android 11) and Vestel Venus V7 (Android 9) I can not see preview. There is only a grey screen.

image

image
image
image

Can't compile the project

Execution failed for task ':app:externalNativeBuildCleanCustomDebugType'.

A problem occurred starting process 'command '/home/peter/Android/Sdk/ndk/android-ndk-r15c/ndk-build''

Can't get camera to display feed

I have connected a Logitech HD 720p C310 to the OTG cable and then into my Android Moto Z3 phone. I can't get the camera feed to come up. The app has crashed every time I've press "Transmission Start." I have been switching the numbers for Packets per Request, Active URBs, and Max Packet Size and nothing has worked. I would prefer not to do hundreds of combinations for this so do you have any tips on getting my camera to display the feed?

Unable to see connected external usb cameras in android mobile browser, Will mobile browser detects an external usb camera like native cameras?

We are unable to see the connected external Usb camera in android mobile browser. The same piece of code will detect and show the connected external Usb cameras in desktop browsers.

Is there anything wrong with the detecting external USB cameras in mobile browsers? will mobile browser supports it or not?

Note: We are using "navigator.mediaDevices.enumerateDevices()" to list the available and connected devices in the browser.

can't to get uvc permission in galaxy(android 10 series)

I tried connect webcam on galaxy s9, s20(android 10).
As a result, it was unable to connect due to the denied authority.

So i tested on pixel(android 10) smartphone. Because to check whether it is an OS problem or a manufacturer problem.
As a result, pixel(android 10) is able to get permission for UVC(USB Video Class : 0x0E).

Android AAR package?

@Peter-St

Once you get everything working, do you plan to create an Android AAR library with UVC camera isochronous transfer support?

BR,

Ladislav

Automatic detection generate error

Hello,

I tried to set up the UVC parameters with the automatic params detection (which I found pretty interesting btw) and it fails.
I tried to debug it and so on but I didn't found anything relevant.

E/AndroidRuntime: FATAL EXCEPTION: main
Process: humer.uvc_camera, PID: 7391
java.lang.NullPointerException: Attempt to read from field 'int humer.uvc_camera.UVC_Descriptor.UVC_Descriptor$FormatIndex.numberOfFrameDescriptors' on a null object reference
at humer.uvc_camera.SaveToFile.selectFrameIndex(SaveToFile.java:1022)
at humer.uvc_camera.SaveToFile.selectFormatIndex(SaveToFile.java:966)
at humer.uvc_camera.SaveToFile.selectUrbs(SaveToFile.java:911)
at humer.uvc_camera.SaveToFile.selectPackets(SaveToFile.java:874)
at humer.uvc_camera.SaveToFile.selectMaxPacketSize(SaveToFile.java:836)
at humer.uvc_camera.SaveToFile.setUpWithUvcValues(SaveToFile.java:758)
at humer.uvc_camera.SetUpTheUsbDevice$23.onDismiss(SetUpTheUsbDevice.java:958)
at android.app.Dialog$ListenersHandler.handleMessage(Dialog.java:1408)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:166)
at android.app.ActivityThread.main(ActivityThread.java:6861)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:450)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
I/Process: Sending signal. PID: 7391 SIG: 9

BR,
Costin

V2.2.4 Video recording does not seem to be working

Steps to reproduce - Workflow 1

  1. Tap on TRANSMISSION START
  2. Tap on Start the camera
  3. Tap on the REC red button (it changes to a Stop icon red button)
  4. Tab on the Stop icon red button (it changes back to the REC red button)

Expected

  1. A message saying the video was successfully captured
  2. Such a video being present somewhere in the phone's internal memory

Actual

Nothing happens

Steps to reproduce - Workflow 2

  1. Tap on TRANSMISSION START
  2. Tap on Start the camera
  3. Long tap on the REC red button (it changes to a Stop icon red button)
  4. Two messages appears as popups one after the other: Long Click - Video starts and Record started
  5. Tab on the Stop icon red button (it changes back to the REC red button)

Expected

  1. A message saying the video was successfully captured
  2. Such a video being present somewhere in the phone's internal memory

Actual

Nothing happens

Additional information

Picture/photo capture works as expected

Support to stream onboard camera data to PC

Hi @Peter-St, is it possible to stream android devices onboard camera data to PC using USB UVC gadget function using your libuvc?
I have custom android firmware for Pixel 4a where I have enabled UVC gadget function on kernel side , which creates a video device node on device side /dev/video3 three , was looking for a JNI implementation which allows me to stream camera data to PC via USB.

This means I can use my device as USB webcam on PC.

Looking forwarder to your response
Thanks

Saving image with error

Hi,

I am using Pure Thermal 2 Flir 3.5. I have no problems with camera stream. However, when I save an image it saves in wrong colors (purple and green) with stripes on it. I am using Android Studio. Have you ever face such a problem ? Am I doing something wrong ?

Thanks in advance.

IMG_4565

My settings are:

Packets Per Request = 4
Active Urbs = 4
AltSetting = 1
Maximal Packet Size = 642
Videoformat = YUv2
Camera Format Index = 1
Camera Framelndex = 1
Image Width = 160
Image Height = 120
Camera Frame Interval (fps) = 9
UVC Values:
bUnitID = 0
bTerminaliD = 0
bcdUVC = 1.00
LibUsb = true

Android 13+ UVYV Stream failed; Result = -1

Hello again Peter,
Long time. I somewhat recently purchased a device running android 13, and would love to get this app running again but on it. As opposed to me using my drone controller like I mentioned before (closed issue #18).
I notice the tons of changes and improvements you've done (Congrats!) I decided to see if I can get this running on 13>, and so far so good. I have the permissions working properly. The thing is I've ran into a bit of a snag. I get this "error" (Stream failed; Result = -1), but it seems that its just a harmless unskippable condition.

This is under the isoStream function in StartIsoStreamActivityUvc.java under else if (videoformat.equals("UYVY")) test.
log("Start the stream .."); int result = -1; //result = JNA_I_LibUsb.INSTANCE.JniStreamOverSurfaceUVC(new Pointer(mNativePtr)); if (result == 0) { ((Button) findViewById(R.id.startStream)).setEnabled(false); stopStreamButton.getBackground().setAlpha(180); // 25% transparent stopStreamButton.setEnabled(true); startStream.getBackground().setAlpha(20); // 95% transparent photoButton.setEnabled(true); photoButton.setBackgroundResource(R.drawable.bg_button_bildaufnahme); videoButton.setEnabled(true); videoButton.setAlpha(1); // 100% transparent stopKamera = false; } else { displayMessage("Stream failed; Result = " + result); log ("Stream failed; Result = " + result); }
Here's the deal ignoring the message, no video is produced. While debugging I can see that the application can see the USB device along with the vendor ID etc. Since the rework, is this part still under development? I could upload the changes to my cloned repo, but the code will definitely leave out anyone running Android less than 13. Basically it was a quick hack to get it running with proper permission requests. I can fix this later so it doesn't leave out other users.

---- edit ----
Basically, I'd like to know if its not currently working and I'm chasing a wild goose. Or it should work, and it something that I need to fix to get working for android 13+

Yuv format not available

Hello,

I tried to take out the frames from the camera in YUV format but it doesnt work, I see only random pixels and after this I tried to convert by myself the the frames from jpeg to yuv but still no success.
Do you have any idea about how I can do this in a clean manner?

Thanks,
Costin

"Can't get Camera Permissions"

Using the current application from the play store, can not setup the camera. I have my USB OTG camera working with other apps.

The only permissions for the app which can be granted appear to be for storage.

In contrast other apps which show the camera feed also have a camera permission...

I'm on Android 10 on a Pixel XL.

Camera Autofocus

Hello,

Great job for this project, it was really useful for me after some magic params combinations.
I use an UVC camera that is trying to autofocus.
Do you think that it can be any chance to control the autofocus? at least to enable/disable it

Cheers,

PureThermal 2

Hi,

I'm getting Stream failed; Result =-1 when trying to start a transmission for a purethermal camera.
firmware 1.3

Any help is much appreciated.

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.