BLeeEZ / amperfy

Amperfy is an iOS/iPadOS/macOS app to play songs from an Ampache or Subsonic server
GNU General Public License v3.0
457 stars 37 forks source link

(Regression?) songs sometimes restart from the beginning #305

Open javiermolina1234 opened 1 month ago

javiermolina1234 commented 1 month ago

Sometimes (not always) a song will be playing and suddenly restart from the beginning. There do not seem to be any messages in the event log related to this.

Amperfy: Version 1.2.1, Build Number 3. Device: iPhone 6S Plus, iOS 15.8.2 Server: Navidrome 0.52.5

Whatever the previous version was on the App Store was not affected.

eprudspk commented 1 month ago

I have had the same issue for a few months now. iPhone 11, newest iOS version.

Though it's not really predictable when it will happen, it has been happening to me for a few versions at least.

TacoCake commented 1 month ago

I'm also getting this issue. Very annoying

alangrafu commented 1 month ago

It seems this issue is due the fact that sometimes Amperfy doesn't get the full length of the song (In CarPlay, there is no timeline bar, in iOS, the ending time appears as "--:--"). My guess is that for whatever reason this happens, Amperfy tries to play as much as it can from the song and when it reaches the end of the buffer, it simply restarts from the beginning.

The solution is to make sure the client gets the length of the song every time.

BLeeEZ commented 1 month ago

@alangrafu yes, this could be the root cause.

„—:—„ is displayed when Amperfy can’t get a length from server while streaming. This is usually a server issue related to transcoding. I currently have no access to my debug environment to double check it.

Here are some work arounds to mitigate that problem for now:

alangrafu commented 1 month ago

Yeah, I can confirm the length of the song is not available.

I tried configuring Navidrome (my airsonic server) to serve transcoded audio (in case that solved the issue) to no avail.

The problem disabling transcoding is mostly when using cellular and listening to flac audio files I guess.

6C6CCED5-9FD0-4CDE-BFBC-8003671DE274_1_101_o

stapelberg commented 3 weeks ago

I also noticed this issue. It only happens when Amperfy is streaming the song (downloaded songs never have this issue). My suspicion is that temporary server errors are the cause, and the error recovery is what goes wrong.

Is there a way to inject faults in iOS development? As in, could we simulate a server sometimes becoming unreachable in the middle of streaming to trigger this issue reliably?