Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Error while starting demo screen streamer #147

Closed
zorge2411 opened this issue Jun 28, 2024 · 2 comments
Closed

[Bug]: Error while starting demo screen streamer #147

zorge2411 opened this issue Jun 28, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@zorge2411
Copy link

Version

2.6.0

Environment that reproduces the issue

Real device: Samsung S21FE
Emulated device: Pixel 5 - API 34

RTMP/SRT/... Server

RTMP screen streamer

Audio configuration

No response

Video configuration

No response

Is it reproducible in the demos application?

Yes

Reproduction steps

Setup RTMP server, press 'Record screen' - after allowing screen recording app fails

Expected result

Stream screen to RTMP server

Actual result

The app reports the following error:
Screenshot_20240628_124309_Screen Recorder

Additional context

No response

Relevant logs output

Error while starting streamer
io.github.thibaultbee.streampack.error.StreamPackError: java.lang.IllegalStateException: Must register a callback before starting capture, to manage resources in response to MediaProjection states.
	at io.github.thibaultbee.streampack.streamers.bases.BaseStreamer.startStream$suspendImpl(BaseStreamer.kt:308)
	at io.github.thibaultbee.streampack.streamers.bases.BaseStreamer$startStream$1.invokeSuspend(Unknown Source:14)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
	at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:280)
	at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:85)
	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59)
	at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source:1)
	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38)
	at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source:1)
	at io.github.thibaultbee.streampack.screenrecorder.MainActivity.configureAndStart(MainActivity.kt:217)
	at io.github.thibaultbee.streampack.screenrecorder.MainActivity.access$configureAndStart(MainActivity.kt:54)
	at io.github.thibaultbee.streampack.screenrecorder.MainActivity$getContent$1$3.invoke(MainActivity.kt:148)
	at io.github.thibaultbee.streampack.screenrecorder.MainActivity$getContent$1$3.invoke(MainActivity.kt:139)
	at io.github.thibaultbee.streampack.ext.rtmp.services.ScreenRecorderRtmpLiveService$Companion$launch$1.invoke(ScreenRecorderRtmpLiveService.kt:67)
	at io.github.thibaultbee.streampack.ext.rtmp.services.ScreenRecorderRtmpLiveService$Companion$launch$1.invoke(ScreenRecorderRtmpLiveService.kt:63)
	at io.github.thibaultbee.streampack.streamers.services.BaseScreenRecorderService$Companion$launch$connection$1.onServiceConnected(BaseScreenRecorderService.kt:303)
	at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:2198)
	at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:2231)
	at android.os.Handler.handleCallback(Handler.java:958)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loopOnce(Looper.java:205)
	at android.os.Looper.loop(Looper.java:294)
	at android.app.ActivityThread.main(ActivityThread.java:8177)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971)
Caused by: java.lang.IllegalStateException: Must register a callback before starting capture, to manage resources in response to MediaProjection states.
	at android.media.projection.MediaProjection.createVirtualDisplay(MediaProjection.java:206)
	at io.github.thibaultbee.streampack.internal.sources.screen.ScreenSource.startStream(ScreenSource.kt:116)
	at io.github.thibaultbee.streampack.streamers.bases.BaseStreamer.startStream$suspendImpl(BaseStreamer.kt:304)
	at io.github.thibaultbee.streampack.streamers.bases.BaseStreamer$startStream$1.invokeSuspend(Unknown Source:14) 
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) 
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108) 
	at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:280) 
	at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:85) 
	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59) 
	at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source:1) 
	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38) 
	at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source:1) 
	at io.github.thibaultbee.streampack.screenrecorder.MainActivity.configureAndStart(MainActivity.kt:217) 
	at io.github.thibaultbee.streampack.screenrecorder.MainActivity.access$configureAndStart(MainActivity.kt:54) 
	at io.github.thibaultbee.streampack.screenrecorder.MainActivity$getContent$1$3.invoke(MainActivity.kt:148) 
	at io.github.thibaultbee.streampack.screenrecorder.MainActivity$getContent$1$3.invoke(MainActivity.kt:139) 
	at io.github.thibaultbee.streampack.ext.rtmp.services.ScreenRecorderRtmpLiveService$Companion$launch$1.invoke(ScreenRecorderRtmpLiveService.kt:67) 
	at io.github.thibaultbee.streampack.ext.rtmp.services.ScreenRecorderRtmpLiveService$Companion$launch$1.invoke(ScreenRecorderRtmpLiveService.kt:63) 
	at io.github.thibaultbee.streampack.streamers.services.BaseScreenRecorderService$Companion$launch$connection$1.onServiceConnected(BaseScreenRecorderService.kt:303) 
	at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:2198) 
	at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:2231) 
	at android.os.Handler.handleCallback(Handler.java:958) 
	at android.os.Handler.dispatchMessage(Handler.java:99) 
	at android.os.Looper.loopOnce(Looper.java:205) 
	at android.os.Looper.loop(Looper.java:294) 
	at android.app.ActivityThread.main(ActivityThread.java:8177) 
	at java.lang.reflect.Method.invoke(Native Method) 
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552) 
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971) 
@zorge2411 zorge2411 added the bug Something isn't working label Jun 28, 2024
@ThibaultBee
Copy link
Owner

Thanks for the report.
See fix in 607327e

@zorge2411
Copy link
Author

And it works like a charm!
Thx!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants