Images not cached for offline use

Issue description:

I have cached my entire collection on my phone, but when the server is unreachable for any reason (e.g. I’m not on my home WiFi) the album art images are not available. The music is available, so I can scroll through lists, select albums & tracks, play them, etc., but the images don’t show up. They’re not displayed in lists, album view, or the now-playing screen. A few images seem to be cached from the last time I was online, but only a very small number.

Logs: (1.3 KB)


Additional information:

I’m using an Airsonic server, version 11.0.0-SNAPSHOT.20220625052932

That log looks pretty sparse, just a dozen or so DB queries, let me know if I need to capture a longer session.

The logs is effectively nearly empty you need to use the app and scroll / do things to reproduce image loading.
Image are cached when you see them, to auto cache all the images you need to enable the option on your provider settings.

99% of the time missing images are caused by “optimizer” tools that clear other apps cache directory.

I previously did some scrolling, but clearly not enough. Here’s a new logfile that’s got a lot of activity, including many image fetch attempts. Here’s what I did:

  • Started a sync
  • Turned on debug
  • Waited until sync was done
  • Scrolled thru Recent Albums
  • Turned on Airplane Mode
  • Scrolled thru Random Albums
  • Turned off Airplane Mode
  • Scrolled thru Last Played Albums (but it took ~10s for WiFi to re-connect, so the initial part of this was still disconnected)
  • Turned off debug

In my provider settings I have Automatic image cache, Automatic media offline cache and Compatiblity mode turned on. Looking in Android/data/ there are 19,251 files for 149.8 GB; looks like that’s all *.mp3. In Android/data/ there are 1002 files for 94.5 MB, all *.jpg` (I’ve got ~2500 albums, so that’s not enough images to cover all of them).

Here’s the log: (1.4 MB)

Image caching is done asynchronously after the sync is done. So if you cut wifi too fast the images are not yet cached.

2023-04-15 12:52:31.970 Error/ImageCacheManager: Error downloading image: Failed to connect to /
2023-04-15 12:52:31.972 Error/ImageCacheManager: Error downloading image: Failed to connect to /
2023-04-15 12:52:31.976 Error/ImageCacheManager: Error downloading image: Failed to connect to /

OK, this time I did a sync, waited almost three hours during which time the phone was continuously on WiFi. I also listened to music, and scrolled down the Recent Albums list.
Then I:

  • Turned on debug
  • Scrolled Random Albums
  • Turned on Airplane Mode
  • Scrolled Rediscover Albums (No images displayed)
  • Scrolled Random until I got down past where I’d scrolled to a minute ago, and no more images showed up.
  • Turned off debug (5.3 KB)

Logs shows that the app tries to download again so something removes them.

As said earlier you have probably an optimizer tool app that clear Symfonium cache folder. Or there automatic offline cache is not enabled for bug for you.

Is the image cache folder larger than last time?

I checked, and the image cache was at 576 files. I suspect that either:

  • The provider image cache setting wasn’t actually on (despite the toggle showing it on)
  • Symfonium isn’t proactively downloading & caching the images, but only loading them as they’re needed (e.g. when scrolling)

More experimentation:

I turned off the image & media cache settings for the provider, hit “update”, then turned them back on. The I spent four or five minutes slowly scrolling through all 2800+ albums, and then the cache was at 2936 files.

I don’t (knowingly) have any cache-clearing SW. I dug through system settings and didn’t find anything suspicious.

I ran various other apps for a while to generate some cache pressure on the phone. I closed Symfonium and flicked it away in the app-switcher. Ran some more apps. Toggled Airplane Mode a few times. Still 2936 files.

Previously it was at 1002 so something deleted the images.

ImageRequest(imagePath=ImagePath(file=null, url=, shouldCache=true), cachedOnly=false, keepTransparency=false, exactSize=null, size=null, crossFade=false, debugTag=autooffline, sourceOnline=true)

From your previous logs.

As you can see debugTag=autooffline so at least at that time it was enabled and working.

Unfortunately you do not have the logs that contains the full sync. Are you sure your wifi stays on when screen is off?

So just got another report seems Google fucked up something on some recent update again for some users …

Go to Symfonium in Android settings and un-check the option
Pause app activity if unused.

Seems it runs very frequently and not when supposed to …

I guess I’ll need to add an option to store the image cache as files to avoid OS bugs and optimizer apps :frowning:

Edit: So just updated to the April patch and image cache was cleared by the OS … Fuck Google …

FYI: Samsung OneUI 5.0 / Android 13 does not yet have this option (only remove app permissions, and that is only triggered after quite some time without usage).

I’m glad there’s some resolution to this. I’ve switched to keeping my music as local files on the phone, so the issue won’t affect me any more. I wanted to get the bug reported before i switched.

I made the switch because I realized the only reason I was running an AirSonic server and dealing with all of its foibles was to get my music to the phone, and I could do a better job of that with Syncthing. Now I don’t have to worry about AirSonic imposing its ideas about album structure, genres, and the like.

As shown in the previous screenshots this is not a Symfonium bug, this is an OS bug.

The “fix” is that I’ll add an option to store the images in the same folder as the offline files so it’s not deleted when OS wrongly decide that app cache should be cleared.

Anyway yes local parser from Symfonium when using SAF mode is a lot more powerful that what the current Subsonic API support. But you need proper tags and Symfonium has no vocation of being a tag editor.

Part of my issue is that I have carefully curated my tags, and then Airsonic goes and imposes its own half-baked ideas.

Storing the cached images as files seems like a good idea.

Thanks for helping me track this down.