AIMP Forum

AIMP for Android => Предложения / Suggestions => Topic started by: xburst on June 17, 2024, 14:30:57

Title: AIMP consume too much network traffic to update cloud-based playlist metadata
Post by: xburst on June 17, 2024, 14:30:57
How To Reproduce:
1. Create a playlist
2. Add webdav storage and add webdav server's files to playlist.

What I expected:

AIMP should only fetchs filelist and add them to playlist.

What actually happend:
AIMP consume many GiB network traffic to update metadata of items in playlist.

How to fix it:
Add an option to disable metadata updating for cloud-based playlist.
Title: WebDAV playlists auto-download all files, leading to playback lag and high data
Post by: snhun on July 01, 2024, 16:48:40
How to Reproduce the Issue:
Issue Description:
My Suggestion:
Benefits of On-Demand Downloading:
Title: Re: AIMP consume too much network traffic to update cloud-based playlist metadata
Post by: Artem on July 02, 2024, 12:46:15
It does not download all files, just few parts of the file that contains a meta information. Anyway, it can be setup in app settings
Title: Re: AIMP consume too much network traffic to update cloud-based playlist metadata
Post by: snhun on July 04, 2024, 08:46:50
Regarding the AIMP app installed on my phone, on June 29th, after casually playing a few songs and then pausing playback, I turned off the phone screen. In actual use,
it consumed 1.2GB of data (the playlist contains about 100 songs, each around 10MB).

The images attached show the version of AIMP I am using and the statistics of the data usage.

I couldn't find any corresponding settings options to adjust this feature.
Could you please guide me on the specific path to these settings?
Title: Re: AIMP consume too much network traffic to update cloud-based playlist metadata
Post by: Artem on July 09, 2024, 23:45:54
Could you please guide me on the specific path to these settings?

Oh, you talking about mobile version...
Title: Re: AIMP consume too much network traffic to update cloud-based playlist metadata
Post by: snhun on July 10, 2024, 06:05:40
Yes, the mobile version, sorry for not being clear.
Title: Re: AIMP consume too much network traffic to update cloud-based playlist metadata
Post by: Artem on July 10, 2024, 15:28:15
I've added the option to the Network page, please try following build: https://disk.yandex.ru/d/2O_d6ep50_tqVQ
Title: Re: AIMP consume too much network traffic to update cloud-based playlist metadata
Post by: snhun on July 11, 2024, 06:23:10
I've added the option to the Network page, please try following build: https://disk.yandex.ru/d/2O_d6ep50_tqVQ

A new issue has arisen, the WebDAV list is not displaying any files at all.

I tried uninstalling and reinstalling, but I'm still unable to display the files.
Title: Re: AIMP consume too much network traffic to update cloud-based playlist metadata
Post by: Artem on July 11, 2024, 07:52:03
A new issue has arisen, the WebDAV list is not displaying any files at all.

I tried uninstalling and reinstalling, but I'm still unable to display the files.

Refer to the "About" dialog of the app, and check the "enable logging" option. Restart the app. Now, reproduce an issue and send the log file to me.
Title: Re: AIMP consume too much network traffic to update cloud-based playlist metadata
Post by: snhun on July 11, 2024, 08:35:28
Refer to the "About" dialog of the app, and check the "enable logging" option. Restart the app. Now, reproduce an issue and send the log file to me.

I have replaced the account and domain with XXX for privacy reasons. The WebDAV directory is displayed properly, but the songs within the directory are not showing up.

I am now encountering issues even when trying to use the official version from the website.

The AIMP desktop application on my PC is able to access and play the songs without any problems.

