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

App crashes randomly during playback #52

Open
4 tasks done
rrd1 opened this issue Jun 1, 2024 · 9 comments
Open
4 tasks done

App crashes randomly during playback #52

rrd1 opened this issue Jun 1, 2024 · 9 comments

Comments

@rrd1
Copy link

rrd1 commented Jun 1, 2024

Checklist

  • I have used the search function for OPEN issues to see if someone else has already submitted the same bug report.
  • I have also used the search function for CLOSED issues to see if the problem is already solved and just waiting to be released.
  • I will describe the problem with as much detail as possible.
  • If the bug only to occurs with a certain podcast, I will include the URL of that podcast.

App version

5.4.1

Where did you get the app from

Other

Android version

GrapheneOS, Android 14, latest stabile version

Device model

Pixel 7

First occurred

Since this or the previous release

Steps to reproduce

  • Just play Podcast (listen via Bluetooth, not sure if that matters)
  • listen for a while, screen locked, device not touched

Expected behaviour

App does not crash ;)

Current behaviour

  • App crashes randomly without notification during playback
  • playback can be continued after app is started again manually

Logs

        ## Environment

Android version: 14
OS version: 5.10.214-android13-4-gff787e312580
Podcini version: 5.4.1
Model: Pixel 7
Device: panther
Product: panther

        ## Crash info

Time: 01-06-2024 17:19:03
Podcini version: 5.4.1

StackTrace

