client-sdk-android icon indicating copy to clipboard operation
client-sdk-android copied to clipboard

room.disconnect(),房间关闭不了,ANR

Open shangshuaibo opened this issue 1 year ago • 5 comments

          track = localParticipant.createVideoTrack(
                options = LocalVideoTrackOptions(position = CameraPosition.FRONT)
            )
            track?.addRenderer(mBinding.localRenderer)
            track?.startCapture()
            localParticipant.publishVideoTrack(track!!, VideoTrackPublishOptions("FRONT"))

以上方法推流,可以正常把流推到服务器但是 room.disconnect() 关闭的时候会ANR 默认方式关闭没问题

shangshuaibo avatar Jul 08 '24 06:07 shangshuaibo

Please post the version of the SDK that you're using. If you're getting an ANR, please grab the ANR stack traces and post them as well.

davidliu avatar Jul 08 '24 06:07 davidliu

版本是1.1.0,新版本在安卓一体机外接USB摄像头推流的时候黑屏,试过所有版本1.1.0可以正常显示画面

shangshuaibo avatar Jul 08 '24 07:07 shangshuaibo

That's a really old unsupported version, so can't really help you with fixing it.

What'll probably be better is fixing the issue with USB cameras so that it works on the latest version. What kind of USB camera are you using? Is it just a USB-OTG camera or something else (product information would be helpful).

davidliu avatar Jul 08 '24 13:07 davidliu

java.lang.Object.wait (Object.java:386)
java.lang.Object.wait (Object.java:524)
livekit.org.webrtc.CameraCapturer.stopCapture (CameraCapturer.java:286)
livekit.org.webrtc.Camera2Capturer.stopCapture (Camera2Capturer.java)
io.livekit.android.room.track.video.Camera2CapturerWithSize.stopCapture (VideoCapturerWithSize.kt:2)
io.livekit.android.room.track.LocalVideoTrack.stop (LocalVideoTrack.kt:119)
io.livekit.android.room.participant.LocalParticipant.cleanup (LocalParticipant.kt:793)
io.livekit.android.room.Room.cleanupRoom (Room.kt:713)
io.livekit.android.room.Room.access$cleanupRoom (Room.kt:63)
io.livekit.android.room.Room$handleDisconnect$1.invokeSuspend (Room.kt:695)
kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith (ContinuationImpl.kt:33)
kotlinx.coroutines.DispatchedTask.run (DispatchedTask.kt:104)
kotlinx.coroutines.EventLoopImplBase.processNextEvent (EventLoop.common.kt:277)
kotlinx.coroutines.BlockingCoroutine.joinBlocking (BlockingCoroutine.java:95)
kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking (BuildersKt__Builders.kt:69)
kotlinx.coroutines.BuildersKt.runBlocking (Builders.kt:1)
kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default (BuildersKt__Builders.kt:48)
kotlinx.coroutines.BuildersKt.runBlocking$default (Builders.kt:1)
io.livekit.android.room.Room.handleDisconnect (Room.kt:687)
io.livekit.android.room.Room.disconnect (Room.kt:419)

androidx.lifecycle.ViewModel.clear (ViewModel.java:190)
androidx.lifecycle.ViewModelStore.clear (ViewModelStore.kt:72)
androidx.activity.ComponentActivity$3.onStateChanged (ComponentActivity.java:296)
androidx.lifecycle.LifecycleRegistry$ObserverWithState.dispatchEvent (LifecycleRegistry.kt:314)
androidx.lifecycle.LifecycleRegistry.backwardPass (LifecycleRegistry.kt:266)
androidx.lifecycle.LifecycleRegistry.sync (LifecycleRegistry.kt:283)
androidx.lifecycle.LifecycleRegistry.moveToState (LifecycleRegistry.kt:136)
androidx.lifecycle.LifecycleRegistry.handleLifecycleEvent (LifecycleRegistry.kt:119)
androidx.lifecycle.ReportFragment$Companion.dispatch$lifecycle_runtime_release (ReportFragment.kt:192)
androidx.lifecycle.ReportFragment$LifecycleCallbacks.onActivityPreDestroyed (ReportFragment.kt:148)
android.app.Activity.dispatchActivityPreDestroyed (Activity.java:1616)
android.app.Activity.performDestroy (Activity.java:8800)
android.app.Instrumentation.callActivityOnDestroy (Instrumentation.java:1452)
android.app.ActivityThread.performDestroyActivity (ActivityThread.java:5569)
android.app.ActivityThread.handleDestroyActivity (ActivityThread.java:5615)
android.app.servertransaction.DestroyActivityItem.execute (DestroyActivityItem.java:47)
android.app.servertransaction.ActivityTransactionItem.execute (ActivityTransactionItem.java:45)
android.app.servertransaction.TransactionExecutor.executeLifecycleState (TransactionExecutor.java:176)
android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:97)
android.app.ActivityThread$H.handleMessage (ActivityThread.java:2405)
android.os.Handler.dispatchMessage (Handler.java:106)
android.os.Looper.loopOnce (Looper.java:211)
android.os.Looper.loop (Looper.java:300)
android.app.ActivityThread.main (ActivityThread.java:8152)
java.lang.reflect.Method.invoke (Native method)
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:580)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1028)

livekit.org.webrtc.CameraCapturer.stopCapture (CameraCapturer.java:286)

@davidliu I'm facing the same issue with v2.3.0. Can you take a look? Tysm

akaizz2 avatar Jul 24 '24 05:07 akaizz2

@akaizz2 can you post a separate issue? Also, I'll need to have the ANR stack traces to properly diagnose. It'd be helpful if you could generate a bug report which will capture the relevant ANR traces and logs.

davidliu avatar Jul 24 '24 08:07 davidliu