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

Crash on playing music #957

Open
4 tasks done
foss- opened this issue Jan 11, 2025 · 13 comments
Open
4 tasks done

Crash on playing music #957

foss- opened this issue Jan 11, 2025 · 13 comments
Assignees
Labels
bug Something isn't working playback Related to music playback

Comments

@foss-
Copy link

foss- commented Jan 11, 2025

Describe the Bug/Crash

Auxio 4.0.0-dev3
Is this #825 all over?

Reproducible by tapping shuffle button on large library.

Describe the intended behavior

Should not crash.

What android version do you use?

Android 13

What device model do you use?

Xiaomi lisa
ArrowOS 13.1

Provide a sample file

N/A

Bug report

android.app.ForegroundServiceStartNotAllowedException: Service.startForeground() not allowed due to mAllowStartForeground false: service org.oxycblt.auxio/.AuxioService
	at android.app.ForegroundServiceStartNotAllowedException$1.createFromParcel(ForegroundServiceStartNotAllowedException.java:54)
	at android.app.ForegroundServiceStartNotAllowedException$1.createFromParcel(ForegroundServiceStartNotAllowedException.java:50)
	at android.os.Parcel.readParcelableInternal(Parcel.java:4816)
	at android.os.Parcel.readParcelable(Parcel.java:4778)
	at android.os.Parcel.createExceptionOrNull(Parcel.java:3006)
	at android.os.Parcel.createException(Parcel.java:2995)
	at android.os.Parcel.readException(Parcel.java:2978)
	at android.os.Parcel.readException(Parcel.java:2920)
	at android.app.IActivityManager$Stub$Proxy.setServiceForeground(IActivityManager.java:6114)
	at android.app.Service.startForeground(Service.java:743)
	at org.oxycblt.auxio.AuxioService$$ExternalSyntheticLambda0.invoke(SourceFile:388)
	at org.oxycblt.auxio.AuxioService.updateForeground(SourceFile:202)
	at org.oxycblt.auxio.music.service.IndexingHolder.onIndexingStateChanged(SourceFile:5)
	at org.oxycblt.auxio.music.MusicRepositoryImpl.access$emitIndexingProgress(SourceFile:97)
	at org.oxycblt.auxio.music.MusicRepositoryImpl$emitIndexingProgress$1.invokeSuspend(Unknown Source:12)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(SourceFile:9)
	at kotlinx.coroutines.DispatchedTask.run(SourceFile:109)
	at androidx.core.app.ActivityRecreator$1.run(SourceFile:36)
	at kotlinx.coroutines.scheduling.TaskImpl.run(SourceFile:3)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(SourceFile:93)
	Suppressed: android.app.ForegroundServiceStartNotAllowedException: Service.startForeground() not allowed due to mAllowStartForeground false: service org.oxycblt.auxio/.AuxioService
		... 20 more

Duplicates

@foss- foss- added the bug Something isn't working label Jan 11, 2025
@OxygenCobalt
Copy link
Owner

I'm literally doing nothing wrong now. I'm just going to artifically delay the service launch by a couple hundred milliseconds to work around whatever is race condition is causing this.

@OxygenCobalt
Copy link
Owner

OxygenCobalt commented Jan 14, 2025

Try 4.0.0-dev4 @foss-?

@foss-
Copy link
Author

foss- commented Jan 14, 2025

App still crashes but gives no crash log when re-opened. This happens sometimes on first song after tapping shuffle, sometimes first song plays time and a second tap on shuffle is needed. App becomes unresponsive for a brief moment then closes and users is on home screen.

@OxygenCobalt
Copy link
Owner

Wait, this is two distinct issues.

  1. A crash occurring on playback
  2. The annoying fussy foreground problem that I keep having to accomodate and is likely unfixable since android is really poorly designed

I need a crash report for #1. @foss- can you reproduce the issue and then take a bug report?

@OxygenCobalt OxygenCobalt changed the title crash when using shuffle and after birefly playing music Crash on playing music Jan 15, 2025
@OxygenCobalt OxygenCobalt added the playback Related to music playback label Jan 15, 2025
@foss-
Copy link
Author

foss- commented Jan 16, 2025

The bug report contains too much info. Is this logcat info sufficient? It was created right after auxio crashes after tapping shuffle.

In this case no audio ever played.

1 month: https://bin.disroot.org/?bd13202f37cb43fa#5osTFqr5XvQRots15gnhMPwQFsxDa6DkFQbZgQ6mbSS3

@OxygenCobalt
Copy link
Owner