main   11/07/2024 13:28:31.554   D/App:   v4.11.1453 Beta (10.07.2024), arm64-v8a, api34
main   11/07/2024 13:28:31.556   D/App:   Redmi(23013RK75C, Android v14, 8 cores)
main   11/07/2024 13:28:32.152   D/MainUI:   onBind(true, false)
main   11/07/2024 13:28:33.183   D/Guide:   show(Default, 1PLFragment)
main   11/07/2024 13:28:33.696   D/Guide:   show(Default, 1PLFragment)
main   11/07/2024 13:28:34.176   D/Guide:   done(Default, 1PLFragment)
main   11/07/2024 13:28:36.408   D/TwilightManager:   TwilightManager(system, false, 0, 0, 0)
main   11/07/2024 13:28:36.408   D/App:   applyLocale(zh_CN)
main   11/07/2024 13:28:36.410   D/Skin:   load(Default, 100%, , , day, 0)
main   11/07/2024 13:28:36.421   D/FileBrowser:   {intent:aimp.intent.action.OPEN_FILES,null,{; aimp.intent.extra.mru_id=Playlists; aimp.intent.extra.multichoice=true; aimp.intent.extra.filetypes=*.aimpbpl;*.m3u;*.m3u8;*.pls;*.xspf;*.cue;}}
main   11/07/2024 13:28:36.422   D/ActivityBridge:   register(FileBrowser.AddScopedStorage)
main   11/07/2024 13:28:36.422   D/ActivityBridge:   register(FileBrowser.RefreshOnPermission)
main   11/07/2024 13:28:36.423   D/FileBrowser:   rescan.start()
main   11/07/2024 13:28:36.423   D/SAF:   volume(/storage/emulated/0, 内部存储设备, primary, null)
main   11/07/2024 13:28:36.424   D/SAF:   volume(/storage/emulated/0, 内部存储设备, primary, null)
main   11/07/2024 13:28:36.425   D/FileBrowser:   rescan.done(, 1)
pool-3-thread-6   11/07/2024 13:28:36.425   D/FileBrowser:   goToPath()
main   11/07/2024 13:28:36.998   D/MainUI:   onUnbind(true)
pool-3-thread-8   11/07/2024 13:28:56.224   D/FileBrowser:   rescan.start()
pool-3-thread-8   11/07/2024 13:28:56.226   D/SAF:   volume(/storage/emulated/0, 内部存储设备, primary, null)
pool-3-thread-8   11/07/2024 13:28:56.227   D/SAF:   volume(/storage/emulated/0, 内部存储设备, primary, null)
pool-3-thread-8   11/07/2024 13:28:56.236   D/FileBrowser:   rescan.done(, 2)
pool-3-thread-7   11/07/2024 13:28:57.448   D/FileBrowser:   rescan.start(cloud://xxx@xxx.xxx.xxx26999.dav.alipan)
pool-3-thread-7   11/07/2024 13:28:57.548   D/FileBrowser:   rescan.done(cloud://xxx@xxx.xxx.xxx26999.dav.alipan, 4)
pool-3-thread-1   11/07/2024 13:28:58.578   D/FileBrowser:   rescan.start(cloud://xxx@xxx.xxx.xxx26999.dav.alipan/Root/Music)
pool-3-thread-1   11/07/2024 13:28:58.668   D/FileBrowser:   rescan.done(cloud://xxx@xxx.xxx.xxx26999.dav.alipan/Root/Music, 0)
main   11/07/2024 13:29:09.577   D/MainUI:   onBind(true, false)
main   11/07/2024 13:29:09.579   D/ActivityBridge:   onActivityResult(7004, false, {intent:null,null,null})
main   11/07/2024 13:29:10.149   D/ActivityBridge:   unregister(FileBrowser.AddScopedStorage)
main   11/07/2024 13:29:10.149   D/ActivityBridge:   unregister(FileBrowser.RefreshOnPermission)
main   11/07/2024 13:29:11.734   D/TwilightManager:   TwilightManager(system, false, 0, 0, 0)
main   11/07/2024 13:29:11.736   D/App:   applyLocale(zh_CN)
main   11/07/2024 13:29:11.737   D/Skin:   load(Default, 100%, , , day, 0)
main   11/07/2024 13:29:12.313   D/MainUI:   onUnbind(true)
Title: Re: AIMP consume too much network traffic to update cloud-based playlist metadata
Post by: Artem on July 13, 2024, 21:12:45
The WebDAV directory is displayed properly, but the songs within the directory are not showing up

As I see the log has no errors, so AIMP've parsed server answer properly
Title: Re: AIMP consume too much network traffic to update cloud-based playlist metadata
Post by: snhun on July 14, 2024, 02:54:26
As I see the log has no errors, so AIMP've parsed server answer properly

I can see the folder, but I can't see the music inside it. Strangely, everything was normal a few days ago. The issue persists even after I uninstalled and reinstalled the software.
Title: Re: AIMP consume too much network traffic to update cloud-based playlist metadata
Post by: Artem on July 14, 2024, 21:05:22
May be, something has been changed on server side? If you want, I can send to personally to you a special build that log all requests and answers from the server
Title: Re: AIMP consume too much network traffic to update cloud-based playlist metadata
Post by: snhun on July 16, 2024, 04:44:46
May be, something has been changed on server side? If you want, I can send to personally to you a special build that log all requests and answers from the server

Sure, please go ahead and send me that version of the software. I can try it out to see if the music files are displayed correctly on my local network.

When I access using a PC emulator, I encounter an error report.
Code: [Select]
Attr.value missing f.async (position:START_TAG <script src="https://g.alicdn.com/IMM/office-js/1.1.5/aliyun-web-office-sdk.min.js" async="https://jsd.nn.ci/gh/alit-org/logo@main/logo.png">) @31:5 in java.io.InputStreamReader(@e2c8714)()
The attachment shows the list being displayed correctly by the MPV-based WebDAV software.

The server is set up on my personal computer in China, and I haven't made any changes to the settings. Restarting the server didn't solve the issue either.
If it were a network or server problem, I wouldn't even be able to see the folders, but I can connect to the server properly; it's just that the music files aren't visible.
Title: Re: AIMP consume too much network traffic to update cloud-based playlist metadata
Post by: Artem on July 16, 2024, 13:47:05
Sure, please go ahead and send me that version of the software

Here is it: https://disk.yandex.ru/d/2YH74j-LYT52fg

Please send to me a log via personal message of the forum
Title: Re: AIMP consume too much network traffic to update cloud-based playlist metadata
Post by: snhun on July 17, 2024, 13:30:55
Here is it: https://disk.yandex.ru/d/2YH74j-LYT52fg

Please send to me a log via personal message of the forum

The log string was too long, so I uploaded it to OneDrive. The music still isn't showing up, but the log seems to contain the music filenames.
Title: Re: AIMP consume too much network traffic to update cloud-based playlist metadata
Post by: Artem on July 17, 2024, 13:43:58
main   17/07/2024 18:16:40.962   D/FileBrowser:   {intent:aimp.intent.action.OPEN_FILES,null,{; aimp.intent.extra.mru_id=Playlists; aimp.intent.extra.multichoice=true; aimp.intent.extra.filetypes=*.aimpbpl;*.m3u;*.m3u8;*.pls;*.xspf;*.cue;}}

It seems you've tried to open playlist, not music files, so what why the music files are not displayed

P.S. Of course, debug version will not display it (just because it makes a dump instead of parsing)
Title: Re: AIMP consume too much network traffic to update cloud-based playlist metadata
Post by: snhun on July 18, 2024, 04:44:37
It seems you've tried to open playlist, not music files, so what why the music files are not displayed

P.S. Of course, debug version will not display it (just because it makes a dump instead of parsing)

In the past, I operated in this manner, and the songs were displayed properly. Now, however, the songs are no longer being shown. I have re-uploaded a screen recording along with a log file, which should allow you to see the contrast between the two pieces of software.

Code: [Select]
main 18/07/2024 09:32:30.394 D/FileBrowser: {intent:aimp.intent.action.OPEN_MUSIC,null,{; aimp.intent.extra.mru_id=MUSIC; aimp.intent.extra.filetypes_additional=*.aimpbpl;*.m3u;*.m3u8;*.pls;*.xspf;; aimp.intent.extra.multichoice=true; aimp.intent.extra.filetypes=*.ac3;*.alac;*.ape;*.dsd;*.wma;*.3gp;*.amr;*.flac;*.mp3;*.opus;*.ogg;*.awb;*.mp2;*.mp1;*.mpga;*.wav;*.oga;*.aiff;*.aif;*.umx;*.mod;*.mo3;*.it;*.s3m;*.mtm;*.xm;*.ts;*.mac;*.fla;*.aac;*.m4a;*.m4b;*.mp4;*.mpc;*.mp+;*.mpp;*.wv;*.tta;*.dff;*.dsf;*.webm;*.weba;*.mkv;*.mka;*.midi;*.mid;}}
https://1drv.ms/f/s!Ak3LlVGjqkc6piva-7szZ-O-wt6Y?e=4ZJPqr
Title: Re: AIMP consume too much network traffic to update cloud-based playlist metadata
Post by: Artem on July 18, 2024, 08:35:31
In the past, I operated in this manner, and the songs were displayed properly. Now, however, the songs are no longer being shown. I have re-uploaded a screen recording along with a log file, which should allow you to see the contrast between the two pieces of software.

Code: [Select]
main 18/07/2024 09:32:30.394 D/FileBrowser: {intent:aimp.intent.action.OPEN_MUSIC,null,{; aimp.intent.extra.mru_id=MUSIC; aimp.intent.extra.filetypes_additional=*.aimpbpl;*.m3u;*.m3u8;*.pls;*.xspf;; aimp.intent.extra.multichoice=true; aimp.intent.extra.filetypes=*.ac3;*.alac;*.ape;*.dsd;*.wma;*.3gp;*.amr;*.flac;*.mp3;*.opus;*.ogg;*.awb;*.mp2;*.mp1;*.mpga;*.wav;*.oga;*.aiff;*.aif;*.umx;*.mod;*.mo3;*.it;*.s3m;*.mtm;*.xm;*.ts;*.mac;*.fla;*.aac;*.m4a;*.m4b;*.mp4;*.mpc;*.mp+;*.mpp;*.wv;*.tta;*.dff;*.dsf;*.webm;*.weba;*.mkv;*.mka;*.midi;*.mid;}}
https://1drv.ms/f/s!Ak3LlVGjqkc6piva-7szZ-O-wt6Y?e=4ZJPqr

Please try on this version: https://disk.yandex.ru/d/EqAQMSxtIF-Jzw
Title: Re: AIMP consume too much network traffic to update cloud-based playlist metadata
Post by: snhun on July 18, 2024, 09:53:39
Please try on this version: https://disk.yandex.ru/d/EqAQMSxtIF-Jzw

This version can correctly display the file now.

The playback is highly error-prone, with an inability to read the file.

https://1drv.ms/u/s!Ak3LlVGjqkc6pjDqMDLFTw-_qg-P?e=QMSivR
Title: Re: AIMP consume too much network traffic to update cloud-based playlist metadata
Post by: xburst on July 18, 2024, 14:50:10
My Suggestion:
AIMP fetches only the list of files from the WebDAV source and adds them to the playlist without initiating immediate downloads.
When a specific song is selected for playback, AIMP should then download that particular file to ensure smooth listening.
Benefits of On-Demand Downloading:

Agree!


Please try on this version: https://disk.yandex.ru/d/EqAQMSxtIF-Jzw

@Artem Since the official aimp app hasn't been released yet, I had to hack aimp to disable the metadata auto-fetching feature, here's what I changed, just FYI:

Code: [Select]
diff --color -u -r out/com/aimp/library/fm/FileURI.smali out_new/com/aimp/library/fm/FileURI.smali
--- out/com/aimp/library/fm/FileURI.smali       2024-07-18 19:27:45.046281528 +0800
+++ out_new/com/aimp/library/fm/FileURI.smali   2024-06-17 18:01:49.752575353 +0800
@@ -960,6 +960,14 @@
     return v0
 .end method
 
+.method public isCloudURI()Z
+    .registers 2
+
+    const/4 v0, 0x0
+
+    return v0
+.end method
+
 .method public toFile()Ljava/io/File;
     .registers 2
     .annotation build Landroidx/annotation/Nullable;
diff --color -u -r out/com/aimp/library/fm/fs/cloud/CloudFileURI.smali out_new/com/aimp/library/fm/fs/cloud/CloudFileURI.smali
--- out/com/aimp/library/fm/fs/cloud/CloudFileURI.smali 2024-07-18 19:27:45.056281528 +0800
+++ out_new/com/aimp/library/fm/fs/cloud/CloudFileURI.smali     2024-06-17 18:02:49.849241536 +0800
@@ -56,6 +56,14 @@
     return-object v0
 .end method
 
+# virtual methods
+.method public isCloudURI()Z
+    .registers 2
+
+    const/4 v0, 0x1
+
+    return v0
+.end method
 
 # virtual methods
 .method public getDisplayPath()Ljava/lang/String;
diff --color -u -r out/com/aimp/player/core/playlist/PlaylistActions$BasicReloadMeta.smali out_new/com/aimp/player/core/playlist/PlaylistActions$BasicReloadMeta.smali
--- out/com/aimp/player/core/playlist/PlaylistActions$BasicReloadMeta.smali     2024-07-18 19:27:45.139614862 +0800
+++ out_new/com/aimp/player/core/playlist/PlaylistActions$BasicReloadMeta.smali 2024-06-17 18:11:45.049237230 +0800
@@ -372,6 +372,12 @@
 
     if-nez v2, :cond_6c
 
+    invoke-virtual {v1}, Lcom/aimp/player/core/playlist/PlaylistItem;->isCloudFile()Z
+
+    move-result v2
+
+    if-nez v2, :cond_6c
+
     iget-boolean v2, p0, Lcom/aimp/player/core/playlist/PlaylistActions$BasicReloadMeta;->fReloadAll:Z
 
     if-nez v2, :cond_3d
diff --color -u -r out/com/aimp/player/core/playlist/PlaylistItem.smali out_new/com/aimp/player/core/playlist/PlaylistItem.smali
--- out/com/aimp/player/core/playlist/PlaylistItem.smali        2024-07-18 19:27:45.149614863 +0800
+++ out_new/com/aimp/player/core/playlist/PlaylistItem.smali    2024-06-17 18:10:43.055904395 +0800
@@ -1131,6 +1131,18 @@
     return v0
 .end method
 
+.method public isCloudFile()Z
+    .registers 2
+
+    iget-object v0, p0, Lcom/aimp/player/core/playlist/PlaylistItem;->fFileName:Lcom/aimp/library/fm/FileURI;
+
+    invoke-virtual {v0}, Lcom/aimp/library/fm/FileURI;->isCloudURI()Z
+
+    move-result v0
+
+    return v0
+.end method
+
 .method public load(Lcom/aimp/player/core/data/AbstractChunkedStorage$AbstractReader;Ljava/util/List;)V
     .registers 11
     .param p1    # Lcom/aimp/player/core/data/AbstractChunkedStorage$AbstractReader;