maxrave-dev / maxrave-dev/SimpMusic

Massively slows down Windows (since pre-1.7.0) and crashes (since 1.7.0) on every run after a few minutes

Open
#2,357 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Kotlin
Stars
11.4k
Forks
599
Avg merge
3d 18h
Merged PRs (30d)
7

Description

Duplicate Check
  • I confirm I searched for existing reports and found no duplicates.
Describe the Bug

Even in the previous 1.6.0 version, running SimpMusic would slow my pc down to a crawl (for reference, my pc can run a very heavily-modded Baldur's Gate 3 with zero issues), but it wouldn't crash or give out any errors so I could still leave it running in the background while doing other general non-intensive tasks (i.e., browsing/checking emails/editing word docs/etc. worked fine, but anything more intensive like opening any webpages with multiple running videos such as some news sites and weather forecasting sites would cause the browser to start lagging if SimpMusic was running). However, starting with this latest 1.7.0 version, it now also consistently crashes every time. It still slows down my pc just as much as before, but now it also eventually spits out the following error log while still running (and still slowing down my pc even after giving out this error):

java.io.IOException: Unable to rename C:\Users\joard\.simpmusic\settings.preferences_pb.tmp to C:\Users\joard\.simpmusic\settings.preferences_pb. This likely means that there are multiple instances of DataStore for this file. Ensure that you are only creating a single instance of datastore for this file.
	at androidx.datastore.a.r.a(FileStorage.kt)
	at androidx.datastore.a.k.a(DataStoreImpl.kt)
	at androidx.datastore.a.k$r.invokeSuspend(DataStoreImpl.kt)
	at androidx.datastore.a.k$r.a(DataStoreImpl.kt)
	at androidx.datastore.a.k$r.invoke(DataStoreImpl.kt)
	at androidx.datastore.a.G.a(SingleProcessCoordinator.kt)
	at androidx.datastore.a.k.a(DataStoreImpl.kt)
	at androidx.datastore.a.k.a(DataStoreImpl.kt)
	at androidx.datastore.a.k$g.invokeSuspend(DataStoreImpl.kt)
	at androidx.datastore.a.k$g.a(DataStoreImpl.kt)
	at androidx.datastore.a.k$g.invoke(DataStoreImpl.kt)
	at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatched(Undispatched.kt)
	at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt)
	at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt)
	at kotlinx.coroutines.BuildersKt.withContext(Unknown Source)
	at androidx.datastore.a.k.a(DataStoreImpl.kt)
	at androidx.datastore.a.k.a(DataStoreImpl.kt)
	at androidx.datastore.a.k$t.invokeSuspend(DataStoreImpl.kt)
	at androidx.datastore.a.k$t.a(DataStoreImpl.kt)
	at androidx.datastore.a.k$t.invoke(DataStoreImpl.kt)
	at androidx.datastore.a.F$a.invokeSuspend(SimpleActor.kt)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt)
	at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt)
	at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt)
	Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@64708529, java.util.concurrent.Executors$AutoShutdownDelegatedExecutorService@86be810]

If I click the close button inside the error log window or even just close the error log window pop-up from the cross on the top right corner, it then closes SimpMusic completely and my pc goes back to a fast speed. If I leave the pop-up error log window open then the music keeps playing and SimpMusic stays working, but my pc also stays slowed down same as pre-1.7.0 (except now with an error pop-up window also having to be kept open all the time).

To try to solve this, I first checked whether I had write permissions for both the settings.preferences_pb file and the .simpmusic folder that it was in (I had it for both), then tried manually duplicating a copy of the file into the same folder and adding the .tmp extension at the end myself before starting SimpMusic, which caused my duplicated settings.preferences_pb.tmp file to just be deleted/subsumed at app startup but didn't fix the issue. So then, I tried uninstalling SimpMusic and deleting all related folders (like the .simpmusic folder that has the settings.preferences_pb file) and restarting my pc and then reinstalling and manually reconfiguring SimpMusic from a fresh download. When still none of that helped, I then tried asking Claude and it gave me the following instructions:

  1. Rule out a genuine second instance running, since that's literally what the message is pointing at. Check Task Manager's Details tab for more than one SimpMusic process, end any extras, close it fully, then relaunch just once. Worth checking whether it's also set to launch at Windows startup, since that's an easy way to end up with two copies without noticing.
  2. Add both the app's install folder and C:\Users\joard.simpmusic to your antivirus exclusions, Windows Defender included. Real-time scanning grabbing a freshly written temp file for a split second is one of the most common causes of exactly this kind of rename failure, and excluding a settings folder is low risk.
  3. Make sure that .simpmusic folder isn't quietly caught up in OneDrive or another sync tool. Dot-prefixed folders aren't hidden by convention on Windows the way they are on Mac or Linux, so a "back up my whole user folder" setting can sweep it in and briefly lock files mid-sync.
  4. Check Windows Search's Indexing Options and exclude that folder too, for the same reason, it's another quiet source of momentary locks.

