Crash after scanning folders by the media library

VLC for Android and Chrome OS specific usage questions
Lulu5239
New Cone
New Cone
Posts: 6
Joined: 06 Feb 2025 17:51
Operating System: Android
Contact:

Crash after scanning folders by the media library

Postby Lulu5239 » 06 Feb 2025 18:16

In the "Media library folders" feature, after selecting any folder of the internal storage of my phone, the app does a sort of inner-crash (closing the folders list and going back to the settings) that sometimes causes my phone to notice that VLC frequently crash. If I select a folder on my SD card, there is a notification about the media library loading, but the loading seems to never end.
I had that issue for multiple months, maybe I've done weird enough things but I forgot.

I've found where VLC stores its crash logs and found:

Code: Select all

App version: 3.6.3 java.lang.UnsatisfiedLinkError: No implementation found for void org.videolan.medialibrary.MedialibraryImpl.nativeAddDevice(java.lang.String, java.lang.String, boolean) (tried Java_org_videolan_medialibrary_MedialibraryImpl_nativeAddDevice and Java_org_videolan_medialibrary_MedialibraryImpl_nativeAddDevice__Ljava_lang_String_2Ljava_lang_String_2Z) - is the library loaded, e.g. System.loadLibrary? at org.videolan.medialibrary.MedialibraryImpl.nativeAddDevice(Native Method) at org.videolan.medialibrary.MedialibraryImpl.addDevice(MedialibraryImpl.java:139) at org.videolan.vlc.MediaParsingService.addDeviceIfNeeded(MediaParsingService.kt:242) at org.videolan.vlc.MediaParsingService.processAction(MediaParsingService.kt:496) at org.videolan.vlc.MediaParsingService.access$processAction(MediaParsingService.kt:68) at org.videolan.vlc.MediaParsingService$processAction$1.invokeSuspend(Unknown Source:14) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:115) at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:100) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684) at Android.MODEL(SM-A336B) at Android.VERSION(14) at Android.FINGERPRINT(samsung/a33xnseea/a33x:14/UP1A.231005.007/A336BXXSCEXL1:user/release-keys) Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [CoroutineId(290), "coroutine#290":ActorCoroutine{Cancelling}@56413bb, Dispatchers.IO]
I've looked at a few other logs files (that I maybe shouldn't entirely share publicly) and found :

Code: Select all

02-06 19:21:30.863 I/crash_dump64( 7210): obtaining output fd from tombstoned, type: kDebuggerdTombstoneProto 02-06 19:21:30.866 I/crash_dump64( 7210): performing dump of process 7002 (target tid = 7207) 02-06 19:21:31.132 F/DEBUG ( 7210): Process uptime: 17s 02-06 19:21:31.132 F/DEBUG ( 7210): Cmdline: org.videolan.vlc 02-06 19:21:31.132 F/DEBUG ( 7210): pid: 7002, tid: 7207, name: AndroidMedialib >>> org.videolan.vlc <<< 02-06 19:21:31.132 F/DEBUG ( 7210): uid: 10537 02-06 19:21:31.132 F/DEBUG ( 7210): tagged_addr_ctrl: 0000000000000001 (PR_TAGGED_ADDR_ENABLE) 02-06 19:21:31.132 F/DEBUG ( 7210): signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr -------- 02-06 19:21:31.132 F/DEBUG ( 7210): Abort message: 'terminating with uncaught exception of type medialibrary::sqlite::errors::DatabaseCorrupt: Failed to run request [DELETE FROM Media WHERE ( last_played_date < ? OR ( last_played_date IS NULL AND insertion_date < ? ) )AND import_type != ? AND nb_playlists = 0 AND nb_subscriptions = 0]: database disk image is malformed(779)' 02-06 19:21:31.132 F/DEBUG ( 7210): 11 total frames 02-06 19:21:31.132 F/DEBUG ( 7210): backtrace: 02-06 19:21:31.132 F/DEBUG ( 7210): #00 pc 0000000000059b38 /apex/com.android.runtime/lib64/bionic/libc.so (abort+164) (BuildId: 7841d31efc11481579e4cb75ccbcdb4f) 02-06 19:21:31.132 F/DEBUG ( 7210): #01 pc 000000000009ce88 /data/app/~~YfgBgFuP6suwRoJ253S3eQ==/org.videolan.vlc-KCfZiJabK_mSIFMTCxTUnA==/split_config.arm64_v8a.apk!libc++_shared.so (offset 0x1000) (BuildId: ece72a2ebc3774a1be9fd21271258acd3bcdfaa7) 02-06 19:21:31.132 F/DEBUG ( 7210): #02 pc 000000000009d07c /data/app/~~YfgBgFuP6suwRoJ253S3eQ==/org.videolan.vlc-KCfZiJabK_mSIFMTCxTUnA==/split_config.arm64_v8a.apk!libc++_shared.so (offset 0x1000) (BuildId: ece72a2ebc3774a1be9fd21271258acd3bcdfaa7) 02-06 19:21:31.132 F/DEBUG ( 7210): #03 pc 00000000000aead0 /data/app/~~YfgBgFuP6suwRoJ253S3eQ==/org.videolan.vlc-KCfZiJabK_mSIFMTCxTUnA==/split_config.arm64_v8a.apk!libc++_shared.so (offset 0x1000) (BuildId: ece72a2ebc3774a1be9fd21271258acd3bcdfaa7)
I had to remove a few lines because of the characters limit.
Even if it looks like the media library isn't loading, my list of playlist works and one folder has been scanned. I was trying to add music in the media library because it seemed to be the best way for the app to save the cover images of the recently downloaded audio files.