java.lang.IllegalStateException: Can't call init() after release() has been called
	at ac.mdiq.podcini.playback.PlaybackController.initServiceRunning(SourceFile:104)
	at ac.mdiq.podcini.playback.PlaybackController.init(SourceFile:74)
	at ac.mdiq.podcini.playback.PlaybackController$procFlowEvents$1$1.invokeSuspend(SourceFile:83)
	at ac.mdiq.podcini.playback.PlaybackController$procFlowEvents$1$1.invoke(SourceFile:0)
	at ac.mdiq.podcini.playback.PlaybackController$procFlowEvents$1$1.invoke(SourceFile:0)
	at kotlinx.coroutines.flow.FlowKt__MergeKt$mapLatest$1.invokeSuspend(SourceFile:213)
	at kotlinx.coroutines.flow.FlowKt__MergeKt$mapLatest$1.invoke(SourceFile:0)
	at kotlinx.coroutines.flow.FlowKt__MergeKt$mapLatest$1.invoke(SourceFile:0)
	at kotlinx.coroutines.flow.internal.ChannelFlowTransformLatest$flowCollect$3$1$2.invokeSuspend(SourceFile:30)
	at kotlinx.coroutines.flow.internal.ChannelFlowTransformLatest$flowCollect$3$1$2.invoke(SourceFile:0)
	at kotlinx.coroutines.flow.internal.ChannelFlowTransformLatest$flowCollect$3$1$2.invoke(SourceFile:0)
	at kotlinx.coroutines.intrinsics.UndispatchedKt.startCoroutineUndispatched(SourceFile:27)
	at kotlinx.coroutines.CoroutineStart.invoke(SourceFile:90)
	at kotlinx.coroutines.AbstractCoroutine.start(SourceFile:123)
	at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch(SourceFile:52)
	at kotlinx.coroutines.BuildersKt.launch(SourceFile:1)
	at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch$default(SourceFile:43)
	at kotlinx.coroutines.BuildersKt.launch$default(SourceFile:1)
	at kotlinx.coroutines.flow.internal.ChannelFlowTransformLatest$flowCollect$3$1.emit(SourceFile:29)
	at kotlinx.coroutines.flow.SharedFlowImpl.collect$suspendImpl(SourceFile:392)
	at kotlinx.coroutines.flow.SharedFlowImpl.collect(Unknown Source:0)
	at kotlinx.coroutines.flow.internal.ChannelFlowTransformLatest$flowCollect$3.invokeSuspend(SourceFile:23)
	at kotlinx.coroutines.flow.internal.ChannelFlowTransformLatest$flowCollect$3.invoke(SourceFile:0)
	at kotlinx.coroutines.flow.internal.ChannelFlowTransformLatest$flowCollect$3.invoke(SourceFile:0)
	at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(SourceFile:61)
	at kotlinx.coroutines.CoroutineScopeKt.coroutineScope(SourceFile:261)
	at kotlinx.coroutines.flow.internal.ChannelFlowTransformLatest.flowCollect(SourceFile:21)
	at kotlinx.coroutines.flow.internal.ChannelFlowOperator.collectTo$suspendImpl(SourceFile:153)
	at kotlinx.coroutines.flow.internal.ChannelFlowOperator.collectTo(Unknown Source:0)
	at kotlinx.coroutines.flow.internal.ChannelFlow$collectToFun$1.invokeSuspend(SourceFile:56)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(SourceFile:33)
	at kotlinx.coroutines.DispatchedTask.run(SourceFile:104)
	at kotlinx.coroutines.EventLoop.processUnconfinedEvent(SourceFile:65)
	at kotlinx.coroutines.internal.DispatchedContinuationKt.resumeCancellableWith(SourceFile:201)
	at kotlinx.coroutines.intrinsics.CancellableKt.startCoroutineCancellable(SourceFile:26)
	at kotlinx.coroutines.intrinsics.CancellableKt.startCoroutineCancellable$default(SourceFile:21)
	at kotlinx.coroutines.CoroutineStart.invoke(SourceFile:88)
	at kotlinx.coroutines.AbstractCoroutine.start(SourceFile:123)
	at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch(SourceFile:52)
	at kotlinx.coroutines.BuildersKt.launch(SourceFile:1)
	at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch$default(SourceFile:43)
	at kotlinx.coroutines.BuildersKt.launch$default(SourceFile:1)
	at ac.mdiq.podcini.playback.PlaybackController.procFlowEvents(SourceFile:79)
	at ac.mdiq.podcini.playback.PlaybackController.init(SourceFile:71)
	at ac.mdiq.podcini.playback.PlaybackController$procFlowEvents$1$1.invokeSuspend(SourceFile:83)
	at ac.mdiq.podcini.playback.PlaybackController$procFlowEvents$1$1.invoke(SourceFile:0)
	at ac.mdiq.podcini.playback.PlaybackController$procFlowEvents$1$1.invoke(SourceFile:0)
	at kotlinx.coroutines.flow.FlowKt__MergeKt$mapLatest$1.invokeSuspend(SourceFile:213)
	at kotlinx.coroutines.flow.FlowKt__MergeKt$mapLatest$1.invoke(SourceFile:0)
	at kotlinx.coroutines.flow.FlowKt__MergeKt$mapLatest$1.invoke(SourceFile:0)
	at kotlinx.coroutines.flow.internal.ChannelFlowTransformLatest$flowCollect$3$1$2.invokeSuspend(SourceFile:30)
	at kotlinx.coroutines.flow.internal.ChannelFlowTransformLatest$flowCollect$3$1$2.invoke(SourceFile:0)
	at kotlinx.coroutines.flow.internal.ChannelFlowTransformLatest$flowCollect$3$1$2.invoke(SourceFile:0)
	at kotlinx.coroutines.intrinsics.UndispatchedKt.startCoroutineUndispatched(SourceFile:27)
	at kotlinx.coroutines.CoroutineStart.invoke(SourceFile:90)
	at kotlinx.coroutines.AbstractCoroutine.start(SourceFile:123)
	at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch(SourceFile:52)
	at kotlinx.coroutines.BuildersKt.launch(SourceFile:1)
	at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch$default(SourceFile:43)
	at kotlinx.coroutines.BuildersKt.launch$default(SourceFile:1)
	at kotlinx.coroutines.flow.internal.ChannelFlowTransformLatest$flowCollect$3$1.emit(SourceFile:29)
	at kotlinx.coroutines.flow.SharedFlowImpl.collect$suspendImpl(SourceFile:392)
	at kotlinx.coroutines.flow.SharedFlowImpl$collect$1.invokeSuspend(Unknown Source:12)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(SourceFile:33)
	at kotlinx.coroutines.DispatchedTask.run(SourceFile:104)
	at android.os.Handler.handleCallback(Handler.java:959)
	at android.os.Handler.dispatchMessage(Handler.java:100)
	at android.os.Looper.loopOnce(Looper.java:232)
	at android.os.Looper.loop(Looper.java:317)
	at android.app.ActivityThread.main(ActivityThread.java:8532)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
	at com.android.internal.os.ExecInit.main(ExecInit.java:50)
	at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
	at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:359)
	Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@9d41327, Dispatchers.Main.immediate]