Out of memory crash, need to figure out what's going on @foss-

@OxygenCobalt
Copy link
Owner

Okay, turns out Musikr's native code is full of memory leaks. It probably is an OOM on your library. Will fix.

@OxygenCobalt
Copy link
Owner

Try this @foss-?

Auxio_Canary.zip

@foss-
Copy link
Author

foss- commented Jan 19, 2025

Tapping shuffle results in message Auxio Debug isn't responding after a few seconds.

android.app.ForegroundServiceStartNotAllowedException: Service.startForeground() not allowed due to mAllowStartForeground false: service org.oxycblt.auxio.debug/org.oxycblt.auxio.AuxioService
	at android.app.ForegroundServiceStartNotAllowedException$1.createFromParcel(ForegroundServiceStartNotAllowedException.java:54)
	at android.app.ForegroundServiceStartNotAllowedException$1.createFromParcel(ForegroundServiceStartNotAllowedException.java:50)
	at android.os.Parcel.readParcelableInternal(Parcel.java:4816)
	at android.os.Parcel.readParcelable(Parcel.java:4778)
	at android.os.Parcel.createExceptionOrNull(Parcel.java:3006)
	at android.os.Parcel.createException(Parcel.java:2995)
	at android.os.Parcel.readException(Parcel.java:2978)
	at android.os.Parcel.readException(Parcel.java:2920)
	at android.app.IActivityManager$Stub$Proxy.setServiceForeground(IActivityManager.java:6114)
	at android.app.Service.startForeground(Service.java:743)
	at org.oxycblt.auxio.AuxioService.updateForeground$lambda$2(AuxioService.kt:159)
	at org.oxycblt.auxio.AuxioService.$r8$lambda$8zoHeh9zw9kcW0pXXX3N05EG1ng(Unknown Source:0)
	at org.oxycblt.auxio.AuxioService$$ExternalSyntheticLambda0.invoke(D8$$SyntheticClass:0)
	at org.oxycblt.auxio.music.service.IndexingHolder.createNotification(IndexingHolder.kt:123)
	at org.oxycblt.auxio.music.service.MusicServiceFragment.createNotification(MusicServiceFragment.kt:100)
	at org.oxycblt.auxio.AuxioService.updateForeground(AuxioService.kt:157)
	at org.oxycblt.auxio.music.service.IndexingHolder.onIndexingStateChanged(IndexingHolder.kt:144)
	at org.oxycblt.auxio.music.MusicRepositoryImpl.emitIndexingProgress(MusicRepository.kt:415)
	at org.oxycblt.auxio.music.MusicRepositoryImpl.access$emitIndexingProgress(MusicRepository.kt:235)
	at org.oxycblt.auxio.music.MusicRepositoryImpl$emitIndexingProgress$1.invokeSuspend(Unknown Source:15)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:101)
	at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:113)
	at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:89)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:589)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:823)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:720)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:707)
	Suppressed: android.app.ForegroundServiceStartNotAllowedException: Service.startForeground() not allowed due to mAllowStartForeground false: service org.oxycblt.auxio.debug/org.oxycblt.auxio.AuxioService
		... 28 more

When tapping a song to play app crashes and closes.

@OxygenCobalt
Copy link
Owner

That error you provided is a music loading error, you need to take another logcat on the song playback crash @foss-.

@foss-
Copy link
Author

foss- commented Jan 21, 2025

Does this logcat inlcude the information you are looking for?

1 month: https://bin.disroot.org/?e7a19007948e4331#2fKogXwUu3UyLdCAguwdjvkYju1Hn11X6tNrHSwVBcUG

@OxygenCobalt
Copy link
Owner

Does this logcat inlcude the information you are looking for?

1 month: https://bin.disroot.org/?e7a19007948e4331#2fKogXwUu3UyLdCAguwdjvkYju1Hn11X6tNrHSwVBcUG

Yeah, apparently at some point I turn an internal object into a string, which results in a... 16mb allocation that instantly knocks out the VM.

Might need to audit some accidental printf debugging I left in the app, give me a moment @foss-

Thanks for stresstesting too, I dont have a big library so you and e-zk's libs are basically my only way of knowing if I broke those or not

@OxygenCobalt
Copy link
Owner

Here's a new APK @foss-. This removes the debug log that allocated too much memory and crashed the app, but I'm partially concerned that your phone also has a strangely low memory limit and could be GC'ing constantly during playback (causing the unresponsiveness). In this case, I need to deep dive on what's changing memory-wise between versions.

Auxio_Canary.zip

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

No branches or pull requests

2 participants