[Bug]: No audio for a few seconds after rewinding/seeking in web player #585

Closed
opened 2026-04-24 23:13:48 +02:00 by adam · 10 comments
Owner

Originally created by @ameyp on GitHub (Aug 14, 2022).

Describe the issue

While listening to an audiobook in my browser, if I click on the rewind button or somewhere on the progress bar to seek backwards, there is no audio for a few seconds. The progress bar keeps moving as if the book is being played, but nothing comes out of the speakers for a few seconds, after which audio starts playing.

Steps to reproduce the issue

  1. Open an audiobook and start listening. Don't know if it matters, but I encountered this with an MP3 that is about 26 hours long.
  2. Click on the rewind button
  3. Progress bar keeps moving, but no audio for a few seconds

Audiobookshelf version

v2.1.2

How are you running audiobookshelf?

Docker (technically I think it's containerd) on Kubernetes

Originally created by @ameyp on GitHub (Aug 14, 2022). ### Describe the issue While listening to an audiobook in my browser, if I click on the rewind button or somewhere on the progress bar to seek backwards, there is no audio for a few seconds. The progress bar keeps moving as if the book is being played, but nothing comes out of the speakers for a few seconds, after which audio starts playing. ### Steps to reproduce the issue 1. Open an audiobook and start listening. Don't know if it matters, but I encountered this with an MP3 that is about 26 hours long. 2. Click on the rewind button 3. Progress bar keeps moving, but no audio for a few seconds ### Audiobookshelf version v2.1.2 ### How are you running audiobookshelf? Docker (technically I think it's containerd) on Kubernetes
adam added the bug label 2026-04-24 23:13:48 +02:00
adam closed this issue 2026-04-24 23:13:48 +02:00
Author
Owner

@ameyp commented on GitHub (Aug 14, 2022):

I marked "How are you running audiobookshelf" as other because I'm running it as a container inside Kubernetes.

@ameyp commented on GitHub (Aug 14, 2022): I marked "How are you running audiobookshelf" as other because I'm running it as a container inside Kubernetes.
Author
Owner

@advplyr commented on GitHub (Aug 14, 2022):

You are running abs with Docker then.
I just tested this with a single file m4b audiobook that is 28 hours duration and the seek back was instant.

What browser are you using?
Are you using a network file system? Or is the file system storing your audiobooks on the same machine as Abs is running?
Are you able to reproduce this with every audiobook or what testing have you done to isolate the issue?

@advplyr commented on GitHub (Aug 14, 2022): You are running abs with Docker then. I just tested this with a single file m4b audiobook that is 28 hours duration and the seek back was instant. What browser are you using? Are you using a network file system? Or is the file system storing your audiobooks on the same machine as Abs is running? Are you able to reproduce this with every audiobook or what testing have you done to isolate the issue?
Author
Owner

@ameyp commented on GitHub (Aug 14, 2022):

What browser are you using?

Firefox 103.0

Are you using a network file system?

Yes, mounted via NFS on a gigabit LAN. I get file transfer speeds of about 95 MBps

Are you able to reproduce this with every audiobook...

It's weird, here's what I'm seeing:

  • All audiobooks I tested worked fine with a different user (root) on the same ABS instance
  • Other audiobooks are working fine on the same user (abcd) if I open them and seek around randomly
  • The audiobook that I was listening to - if I open it on the same user (abcd) and click on Play, I'm seeing part of the problematic behavior again. When I click on Play, the progress bar starts moving, then 3-4 seconds later the audio starts. If I leave the tab open for a few minutes, refresh and click Play, audio starts right away.

Is it possible that the issue only crops up if an audiobook has been playing for a while? I'd been listening to it for about 40 minutes before I tried to rewind and encountered this. At the moment, seeking backward/forward on the abcd user is working fine, for that audiobook and others.

@ameyp commented on GitHub (Aug 14, 2022): > What browser are you using? Firefox 103.0 > Are you using a network file system? Yes, mounted via NFS on a gigabit LAN. I get file transfer speeds of about 95 MBps > Are you able to reproduce this with every audiobook... It's weird, here's what I'm seeing: - All audiobooks I tested worked fine with a different user (root) on the same ABS instance - Other audiobooks are working fine on the same user (abcd) if I open them and seek around randomly - The audiobook that I was listening to - if I open it on the same user (abcd) and click on Play, I'm seeing part of the problematic behavior again. When I click on Play, the progress bar starts moving, then 3-4 seconds later the audio starts. If I leave the tab open for a few minutes, refresh and click Play, audio starts right away. Is it possible that the issue only crops up if an audiobook has been playing for a while? I'd been listening to it for about 40 minutes before I tried to rewind and encountered this. At the moment, seeking backward/forward on the abcd user is working fine, for that audiobook and others.
Author
Owner

@ameyp commented on GitHub (Aug 14, 2022):

Also, to clarify, the delay is fine by me, I'd expect playback to take some time, especially on a network-mounted file system. The main issue as I see it is that the progress bar should not start moving until audio starts.

@ameyp commented on GitHub (Aug 14, 2022): Also, to clarify, the delay is fine by me, I'd expect playback to take some time, especially on a network-mounted file system. The main issue as I see it is that the progress bar should not start moving until audio starts.
Author
Owner

@advplyr commented on GitHub (Aug 14, 2022):

It may be beneficial to look at the server logs and the console log in the browser.

It would be good to know if the audio file is direct playing or being transcoded. There has been issues reported with Firefox failing to direct play audio files which then triggers abs to fallback to transcoding.

It is likely there are improvements we can make to the memory usage, it could also be helpful if you checked how much memory is being used and that could explain the delay.

Lastly, when seeking we used to have a "seek loading" state that would show when seeking and remain until the audio started playing. I think we should bring this back but I'm not sure it would help in your case because if the progress bar is moving after the initial seek then the native HTML audio element is sending events that the time is changing.

@advplyr commented on GitHub (Aug 14, 2022): It may be beneficial to look at the server logs and the console log in the browser. It would be good to know if the audio file is direct playing or being transcoded. There has been issues reported with Firefox failing to direct play audio files which then triggers abs to fallback to transcoding. It is likely there are improvements we can make to the memory usage, it could also be helpful if you checked how much memory is being used and that could explain the delay. Lastly, when seeking we used to have a "seek loading" state that would show when seeking and remain until the audio started playing. I think we should bring this back but I'm not sure it would help in your case because if the progress bar is moving after the initial seek then the native HTML audio element is sending events that the time is changing.
Author
Owner

@ameyp commented on GitHub (Aug 14, 2022):

Where can I find the server logs? In the terminal (STDOUT/STDERR I guess) I don't see anything related to playback. Nothing new appears when I play or pause.

/metadata/logs/daily/2022-08-14.txt has the same entries as the terminal, but in JSON.

In the browser's console, I see logs appear as soon as I click on the Play/Pause button:

[PlayerHandler] Player state change LOADED [f67de89.js:1:186649](https://audiobookshelf.wirywolf.com/_nuxt/f67de89.js)
[PlayerHandler] Player state change PLAYING [f67de89.js:1:186649](https://audiobookshelf.wirywolf.com/_nuxt/f67de89.js)
[PlayerHandler] Player state change PAUSED [f67de89.js:1:186649](https://audiobookshelf.wirywolf.com/_nuxt/f67de89.js)
[PlayerHandler] Player state change PLAYING [f67de89.js:1:186649](https://audiobookshelf.wirywolf.com/_nuxt/f67de89.js)
[PlayerHandler] Player state change PAUSED

How can I check whether the audio is being direct played or transcoded?

CPU and Memory both seem fine. I ran top while the audio was absent with the progress bar moving, and CPU usage was at 1-3% usr, 0% sys, 97% idle. Memory 4242344K used, 1841456K free on the server. On the client, all four cores were idle (1-2%), and 2.5GB free memory.

@ameyp commented on GitHub (Aug 14, 2022): Where can I find the server logs? In the terminal (STDOUT/STDERR I guess) I don't see anything related to playback. Nothing new appears when I play or pause. `/metadata/logs/daily/2022-08-14.txt` has the same entries as the terminal, but in JSON. In the browser's console, I see logs appear as soon as I click on the Play/Pause button: ``` [PlayerHandler] Player state change LOADED [f67de89.js:1:186649](https://audiobookshelf.wirywolf.com/_nuxt/f67de89.js) [PlayerHandler] Player state change PLAYING [f67de89.js:1:186649](https://audiobookshelf.wirywolf.com/_nuxt/f67de89.js) [PlayerHandler] Player state change PAUSED [f67de89.js:1:186649](https://audiobookshelf.wirywolf.com/_nuxt/f67de89.js) [PlayerHandler] Player state change PLAYING [f67de89.js:1:186649](https://audiobookshelf.wirywolf.com/_nuxt/f67de89.js) [PlayerHandler] Player state change PAUSED ``` How can I check whether the audio is being direct played or transcoded? CPU and Memory both seem fine. I ran `top` while the audio was absent with the progress bar moving, and CPU usage was at 1-3% usr, 0% sys, 97% idle. Memory 4242344K used, 1841456K free on the server. On the client, all four cores were idle (1-2%), and 2.5GB free memory.
Author
Owner

@ameyp commented on GitHub (Aug 15, 2022):

I took a look at the code, and yeah, it's weird. The timeupdate event starts firing as soon as I click on the Play button, but no audio plays for a solid few seconds.

@ameyp commented on GitHub (Aug 15, 2022): I took a look at the code, and yeah, it's weird. The `timeupdate` event starts firing as soon as I click on the Play button, but no audio plays for a solid few seconds.
Author
Owner

@advplyr commented on GitHub (Aug 16, 2022):

You would see if it was transcoding in either the server logs or the browser console log so I'm assuming it is direct playing.

The user you are logged into shouldn't make any difference. Are you able to isolate this to specific audio files and reproduce this every time?

@advplyr commented on GitHub (Aug 16, 2022): You would see if it was transcoding in either the server logs or the browser console log so I'm assuming it is direct playing. The user you are logged into shouldn't make any difference. Are you able to isolate this to specific audio files and reproduce this every time?
Author
Owner

@ameyp commented on GitHub (Aug 17, 2022):

Yes, but it might be a file-specific problem. I used ffmpeg to convert the problematic audiobook from mp3 to m4b, and the problem doesn't seem to be occurring anymore.

@ameyp commented on GitHub (Aug 17, 2022): Yes, but it might be a file-specific problem. I used ffmpeg to convert the problematic audiobook from mp3 to m4b, and the problem doesn't seem to be occurring anymore.
Author
Owner

@advplyr commented on GitHub (Aug 20, 2022):

That's good news then. If you find anymore details hinting this may be a bug we can resolve then we can reopen this.

@advplyr commented on GitHub (Aug 20, 2022): That's good news then. If you find anymore details hinting this may be a bug we can resolve then we can reopen this.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#585