@rrd1
Copy link
Author

rrd1 commented Jun 1, 2024

App crashes sometimes immediately after launching it. I'm afraid the origin log was also from such situation.

Here's another one. I'll try to catch the one during playback soon.

        ## Environment

Android version: 14
OS version: 5.10.214-android13-4-gff787e312580
Podcini version: 5.4.1
Model: Pixel 7
Device: panther
Product: panther

        ## Crash info

Time: 01-06-2024 22:56:49
Podcini version: 5.4.1

StackTrace

java.lang.IllegalStateException: Can't call init() after release() has been called
	at ac.mdiq.podcini.playback.PlaybackController.initServiceRunning(SourceFile:104)
	at ac.mdiq.podcini.playback.PlaybackController.init(SourceFile:74)
	at ac.mdiq.podcini.playback.PlaybackController$procFlowEvents$1$1.invokeSuspend(SourceFile:83)
	at ac.mdiq.podcini.playback.PlaybackController$procFlowEvents$1$1.invoke(SourceFile:0)
	at ac.mdiq.podcini.playback.PlaybackController$procFlowEvents$1$1.invoke(SourceFile:0)
	at kotlinx.coroutines.flow.FlowKt__MergeKt$mapLatest$1.invokeSuspend(SourceFile:213)
	at kotlinx.coroutines.flow.FlowKt__MergeKt$mapLatest$1.invoke(SourceFile:0)
	at kotlinx.coroutines.flow.FlowKt__MergeKt$mapLatest$1.invoke(SourceFile:0)
	at kotlinx.coroutines.flow.internal.ChannelFlowTransformLatest$flowCollect$3$1$2.invokeSuspend(SourceFile:30)
	at kotlinx.coroutines.flow.internal.ChannelFlowTransformLatest$flowCollect$3$1$2.invoke(SourceFile:0)
	at kotlinx.coroutines.flow.internal.ChannelFlowTransformLatest$flowCollect$3$1$2.invoke(SourceFile:0)
	at kotlinx.coroutines.intrinsics.UndispatchedKt.startCoroutineUndispatched(SourceFile:27)
	at kotlinx.coroutines.CoroutineStart.invoke(SourceFile:90)
	at kotlinx.coroutines.AbstractCoroutine.start(SourceFile:123)
	at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch(SourceFile:52)
	at kotlinx.coroutines.BuildersKt.launch(SourceFile:1)
	at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch$default(SourceFile:43)
	at kotlinx.coroutines.BuildersKt.launch$default(SourceFile:1)
	at kotlinx.coroutines.flow.internal.ChannelFlowTransformLatest$flowCollect$3$1.emit(SourceFile:29)
	at kotlinx.coroutines.flow.SharedFlowImpl.collect$suspendImpl(SourceFile:392)
	at kotlinx.coroutines.flow.SharedFlowImpl.collect(Unknown Source:0)
	at kotlinx.coroutines.flow.internal.ChannelFlowTransformLatest$flowCollect$3.invokeSuspend(SourceFile:23)
	at kotlinx.coroutines.flow.internal.ChannelFlowTransformLatest$flowCollect$3.invoke(SourceFile:0)
	at kotlinx.coroutines.flow.internal.ChannelFlowTransformLatest$flowCollect$3.invoke(SourceFile:0)
	at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(SourceFile:61)
	at kotlinx.coroutines.CoroutineScopeKt.coroutineScope(SourceFile:261)
	at kotlinx.coroutines.flow.internal.ChannelFlowTransformLatest.flowCollect(SourceFile:21)
	at kotlinx.coroutines.flow.internal.ChannelFlowOperator.collectTo$suspendImpl(SourceFile:153)
	at kotlinx.coroutines.flow.internal.ChannelFlowOperator.collectTo(Unknown Source:0)
	at kotlinx.coroutines.flow.internal.ChannelFlow$collectToFun$1.invokeSuspend(SourceFile:56)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(SourceFile:33)
	at kotlinx.coroutines.DispatchedTask.run(SourceFile:104)
	at kotlinx.coroutines.EventLoop.processUnconfinedEvent(SourceFile:65)
	at kotlinx.coroutines.internal.DispatchedContinuationKt.resumeCancellableWith(SourceFile:201)
	at kotlinx.coroutines.intrinsics.CancellableKt.startCoroutineCancellable(SourceFile:26)
	at kotlinx.coroutines.intrinsics.CancellableKt.startCoroutineCancellable$default(SourceFile:21)
	at kotlinx.coroutines.CoroutineStart.invoke(SourceFile:88)
	at kotlinx.coroutines.AbstractCoroutine.start(SourceFile:123)
	at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch(SourceFile:52)
	at kotlinx.coroutines.BuildersKt.launch(SourceFile:1)
	at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch$default(SourceFile:43)
	at kotlinx.coroutines.BuildersKt.launch$default(SourceFile:1)
	at ac.mdiq.podcini.playback.PlaybackController.procFlowEvents(SourceFile:79)
	at ac.mdiq.podcini.playback.PlaybackController.init(SourceFile:71)
	at ac.mdiq.podcini.playback.PlaybackController$procFlowEvents$1$1.invokeSuspend(SourceFile:83)
	at ac.mdiq.podcini.playback.PlaybackController$procFlowEvents$1$1.invoke(SourceFile:0)
	at ac.mdiq.podcini.playback.PlaybackController$procFlowEvents$1$1.invoke(SourceFile:0)
	at kotlinx.coroutines.flow.FlowKt__MergeKt$mapLatest$1.invokeSuspend(SourceFile:213)
	at kotlinx.coroutines.flow.FlowKt__MergeKt$mapLatest$1.invoke(SourceFile:0)
	at kotlinx.coroutines.flow.FlowKt__MergeKt$mapLatest$1.invoke(SourceFile:0)
	at kotlinx.coroutines.flow.internal.ChannelFlowTransformLatest$flowCollect$3$1$2.invokeSuspend(SourceFile:30)
	at kotlinx.coroutines.flow.internal.ChannelFlowTransformLatest$flowCollect$3$1$2.invoke(SourceFile:0)
	at kotlinx.coroutines.flow.internal.ChannelFlowTransformLatest$flowCollect$3$1$2.invoke(SourceFile:0)
	at kotlinx.coroutines.intrinsics.UndispatchedKt.startCoroutineUndispatched(SourceFile:27)
	at kotlinx.coroutines.CoroutineStart.invoke(SourceFile:90)
	at kotlinx.coroutines.AbstractCoroutine.start(SourceFile:123)
	at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch(SourceFile:52)
	at kotlinx.coroutines.BuildersKt.launch(SourceFile:1)
	at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch$default(SourceFile:43)
	at kotlinx.coroutines.BuildersKt.launch$default(SourceFile:1)
	at kotlinx.coroutines.flow.internal.ChannelFlowTransformLatest$flowCollect$3$1.emit(SourceFile:29)
	at kotlinx.coroutines.flow.SharedFlowImpl.collect$suspendImpl(SourceFile:392)
	at kotlinx.coroutines.flow.SharedFlowImpl$collect$1.invokeSuspend(Unknown Source:12)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(SourceFile:33)
	at kotlinx.coroutines.DispatchedTask.run(SourceFile:104)
	at android.os.Handler.handleCallback(Handler.java:959)
	at android.os.Handler.dispatchMessage(Handler.java:100)
	at android.os.Looper.loopOnce(Looper.java:232)
	at android.os.Looper.loop(Looper.java:317)
	at android.app.ActivityThread.main(ActivityThread.java:8532)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
	at com.android.internal.os.ExecInit.main(ExecInit.java:50)
	at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
	at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:359)
	Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@612b2a6, Dispatchers.Main.immediate]