I tried all four of these (plus a final pc restart) and none of it worked either, at which point I checked whether I had any pending Windows updates left (I did not, I was fully up to date) and checked my Windows update history for whether there had been any updates during this relevant period that could have broken something, and there were only some .NET Security Updates and some Security Intelligence Updates for Microsoft Defender Antivirus, and I'm guessing that neither of these are likely to matter regarding this issue.

At this point I was fully stumped, and thought to myself that, even if I could eventually find some way to prevent or hide the error log pop-up on my end, that still wouldn't solve the massive slow-down issue that has been happening since pre-1.7.0 before this new error/crashing problem with the settings.preferences_pb file, so with that in mind, I decided to come here to inform y'all about all of this so that the root issues could hopefully be addressed instead.

I would be very grateful if you could fix this crashing issue with this latest version, but I would also really appreciate it if anything could be done about the crazy slow-down that SimpMusic has been causing for me since even before this recent 1.7.0 release as well. I might only have a mid-tier machine, but my pc (16GB RAM + SSD + 40GB Virtual Memory) can still run a Skyrim build with a massive modlist including several resource-intensive graphical and texture overhaul mods without any issues, so if even my pc is being slowed down so much, I think the app might be almost unusable on many budget Windows machines. Though of course there is always the possibility that this slow-down is because of some sort of incompatibility with some specific component in only my pc rather than being a general Windows optimization issue. I should also note that this slow-down has never happened while running SimpMusic on my android phone (which has vastly lower specs than my Windows pc in all aspects).

Regardless of all this, SimpMusic still is the only Open Source app that I have found that contains literally all of the features that I want (and even some that I did not know I needed until I used them), so I do truly appreciate both the massive amount of effort and the many thoughtful design choices that it took to create this great app, and am also very grateful that it continues to be improved and worked on so actively. My thanks as well for taking the time to read this long bug report, and I hope that you have an absolutely wonderful day ahead! : )

Steps to Reproduce
  1. Open SimpMusic app on a Windows 11 pc.
  2. Wait for a little bit while keeping the music running in the app; does not matter whether the app is opened in the foreground or in the background inside the tray. (Note: This can take anywhere from a few minutes up to about an hour or so.)
  3. SimpMusic will give an error pop-up window (while still continuing to play music) with the crash log as described in the bug description text.
Expected Behavior

I expect SimpMusic to neither crash nor massively slow down my Windows pc, just like how it works on my Android phone.

App Version

1.7.0 (crash + slow-down) and 1.6.0 (only slow-down)

Android Version

Windows 11

Device Model

PC

Custom ROM
  • I am using a custom ROM
Custom ROM Name (if applicable)

No response

Screenshots (optional)

No response

Log / Error Details

java.io.IOException: Unable to rename C:\Users\joard.simpmusic\settings.preferences_pb.tmp to C:\Users\joard.simpmusic\settings.preferences_pb. This likely means that there are multiple instances of DataStore for this file. Ensure that you are only creating a single instance of datastore for this file.
at androidx.datastore.a.r.a(FileStorage.kt)
at androidx.datastore.a.k.a(DataStoreImpl.kt)
at androidx.datastore.a.k$r.invokeSuspend(DataStoreImpl.kt)
at androidx.datastore.a.k$r.a(DataStoreImpl.kt)
at androidx.datastore.a.k$r.invoke(DataStoreImpl.kt)
at androidx.datastore.a.G.a(SingleProcessCoordinator.kt)
at androidx.datastore.a.k.a(DataStoreImpl.kt)
at androidx.datastore.a.k.a(DataStoreImpl.kt)
at androidx.datastore.a.k$g.invokeSuspend(DataStoreImpl.kt)
at androidx.datastore.a.k$g.a(DataStoreImpl.kt)
at androidx.datastore.a.k$g.invoke(DataStoreImpl.kt)
at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatched(Undispatched.kt)
at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt)
at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt)
at kotlinx.coroutines.BuildersKt.withContext(Unknown Source)
at androidx.datastore.a.k.a(DataStoreImpl.kt)
at androidx.datastore.a.k.a(DataStoreImpl.kt)
at androidx.datastore.a.k$t.invokeSuspend(DataStoreImpl.kt)
at androidx.datastore.a.k$t.a(DataStoreImpl.kt)
at androidx.datastore.a.k$t.invoke(DataStoreImpl.kt)
at androidx.datastore.a.F$a.invokeSuspend(SimpleActor.kt)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt)
at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt)
Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@64708529, java.util.concurrent.Executors$AutoShutdownDelegatedExecutorService@86be810]

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue on Windows 11 using the reported steps, then trace the code that creates or accesses C:\Users\joard.simpmusic\settings.preferences_pb and its temporary file. Use the DataStore rename error and the reported slowdown as the initial symptoms to investigate. Done means repeated playback causes neither the error pop-up or crash nor the severe system slowdown.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
desktop, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.