Click here to Skip to main content
15,914,452 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

because of the fact of certain chipsets on Android does not support Isochronous transfer for usb camera streaming, I want to try a different way over a selfcompiled app. This app should use it's access to the camera over JNA to get the video stream running.

You can see my project on github:


GitHub - Peter-St/UVC_camera_usb_iso[^]

The first thing was to correctly link the JNA.jar to the program. I solved this by downloading the jna.jar from jna/dist at master · java-native-access/jna · GitHub[^] and linked it with the correct *.so library to the project. Next part is to study the app to get the video stream running

Regards,

Peter

What I have tried:

In my project I'm using the usbiso.java code which can be found: UsbIso - USB isochronous transfer controller (Java class for Android / Linux)[^]
The rest of the project runns over the main.java code.
Posted
Updated 19-Jan-18 17:16pm
v2
Comments
David Crow 7-Jan-18 21:51pm    
"...but the app always crashes with a java class error."

And that error would be what exactly?
David Crow 16-Jan-18 16:16pm    
Logcat messages aside, which most of them are system messages, what exactly is the problem? All I see in your code is the creation of a UsbIso object, followed by calling its preallocateRequests() and getRequest() methods. Are those not working? Is an exception being thrown?
Peter____ 19-Jan-18 6:06am    
With my microdia Camera I'll get the following error:

E/UsbCamTest1: Error in MainActivity
java.lang.Exception: Unable to claim camera control interface.
at humer.uvc_camera.Main.openCameraDevice(Main.java:318)
at humer.uvc_camera.Main.openCam(Main.java:200)
at humer.uvc_camera.Main.openCamButtonClickEvent(Main.java:191)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at android.view.View$1.onClick(View.java:3058)
at android.view.View.performClick(View.java:3534)
at android.view.View$PerformClick.run(View.java:14263)
at android.os.Handler.handleCallback(Handler.java:605)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4441)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java)
at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:132)
at dalvik.system.NativeStart.main(Native Method)
Peter____ 19-Jan-18 6:07am    
With my arcmicro camera i receive following logcat:

D/libEGL: loaded /system/lib/egl/libEGL_mali.so
D/libEGL: loaded /system/lib/egl/libGLESv1_CM_mali.so
D/libEGL: loaded /system/lib/egl/libGLESv2_mali.so
D/OpenGLRenderer: Enabling debug mode 0
I/UsbCamTest1: USB devices count = 1
I/UsbCamTest1: USB device "/dev/bus/usb/001/025": UsbDevice[mName=/dev/bus/usb/001/025,mVendorId=6380,mProductId=13200,mClass=239,mSubclass=2,mProtocol=1,mInterfaces=[Landroid.os.Parcelable;@41e025f8]
I/UsbCamTest1: USB devices count = 1
I/UsbCamTest1: USB device "/dev/bus/usb/001/025": UsbDevice[mName=/dev/bus/usb/001/025,mVendorId=6380,mProductId=13200,mClass=239,mSubclass=2,mProtocol=1,mInterfaces=[Landroid.os.Parcelable;@41e05318]
I/UsbCamTest1: USB devices count = 1
I/UsbCamTest1: USB device "/dev/bus/usb/001/025": UsbDevice[mName=/dev/bus/usb/001/025,mVendorId=6380,mProductId=13200,mClass=239,mSubclass=2,mProtocol=1,mInterfaces=[Landroid.os.Parcelable;@41e0a258]
D/dalvikvm: Trying to load lib /data/data/humer.uvc_camera/lib/libjnidispatch.so 0x41dcf1a8
D/dalvikvm: Added shared lib /data/data/humer.uvc_camera/lib/libjnidispatch.so 0x41dcf1a8
I/UsbCamTest1: Warning: getVideoStreamErrorCode() failed: java.lang.Exception: VS_STREAM_ERROR_CODE_CONTROL failed, len=-1.
I/UsbCamTest1: Initial streaming parms: hint=0x0 format=1 frame=1 frameInterval=2000000 keyFrameRate=0 pFrameRate=0 compQuality=0 compWindowSize=0 delay=0 maxVideoFrameSize=0 maxPayloadTransferSize=0
I/UsbCamTest1: Probed streaming parms: hint=0x0 format=1 frame=1 frameInterval=2000000 keyFrameRate=0 pFrameRate=0 compQuality=0 compWindowSize=0 delay=0 maxVideoFrameSize=614400 maxPayloadTransferSize=3000
I/UsbCamTest1: Final streaming parms: hint=0x0 format=1 frame=1 frameInterval=2000000 keyFrameRate=0 pFrameRate=0 compQuality=0 compWindowSize=0 delay=0 maxVideoFrameSize=614400 maxPayloadTransferSize=3000


Here were no Error messages, but the app only shows a blanc white screen. The question would be, how to get the videostream running?

Thanks in advance,

Peter
Peter____ 19-Jan-18 6:17am    
The whole android studio project is on my github repo:

https://github.com/Peter-St/UVC_camera_usb_iso

1 solution

New link for the working project:

GitHub - Peter-St/Android-UVC-Camera[^]

Peter
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900