@XilinJia
Copy link
Owner

XilinJia commented Jun 2, 2024

Thanks for reporting. I also noticed this. It happens when starting Podcini after it has been idle for a long time. I know where this is triggered in the code, but not too sure about the underlying cause yet.

@XilinJia
Copy link
Owner

XilinJia commented Jun 2, 2024

likely fixed in 5.4.2

@rrd1
Copy link
Author

rrd1 commented Jun 4, 2024

Thanks a lot for your immediate support! I didn't faced a crash neither at startup nor during playback with the new version until now.
So seem to be solved, I'll report if it happens again.

@XilinJia
Copy link
Owner

XilinJia commented Jun 4, 2024

I'm glad it works out so far. Please report back if it happens again. I'll keep this open for sometime. Cheers.

@rrd1
Copy link
Author

rrd1 commented Jun 4, 2024

Unfortunately, it happened quicker than we hoped ;)
Crash during playback:

        ## Environment

Android version: 14
OS version: 5.10.214-android13-4-gff787e312580
Podcini version: 5.4.2
Model: Pixel 7
Device: panther
Product: panther

        ## Crash info

Time: 04-06-2024 21:49:09
Podcini version: 5.4.2

StackTrace

android.app.RemoteServiceException$ForegroundServiceDidNotStartInTimeException: Context.startForegroundService() did not then call Service.startForeground(): ServiceRecord{b69350f u10 ac.mdiq.podcini/.playback.service.PlaybackService c:ac.mdiq.podcini}
	at android.app.ActivityThread.generateForegroundServiceDidNotStartInTimeException(ActivityThread.java:2211)
	at android.app.ActivityThread.throwRemoteServiceException(ActivityThread.java:2182)
	at android.app.ActivityThread.-$$Nest$mthrowRemoteServiceException(Unknown Source:0)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2477)
	at android.os.Handler.dispatchMessage(Handler.java:107)
	at android.os.Looper.loopOnce(Looper.java:232)
	at android.os.Looper.loop(Looper.java:317)
	at android.app.ActivityThread.main(ActivityThread.java:8532)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
	at com.android.internal.os.ExecInit.main(ExecInit.java:50)
	at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
	at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:359)
