jeffvli / feishin

A modern self-hosted music player.
https://feishin.vercel.app
GNU General Public License v3.0
2.91k stars 123 forks source link

Playback stops mid-song after a few songs #608

Open TacoCake opened 6 months ago

TacoCake commented 6 months ago

Expected Behavior

Playback doesn't stop unless the user tells it to.

Current Behavior

This is especially noticeable when listening to a playlist, after playing a few songs (the number seems random), playback random stops mid-way through a song.

Doesn't happen with the default navidrome web client, and with Tempo (android client).

Steps to Reproduce

  1. Start playlist in shuffle mode
  2. Play a few songs
  3. wait
  4. Notice it stops by itself.

Possible Solution

Might be related to this PR: https://github.com/jeffvli/feishin/issues/538

Context

I've encountered this issue on windows AND Linux. I've only really tried the Web Audio player

Application version

v0.6.1

Operating System and version

Windows 10 Desktop, Linux (OpenSUSE tumbleweed appimage) Desktop

Server and Version

Navidrome v0.52.0

Node Version (if developing locally)

No response

archer3cl commented 6 months ago

I want to add that this also happens with the desktop version. Some times the player refuses to keep playing some songs. I have tested with Navidrome Web UI, playing the same songs and it has the same behavior. Finally, I downloaded a different desktop client Supersonic and there where no issues with the songs.

All tested songs are FLAC format.

Hope this helps to narrow down the issue.

iiPythonx commented 6 months ago

If you're able to switch to the mpv player, does it still have these issues? Also how many songs are we talking here, I'll gladly throw on a playlist and see if I can replicate it if I know roughly how many to wait for.

archer3cl commented 6 months ago

If you're able to switch to the mpv player, does it still have these issues? Also how many songs are we talking here, I'll gladly throw on a playlist and see if I can replicate it if I know roughly how many to wait for.

You are right. Switching to MPV fixes the issue. As for the number of songs, I'm not sure. But once it happens I can play other songs and if I return to one that was failing, it still fails.

Maybe just put a 1hr playlist, it usually happens before that.

jbren77 commented 3 months ago

I'm seeing the same issue here on the latest release. Initially, I encountered this problem while running Jellyfin on a Windows 10 LTSC setup, with both the web player and MPV player. Despite migrating my Jellyfin server to a Docker container on a Linux environment, the issue persists. When I use a different music client like Supersonic, this problem does not occur.

Some things I've noticed, sorry if it's not the clearest:

jeffvli commented 3 months ago

@jbren77 Try to reproduce it with the browser devtools window open.

  1. On the sidebar, click the file menu button and click Open browser devtools
  2. Switch to the Network tab inside the devtools, and toggle the Preserve log checkbox to on
  3. Keep the devtools open and use the app as you normally would
  4. When the problem happens, look at the devtools window and check which network request the app is stuck on. The status column should show as Pending or similar

When I monitor the jellyfin dashboard while a song is stuck in Feishin, I can actually see the song being served and the timestamp increasing, but it does not play in Feishin.

This doesn't indicate that the song is playing in the client. The jellyfin dashboard listens for the client app's scrobble event which Feishin sends to the Jellyfin, and then Jellyfin automatically increases the current timestamp whether or not the song is actually playing.

jbren77 commented 3 months ago

Thanks for the steps & clarification @jeffvli.

The request that gets hung up first has a url like this: https://jellyfin.my-domain/audio/value/universal?userId=value&deviceId=&audioCodec=aac&apiKey=value&playSessionId=&container=opus,mp3,aac,m4a,m4b,flac,wav,ogg&transcodingContainer=ts&transcodingProtocol=hls

then multiple progress events show up as pending after it. Here's a screenshot: feishin-pending

then when it loads it looks like this: feishin-loaded

more info on the event at the top:

feishin-loaded-moredetails

I wouldn't be surprised if it has something to do with my setup honestly. Happy to provide more info just lmk.

jeffvli commented 3 months ago

@jbren77 Your issue seems similar to https://github.com/jeffvli/feishin/issues/681#issuecomment-2264996963. Take a look at your reverse proxy configuration as well as trying to reproduce the issue with the private address to see if it persists.

jbren77 commented 3 months ago

Ok yes, this issue looks very identical to what I'm seeing! That is almost certainly the fix. I don't have access to the buffering setting with current setup so I'll look into switching to nginx and modifying that setting when I have some more time.

Thanks a lot for your replies and for working on this player!

kgarner7 commented 2 months ago

Is this issue still reproducible on 0.8.1?

llek1000 commented 2 months ago

Hello, I am jumping in here to clear up a few things as I originally reported the #681 issue. I was pretty busy at the time, and did not test this thoroughly enough. The issue still persists, even after modifying my reverse proxy settings. The issue is not present when utilising MPV player instead of the web player, so I think that the issue can be narrowed down to this. I am really sorry for leaving you with a "fix" that does not work. I switched to MPV on my devices, and did not have the energy to further diagnose this.

I reopened the original issue, and edited my comment with the "fix", just to let other people know. The thing is that I am connecting to Navidrome, and @jbren77 is connecting to Jellyfin, but we're experiencing a very similiar, if not the same issue.