Missing write permission for external sd card in version 12?

Issue description:

With the update to version 12 it seems like Symfonium no longer have write permission for the external sd card, for writing cached files. Downloading files to the cache (“Manage offline files”- > “Download queue”) results in an error message “Waiting before retry - close failed: EPERM (Operation not permitted)”, after a while it changes to “Error - HTTP error: 416 - Requested Range Not Satisfiable”, but I think the 416 is not the main issue. The 416 can be seen on the server side (Navidrome), but no other errors.

Downloading cover art doesn’t work either, albums added after updating Symfonium only shows the fallback image.

The issues started with the update to version 12.

Symfonium: 12.0.0 (127338)
Navidrome: 0.54.5 (287079a9)
Android: 13

Some logs:

02-24 17:24:45.836  4523  5994 I MediaProvider: Deleted 0 0 0 0 0 0 0 items on 1714-95bc due to app.symfonik.music.player
02-24 17:24:45.838 29749 29782 E ImageCacheManager: Error writing cache: ImageRequest(imagePath=ImagePath(file=null, url=https://<redacted>/music/rest/getCoverArt.view?id=mf-dfb9182c49510663750e58fe79d84f58_67b9a36c&u=REDACTED&t=REDACTED&s=REDACTED&v=1.13.0&c=Symfonium&f=json, shouldCache=true, providerId=null, headers=[]), cachedOnly=false, keepTransparency=false, exactSize=null, size=null, crossFade=false, debugTag=null, sourceOnline=true)
02-24 17:24:45.838 29749 29782 E ImageCacheManager: java.io.IOException: close failed: EPERM (Operation not permitted)
02-24 17:24:45.838 29749 29782 E ImageCacheManager: 	at libcore.io.IoBridge.closeAndSignalBlockedThreads(IoBridge.java:313)
02-24 17:24:45.838 29749 29782 E ImageCacheManager: 	at java.io.FileOutputStream.close(FileOutputStream.java:482)
02-24 17:24:45.838 29749 29782 E ImageCacheManager: 	at d20.b0.close(Unknown Source:2)
02-24 17:24:45.838 29749 29782 E ImageCacheManager: 	at d20.f0.close(Unknown Source:22)
02-24 17:24:45.838 29749 29782 E ImageCacheManager: 	at d20.e0.close(Unknown Source:2)
02-24 17:24:45.838 29749 29782 E ImageCacheManager: 	at k8.m.b(Unknown Source:1218)
02-24 17:24:45.838 29749 29782 E ImageCacheManager: 	at k8.d.s(Unknown Source:12)
02-24 17:24:45.838 29749 29782 E ImageCacheManager: 	at iz.a.j(Unknown Source:5)
02-24 17:24:45.838 29749 29782 E ImageCacheManager: 	at i00.f0.run(Unknown Source:106)
02-24 17:24:45.838 29749 29782 E ImageCacheManager: 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
02-24 17:24:45.838 29749 29782 E ImageCacheManager: 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
02-24 17:24:45.838 29749 29782 E ImageCacheManager: 	at java.lang.Thread.run(Thread.java:1012)
02-24 17:24:45.838 29749 29782 E ImageCacheManager: Caused by: android.system.ErrnoException: close failed: EPERM (Operation not permitted)
02-24 17:24:45.838 29749 29782 E ImageCacheManager: 	at libcore.io.Linux.close(Native Method)
02-24 17:24:45.838 29749 29782 E ImageCacheManager: 	at libcore.io.ForwardingOs.close(ForwardingOs.java:176)
02-24 17:24:45.838 29749 29782 E ImageCacheManager: 	at libcore.io.BlockGuardOs.close(BlockGuardOs.java:113)
02-24 17:24:45.838 29749 29782 E ImageCacheManager: 	at libcore.io.ForwardingOs.close(ForwardingOs.java:176)
02-24 17:24:45.838 29749 29782 E ImageCacheManager: 	at libcore.io.IoBridge.closeAndSignalBlockedThreads(IoBridge.java:311)
02-24 17:24:45.838 29749 29782 E ImageCacheManager: 	... 11 more
...
02-24 17:25:23.104 29749 29785 E DownloaderService: Error downloading
02-24 17:25:23.104 29749 29785 E DownloaderService: java.io.IOException: close failed: EPERM (Operation not permitted)
02-24 17:25:23.104 29749 29785 E DownloaderService: 	at libcore.io.IoBridge.closeAndSignalBlockedThreads(IoBridge.java:313)
02-24 17:25:23.104 29749 29785 E DownloaderService: 	at java.io.FileOutputStream.close(FileOutputStream.java:482)
02-24 17:25:23.104 29749 29785 E DownloaderService: 	at d20.b0.close(Unknown Source:2)
02-24 17:25:23.104 29749 29785 E DownloaderService: 	at d20.f0.close(Unknown Source:22)
02-24 17:25:23.104 29749 29785 E DownloaderService: 	at app.symfonik.core.download.DownloaderService.a(Unknown Source:4346)
02-24 17:25:23.104 29749 29785 E DownloaderService: 	at d8.c1.s(Unknown Source:14)
02-24 17:25:23.104 29749 29785 E DownloaderService: 	at iz.a.j(Unknown Source:5)
02-24 17:25:23.104 29749 29785 E DownloaderService: 	at i00.f0.run(Unknown Source:106)
02-24 17:25:23.104 29749 29785 E DownloaderService: 	at du.o.run(Unknown Source:1402)
02-24 17:25:23.104 29749 29785 E DownloaderService: 	at p00.i.run(Unknown Source:2)
02-24 17:25:23.104 29749 29785 E DownloaderService: 	at p00.a.run(Unknown Source:88)
02-24 17:25:23.104 29749 29785 E DownloaderService: Caused by: android.system.ErrnoException: close failed: EPERM (Operation not permitted)
02-24 17:25:23.104 29749 29785 E DownloaderService: 	at libcore.io.Linux.close(Native Method)
02-24 17:25:23.104 29749 29785 E DownloaderService: 	at libcore.io.ForwardingOs.close(ForwardingOs.java:176)
02-24 17:25:23.104 29749 29785 E DownloaderService: 	at libcore.io.BlockGuardOs.close(BlockGuardOs.java:113)
02-24 17:25:23.104 29749 29785 E DownloaderService: 	at libcore.io.ForwardingOs.close(ForwardingOs.java:176)
02-24 17:25:23.104 29749 29785 E DownloaderService: 	at libcore.io.IoBridge.closeAndSignalBlockedThreads(IoBridge.java:311)
02-24 17:25:23.104 29749 29785 E DownloaderService: 	... 10 more
02-24 17:25:23.245  2598  2706 D LocalImageResolver: Couldn't use ImageDecoder for drawable, falling back to non-resized load.
02-24 17:25:23.246  2598  2706 D LocalImageResolver: Couldn't use ImageDecoder for drawable, falling back to non-resized load.

Logs:

Upload description: meldo

Additional information:

 

 

Reproduction steps:

 

 

Media provider:

Subsonic

Screenshots:

     

Reboot your phone or reinstall the app if it keeps doing that.
The app does not need permission and have no control over the OS doing that.

Thanks for your answer. I’ve tried rebooting and reinstalling a couple of times now, in various orders. No luck unfortunately but I’ll continue to see if I can make it work somehow.

Are older versions of Symfonium available in some official way?

An older version would not change anything for this kind of issue.

Do you restore the settings ? Have you tried to repair the sdcard to ensure no issue on it? Delete the /Android/data/app.symfonik.music.player folder if it’s still there after uninstall (it should not)

So I’ve tested a bit more, I think my theory about write permission is not correct.

When trying to download a file to the cache, it’s actually created on the sdcard (during downloading):

XQ-BQ52:/storage/1714-95BC/Android/data/app.symfonik.music.player $ ls files/OfflineMedias/7/ -l
total 20480
-rwxrwx--- 1 media_rw media_rw 20946849 2025-02-24 21:52 7490DDF35CE1A56356CEDBA6581DA902.mp3.part
X

But then after a while, roughly when the 416 error is shown, the file is removed.

To me, it seems like the file is downloaded completely, 20946849 is the correct size for the file in question, but then the rename/move to the correct filename fails (probably due to the EPERM error?), then it tries to resume which fails for some reason (probably due to my setup of Navidrome?) and then the file is deleted.

I can see that also images are created temporary before disappearing:

XQ-BQ52:/storage/1714-95BC/Android/data/app.symfonik.music.player $ ls cache/images/7/
701D8E645A85A77F27A27C55362E70CB.jpg.lock

I guess the 416 is something on my side, but any suggestion on the rename issue (if my thesis is correct…), or any other ideas on what’s going on?

Not really those are OS level issues, only idea as said is to fully remove that folder from the SDCard.

Yeah, it seems like a general problem, I can see the same behavior when trying to download maps in OsmAnd to the external sdcard, the files are created when downloading but then renaming it to the final name fails (EPERM there too). But doing the same with Organic Maps works for some reason.

I think it’s due to me turning on encryption on the sdcard some time ago. Apparently, I haven’t added any new music since then so I didn’t notice the problem in Symfonium and didn’t make the connection (I found out by newly added music lacked cover art). Removing the app directory doesn’t help. Also tried the previous version of Symfonium, same issue there.

So it’s probably something related to switching on encryption in Android 13/my specific phone model/my specific setup…

I guess this can be closed then, I’ll try to figure out the cause of it on my side. Thank you for your input and for a great application!

had the same issue. android 13.
i dont have encryption for sd cards.

solved with a backup, uninstall, then restore

restore for some reason did not work at first, but then i tried to restore each setting separate (first media, them settings)