advplyr / audiobookshelf-app

Mobile application for Audiobookshelf
https://audiobookshelf.org
GNU General Public License v3.0
1.31k stars 173 forks source link

[Bug]: Can't download audiobooks #1253

Open Cossty opened 4 months ago

Cossty commented 4 months ago

What was the Problem?

Recently, I finished setting up audiobookshelf for the first time. I decided to download 30+ audiobooks. Some of them have multiple tracks, so the android app was downloading around 400 files. After it downloaded around 100 it was stuck and didn't continue. I had to restart the app, disconnect and reconnect to the server, just to be able to download again. Tried again to download a lot of files at once. Same result, stalled after a while.

Then I tried to find some answers here. The only thing I found was that when you start downloading a book, you should wait a little on it's page, to let the download set up. So I did that, I waited on each book 5-10s, before leaving for another one. It looked like it helped a little, because a lot more files got downloaded this time, but it stalled anyway. My internet is downloading books 5-6 m/s.

After that, I was downloading books one by one, which worked until it didn't. I have 42 local books. Audiobookshelf app uses 25.61 gb of user data. Now the download stalls before finishing one book. Connecting on local network. Battery optimization is set to unrestricted.

Steps to Reproduce the Issue

  1. Have no local books

  2. Que a lot of books/files for download. 400+

  3. Have a 42+ local books/25.61gb of user data

  4. try to download another book

What was Expected?

To be able to download books without stalling.

Phone Model

Fairphone 4

Phone OS

Android 13, stock, but stock for fairphone is /e/OS

Audiobookshelf App Version

Android App - 0.9.74

Installation Source

Google Play Store, Other (List in "Additional Notes")

Additional Notes

App downloaded with Aurora Store, but if I understand it correctly, that's just google play version. I don't have logs for when I was downloading a lot of books at once. There are a lot of ping timeouts in my logs, is this intended?

2024-07-05 07:03:21.735 INFO [SocketAuthority] Socket 00Pu9GzjwYI4xz8fAABl disconnected from client "cossty" after 426859ms (Reason: ping timeout)

2024-07-05 07:03:58.566 INFO [SocketAuthority] Socket Connected HoT8oJ3gsiCfn9bYAABn

2024-07-05 07:11:51.829 INFO [SocketAuthority] Socket HoT8oJ3gsiCfn9bYAABn disconnected from client "cossty" after 473263ms (Reason: ping timeout)

2024-07-05 07:33:51.669 INFO [SocketAuthority] Socket Connected zbqvUMnkO3__VytrAABp

2024-07-05 07:39:37.720 INFO [SocketAuthority] Socket zbqvUMnkO3__VytrAABp disconnected from client "cossty" after 346052ms (Reason: ping timeout)

2024-07-05 07:48:16.824 INFO [SocketAuthority] Socket Connected xbxnmWj_Vzf71wsnAABr

2024-07-05 07:57:49.795 INFO [SocketAuthority] Socket xbxnmWj_Vzf71wsnAABr disconnected from client "cossty" after 572972ms (Reason: ping timeout)

I don't know if this is the reason for downloads stalling, but they sometimes stall without there being ping timeout in logs. Like here

2024-07-05 06:50:13.411 INFO [LibraryItemController] User "cossty" requested file download at "/audiobooks/Alexandre Dumas/The Count of Monte Cristo/The Count of Monte Cristo (Unabridged) - 036.m4b"

2024-07-05 06:50:19.328 INFO [LibraryItemController] User "cossty" requested file download at "/audiobooks/Alexandre Dumas/The Count of Monte Cristo/The Count of Monte Cristo (Unabridged) - 037.m4b"

2024-07-05 06:55:52.883 INFO [SocketAuthority] Socket yCuxkU41IPxg2XxTAABh disconnected from client "cossty" after 567679ms (Reason: transport close)

2024-07-05 06:56:02.604 INFO [SocketAuthority] Socket Connected eJQOpeLn_q9IUUlkAABj

2024-07-05 06:56:07.071 INFO [SocketAuthority] Socket eJQOpeLn_q9IUUlkAABj disconnected from client "cossty" after 4467ms (Reason: client namespace disconnect)

It stalled after file 37 and I had to restart the app and disconnect and reconnect to the server. Here I tried to download it again, but it stalled on file 20, timeout happened 5m later, so that was probably not the cause.

2024-07-05 06:57:36.876 INFO [LibraryItemController] User "cossty" requested file download at "/audiobooks/Alexandre Dumas/The Count of Monte Cristo/The Count of Monte Cristo (Unabridged) - 019.m4b"

2024-07-05 06:58:01.392 INFO [LibraryItemController] User "cossty" requested file download at "/audiobooks/Alexandre Dumas/The Count of Monte Cristo/The Count of Monte Cristo (Unabridged) - 020.m4b"

2024-07-05 07:03:21.735 INFO [SocketAuthority] Socket 00Pu9GzjwYI4xz8fAABl disconnected from client "cossty" after 426859ms (Reason: ping timeout)

Cossty commented 4 months ago

After some more testing, this is not entirely true. I just downloaded some very small book, around 90mb. That worked fine. But bigger books always stall for me. I want to download Count of Monte Cristo right now, it is 1.4 gb. It doesn't work and always get stuck, in different places. Once it was stuck on 54%, then 14%, then 86%. I just can't download it, because after restart of the app I have to download it from the beginning, and it always stalls again. Having the screen always on doesn't help.

timwiel commented 1 month ago

Same issue for me here ... same socket issue in my logs...

Phone Model Samsung A24

Phone OS Android 14

Audiobookshelf App Version Android App - 0.9.74

Installation Source Google Play Store

Logs

2024-09-25 09:36:38.810

INFO

[SocketAuthority] Socket Connected h6tQbBnJMU31xBnjAAA3

2024-09-25 09:37:23.759

INFO

[SocketAuthority] Socket h6tQbBnJMU31xBnjAAA3 disconnected from client "timw" after 44949ms (Reason: ping timeout)

2024-09-25 09:38:13.293

INFO

[SocketAuthority] Socket Connected sp0mpaA7MTrKzGXWAAA5

2024-09-25 09:39:06.398

INFO

[SocketAuthority] Socket Connected y6YHGwwpwS3HB9dRAAA7

2024-09-25 09:39:06.419

INFO

[SocketAuthority] Socket sp0mpaA7MTrKzGXWAAA5 disconnected from client "timw" after 53126ms (Reason: transport close)

2024-09-25 09:41:09.206

INFO

[SocketAuthority] Socket Connected s8uqMe5sBJlmhgiKAAA9

2024-09-25 09:41:54.199

INFO

[SocketAuthority] Socket s8uqMe5sBJlmhgiKAAA9 disconnected from client "timw" after 44992ms (Reason: ping timeout)

timwiel commented 1 month ago

Sorry this is the same error whether on local wifi connection to the audiobookshelf server OR on cellular data ...