Caused by: android.app.StackTrace: Last startServiceCommon() call for this service was made here
	at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1985)
	at android.app.ContextImpl.startForegroundService(ContextImpl.java:1939)
	at android.content.ContextWrapper.startForegroundService(ContextWrapper.java:831)
	at android.content.ContextWrapper.startForegroundService(ContextWrapper.java:831)
	at androidx.core.content.ContextCompat$Api26Impl.startForegroundService(SourceFile:1189)
	at androidx.core.content.ContextCompat.startForegroundService(SourceFile:752)
	at ac.mdiq.podcini.receiver.MediaButtonReceiver.onReceive(SourceFile:33)
	at android.app.ActivityThread.handleReceiver(ActivityThread.java:4674)
	at android.app.ActivityThread.-$$Nest$mhandleReceiver(Unknown Source:0)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2364)
	... 9 more

@XilinJia
Copy link
Owner

XilinJia commented Jun 5, 2024

That's something different. has to do with a button press. could you describe the situation?

@XilinJia
Copy link
Owner

XilinJia commented Jun 5, 2024

This appears to be related to an open issue of Google's media3: androidx/media#167

It can happen somewhat like (is it similar in your case?):

When you play a media and then pause it and close the app the notification remains. If you click on play button (bluetooth), after a few seconds it will crash.

That has not been fixed in two years. Will investigate about possible workaround soon.

@rrd1
Copy link
Author

rrd1 commented Jun 5, 2024

I can't recall the situation for sure but could have been similar like that. It was with Bluetooth.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants