Peter-St / Android-UVC-Camera

GNU Lesser General Public License v2.1
136 stars 25 forks source link

Randomly freeze #46

Open wenrong443 opened 2 months ago

wenrong443 commented 2 months ago

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,

Peter-St commented 1 month ago

Hi,

eventually changing the packets / request and the activeUrbs can help. Try out lowering this values.

So far,

Peter