Encrypted SD Card causes empty Mediaplayer and Gallery data

REPRODUCIBILITY: always
OS VERSION: 5.2.0.17
HARDWARE: Jolla Phone 2026
UI LANGUAGE: german
REGRESSION:

DESCRIPTION:

Using an encrypted SD cards prevents the Mediaplayer and Gallery app from seeing anything.

PRECONDITIONS:

have some pictures and music on your device, insert an encrypted sd card into your device (which also has music and pictures)

STEPS TO REPRODUCE:

  1. have some pictures and music on the phone

  2. insert an encryted sd card (with music and pictures on it)

  3. open gallery or mediaplayer, and no pictures or music is shown (not from sd card nor from phone)

EXPECTED RESULT:

pictures and music from both phone and (unlocked and mounted) sd card are shown. If sd card isn’t unlocked/mounted at leadt te files from the phone itself should still be visible.

ACTUAL RESULT:

no media visible at all, even re-indexing via Sailfish utilities helps.

ADDITIONAL INFORMATION:

Thanks for filing a bug report so I don’t have to :smile:

I would like to add that I first started observing this behaviour after updating my XA2 to 5.1. If I remember correctly, in 5.1, the media indexer, tracker-3, was replaced by localsearch.

Contrary to your experience however, re-indexing the media library using Sailfish Utilities fixes it for me - that is, until the next boot.

I just tried more. Now even after a restart the existing media from phone is there but get’s lost with re-indexing.

Maybe I was to impatient, I’ll wait now for more than “just” an hour if something appears again.

The music collection on my encrypted sd card consists of ~16.000 songs. On top of that, album art and roughly 3.000 pictures. Indexing takes about 2 or 3 hours on my Jolla Phone (an entire day on my XA2).

Okay, I needed to wait longer, now it’s there. So indexing takes a very long time. Remaining question is how it bevaves with a restart. Is indexing running in the background when a new starege device is mounted?

Could this have something to do with the fact that an encrypted sd card cannot be mounted automatically (at least not by default), therefore the localsearch indexer skips over it? I’m guessing that restarting the indexer after the card is mounted might fix the issue.

FWIW, once the filesystem is mounted the system doesn’t care if it was encrypted or not.

There are some other strange things related to encryption. ImgOrganizer doesn’t work at all when I have the card inside and mounted. If I take the card out it’s working again.

I also connect my phone via usb-c in my car and listen to music from my phone often. So phone is connected as storage, but the connection crashes after roundabout a minute and can just be reestablished with pulling the cable out and put it in again. I never had such on Xperia 10 II (witch unencrypted card) and will try now again on Jolla Phone without the encrypted sd card.

To my mind an encrypted sd card should be unlocked and auto-mounted along with the phone startup.

I also dislike that there is the unlock and formatting option and fear that som day I will accidentally tap the wrong entry when trying to unlock…

Having the same issues with an encrypted sd card. No more images and videos in the gallery app after some time, because the whole sd card becomes unreadable or vanished completely from the settings. It also does not show up in lsblk anymore (encrypted vfat). Same card works flawlessly unencrypted (ext4).

I’m pretty sure that is not the same issue.

Did some additional testing today.
After rebooting the phone and mounting the encrypted sd card, gallery and media player only showed the handful of files that reside on my phone. Went ahead and killed the current tracker process:

[defaultuser@JollaPhone2026 ~]$ ps | grep localsearch | grep -v grep
 4728 defaultu /usr/libexec/localsearch-3
[defaultuser@JollaPhone2026 ~]$ kill 4728

Waited for the tracker process to automatically restart and - lo and behold - all files from the encrypted card became visible again almost immediately.
Until this bug gets fixed, I can live with this workaround.

@Cryx: could you please check if this works for you too?

I did that one with success at least for music as far as I remember with a regular re-indexing. I’ll try tomorrow…

For ImgOrganizer there must have been another bug, after I deleted the folder from sources in the settings and and added it again it works without problems und survives a phone restart (but of course still needs the mounted sd card).

So, tested right now, doesn’t work. I searched for the process and used kill command, and a little bit later I could watch mediaplayer countng through the tracks. Nevertheless after it was done I ended up with exactly the same amount of tracks and pictures…

That sounds like you were expecting the tracker to re-index your encrypted card after it had been forcefully respawned. That was not what my posting regarding the workaround was about. As I pointed out earlier, a full index scan of my card takes several hours, based on the number media files stored there.

My observation was that an existing index of both the internal media and the files on the sd card is not being used by both mediaplayer and gallery after a reboot. This can be verified by e.g. querying the data base (localsearch search <some-media-located-on-external-sd-card>).
Presumably, the initial tracker process holds some lock that prevents both applications from accessing the data base. Restarting the process releases the lock, that’s why the media on the phone and the card became available almost instantly.

I’ll give it another try. I made a complete new index woth unlocked and mounted SD card today and can see everything. So the steps to compare would be:

  • reboot
  • look in gallery/mediaplayer - SD files missing
  • run the commands
  • look again - SD files visible?

But if its not used, how do gallery and mediaplayer fimd the files on the phone?

Exactly

Frankly, I have no idea. I leave it up to jolla’s devs to find out :wink:

Good luck!

Bingo, worked now. First I looked into gallery, nothing there and closed the app, then looked into music with mediaplayer were everything was listed, look into gallery and also everything was visible.

Maybe I had an index before that didn’t include the sd card files when I tried it this morning.