Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem Downloading big Audiobooks #1167

Open
1 task done
Maxklos opened this issue Apr 5, 2024 · 9 comments
Open
1 task done

Problem Downloading big Audiobooks #1167

Maxklos opened this issue Apr 5, 2024 · 9 comments
Labels
bug Something isn't working unable to reproduce waiting Waiting for OP

Comments

@Maxklos
Copy link

Maxklos commented Apr 5, 2024

Steps to reproduce

  1. Download a big Audiobook
  2. Wait for download

Expected behaviour

Download would complete.

Actual behaviour

I use ABS for a while now and most of the times i don't encounter this problem. Now i have a Audiobook (533 Chapters -> 533 m4b files, ~43h, 2,45gb) I can listen to it fine when using the "Stream" Option or the Webinterface. When i try to download it, it takes a looong time (around 1h) then the app just hangs at "Downloading... Processing" indefinitely. When i change apps and come back the download is complete gone. I tried manually putting the files in the correct folder on my Phone but the same problems occur.
It doesn't matter if i download to the internal App Storage or a custom folder on the device.
Changing the Energy saving settings to "unrestricted" didn't help.

I looked at a couple of Issues here on Github which are similar:
#816 -> Same Problem, but i don't use trafik
#956 -> Would probaly help the download side

Environment data

Audiobookshelf Version: 0.9.73-beta
Server Version: v2.8.1

  • Android App?

Android Issue

Android version:
13 / 14

Device model:

  • Pixel 3A
  • Pixel 5a
  • Pixel 6

Stock or customized system:
Stock

@Maxklos Maxklos added the bug Something isn't working label Apr 5, 2024
@advplyr
Copy link
Owner

advplyr commented Apr 5, 2024

Are you downloading using a local ip address or a reverse proxy?

@Maxklos
Copy link
Author

Maxklos commented Apr 5, 2024

Ah sorry, i forgot.
ABS is running on a Ubuntu Server and accessed through Cloudflaretunnel. I tested it with another server and direct IP access, it worked once but not reliable.

Another update. While writing the Issue I tested it again but with the screentimeout of my Phone set to 30min. With that the download worked and also the processing finished (processing was around 15min). With the same Audiobook converted to mp3 (3.50GB) the process is faster.

I think its an Problem with m4b files and the Socket disconnect if the Phonescreen locks / changes

@bwprog
Copy link

bwprog commented Apr 23, 2024

I think I'm experiencing the same issue.
Android 14
Pixel 8
0.9.73-beta
ABS 2.8.1 and now 2.9.0 on Docker Linux
NPM latest or Caddy latest on docker linux -- I've tried going back and forth with same issue but both worked with same image/config a month ago.

Downloading books onto the android app used to take less than 30 seconds back on ABS 2.7.2. It now takes 20 minutes if it completes at all. I have to keep the app on top and keep the screen from locking to keep the download going. What is frustrating is that there is no pause/resume to the downloads so when it hangs from opening another app or screen locks, I have to force quit ABS and then start the download over from scratch. I've also tried clearing all cache and downloads on the app which has not helped.

I have tried downloading the same file using firefox on my desktop going through reverse proxy and it takes a long time there too at ~400K/s. If I try connecting directly to my library on internal network, I can download the same audibook in 5 seconds at ~14MB/s. I double-checked with speedtest and my upload is still over 700mb/s so I'm not throttled. While the issue appears to be with the reverse proxy, neither NPM nor Caddy have updated this year and the problem for me started maybe a month ago after upgrading ABS, so I don't know how both reverse proxies that used to work are causing this slowdown.

If I set the android app to use the internal IP of the ABS docker image, the book downloads work at the same speed they used to when using the reverse proxy. If I need to switch internal/external going forward, it would be nice if the user/pwd could be cached when switching servers.

@15sawyer
Copy link

I experience much the same.
Downloading anything has become very frustrating. My device has to be kept from closing. Otherwise, some files hang or it may abort completely.
I have also seen the app hanging at the 'Processing' step.
Speed isn't as fast as I would expect from my setup, but it is okay. My ABS is behind a Traefik reverse proxy.

The app could really benefit from a resume-download functionality.

@troy117
Copy link

troy117 commented Jun 1, 2024

I am having the same issue. I really want to be able to download the books to my phone, but it will randomly stop. I also can't cancel it out and restart either, its just stuck at whatever percent it died at. So I'm stuck with streaming...
I am running my server on a seedbox that has great upload, and using an android phone over my wifi.

@Maxklos
Copy link
Author

Maxklos commented Jun 2, 2024

Currently it takes a long time for the download, but with the screen timeout set to 30min, it completes the download. I can see the files in the right folder of the device. But currently it hangs at the "processing" part, even after another 30min it's still there.... After a long wait the app just crashes. It doesn't matter if it is a m4b or mp3 file.

@Maxklos
Copy link
Author

Maxklos commented Jun 2, 2024

@advplyr can you please give us some insight of what is happening at the "processing" Stage and what file format should be used to minimize the processing time?

@troy117
Copy link

troy117 commented Jun 4, 2024

I installed android studio, cloned the repository, and emulated my phone a Pixel 6 Pro and was able to successfully download many large audiobooks without issues from my seedbox server. However, using my phone the file download randomly will stop, once once it does it will not resume. Closing the app out and re-opening it I will have to re-start the download from 0% and once again it never completes.

I am including the logcat from where the download gets frozen. Hopefully this will help.
Screenshot 2024-06-04 152033

@troy117
Copy link

troy117 commented Aug 2, 2024

@Maxklos @bwprog @15sawyer I was having the same issue on two of my devices. I fixed the issue and and posted two pull requests with the code corrections. If you're able to compile my repo and verify that the downloads work it might help get my pull requests approved. I don't know how to reproduce the error that is causing the downloads to freeze up during simulation, but was able to verify that it works by actually downloading my audiobooks on my devices.
Because I am new to GitHub I posted it as two different pull requests #1230 &#1231. The repo is: https://github.com/troy117/audiobookshelf-app

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working unable to reproduce waiting Waiting for OP
Projects
None yet
Development

No branches or pull requests

5 participants