Lulu5239
New Cone
New Cone
Posts: 6
Joined: 06 Feb 2025 17:51
Operating System: Android
Contact:

Re: Crash after scanning folders by the media library

Postby Lulu5239 » 09 Feb 2025 17:08

This issue apparently is so strange that nobody wanted to respond, so I've done research yesterday...

It looks like no file explorer app is able to enter VLC's medialib folder in its app data, so I've used a file explorer with less features: VLC's browser.
Image
I could find a folder that contains outdated functional playlist files. Maybe it wouldn't be that hard to add an option to export playlists...
Image
I got the funny idea of renaming the medialib folder to something else and creating a new medialib folder (in which I would have permission to see files and folders), but it looked like nothing (except for folders) were being re-created. The only thing it did was breaking the cover images for music in my playlists. We can guess that the database is stored somewhere else.

When searching on this forum, someone suggested using an SQL database viewer app to open a dump of VLC's database. In the Folder table, there are a few basic folders (like Ringtones and Alarms, considered as banned folders), then all of the sub-folders of the folder that has been successfully scanned by the media library. There aren't any other folders stored in that table, and it doesn't look like it's broken.

I've noticed a "Custom libVLC options" button in the advanced settings, so I looked for ways to clean parts of the database or anything else helpful... The --no-media-library option didn't do anything.

Aza
Developer
Developer
Posts: 2275
Joined: 14 Mar 2019 10:04

Re: Crash after scanning folders by the media library

Postby Aza » 10 Feb 2025 07:30

Sorry, I did not answer but forwarded to the person in charge of the media library. I'll check with them later.

Skantes
Developer
Developer
Posts: 103
Joined: 11 Jul 2017 10:55

Re: Crash after scanning folders by the media library

Postby Skantes » 10 Feb 2025 15:08

Hi, I took a look at your issue but wasn't able to reproduce this. Would you mind sharing a screenshot of the More -> About view, to see our different library versions, and maybe the media database dump from the advanced section of the settings please ? You can share it with android-support@videolan.org if you don't want it public.

Lulu5239
New Cone
New Cone
Posts: 6
Joined: 06 Feb 2025 17:51
Operating System: Android
Contact:

Re: Crash after scanning folders by the media library

Postby Lulu5239 » 10 Feb 2025 17:01

I've just sent an e-mail to that e-mail address with my media library database (which causes "database disk image is malformed" errors, that's probably why you didn't see any issue). If you fix it, I probably won't be able to make the VLC app on my phone use it, I didn't root my phone...
The versions of things that I'm using are :
  • libvlcjni: 05d76f3
    VLC: 3948b27856
    libvlc: 3.6.0
I wasn't using nightly versions because I was scared of bugs breaking things like my playlists, like the warnings said.

Lulu5239
New Cone
New Cone
Posts: 6
Joined: 06 Feb 2025 17:51
Operating System: Android
Contact:

Re: Crash after scanning folders by the media library

Postby Lulu5239 » 15 Feb 2025 14:32

I got additional informations about that issue: my media library somehow fixed itself today (I randomly scanned a folder and the app didn't crash), without any updates.

When scanning my folders, the notification about the media library scanning/parsing got stuck (text in the notification stayed the same for over a minute) a few times.
Image
Image
After some time, the text in the notification changed.
Image
I looked at the debug logs, and saw that it still was scanning or parsing...
Image
Debug logs says that the scan finished, but there still is VLC's notification.
The notification also got stuck during the parsing.
Image
The last time that the media library fixed itself and that I went scanning my folders, I probably restarted the app multiple times because of the notification not updating, possibly causing errors in the media library database. I've also done it at least once today...

I couldn't screenshot all interesting logs, because the debug logs feature didn't always let me start logging.
Image
During a third parsing phase (that automatically started when starting the app), the parsing paused when opening the debug logs and restarted when closing the settings.
I've created and kept 2 logcat files if really needed, mostly from when the app was parsing files.

I've later noticed that some audio files weren't being played when selecting them from the Audio section of the app (they were considered as not existing), so I've re-scanned some folders... I've done the mistake of adding my Music folder as a custom path and scanning the folders from that path, which removed a lot of audio from my playlists. 🙁
I probably broke the app a lot today, the media library now doesn't parse any media from the Music folder...
Image

Lulu5239
New Cone
New Cone
Posts: 6
Joined: 06 Feb 2025 17:51
Operating System: Android
Contact:

Re: Crash after scanning folders by the media library

Postby Lulu5239 » 16 Feb 2025 14:31

Now that I've exported my playlists using my dump of the media library a few days ago and the script https://github.com/lulu5239/test/blob/m ... aylists.js, I really want to just delete my media library and re-import my playlists from the files produced by my script.
I'll wait approximately one day just in case people wants me to experiment stuff with my broken media library.
Maybe I'll also make more understandable bug reports later... If you attempt to reproduce the previous issue of media being removed from playlists, I've tried in the secure folder feature of my phone (works like work profiles) and VLC works correctly.
Image


Return to “VLC for Android and Chrome OS”

Who is online

Users browsing this forum: No registered users and 26 guests