BLeeEZ / amperfy

Amperfy is an iOS app to play songs from an Ampache or Subsonic server
GNU General Public License v3.0
387 stars 34 forks source link

[FEATURE] Gapless playback not working #96

Open bbsixzz opened 2 years ago

bbsixzz commented 2 years ago

iPhone SE 2016 running iOS 15.2.1, Amperfy 1.0.8 (4)

Gapless playback isn't working, there is a clear cut between tracks.

I'm guessing this is a bug and not a missing feature.

BLeeEZ commented 2 years ago

This is a missing feature 😀

BLeeEZ commented 2 years ago

I did some reading about gap play playback. For this feature I need to add a new third party library and the whole player needs a refactoring. I don't know when I will tackle this feature.

bbsixzz commented 2 years ago

Alright I understand.

It's definitely an important feature and a dealbreaker for many albums (Pink Floyd).

Do you have any donate option? I'm sure people would chip in for your efforts.

stefan1983 commented 2 years ago

+1

Any update here yet? Thanks!

BLeeEZ commented 2 years ago

No update yet. This feature will not come before v1.1.1.

BLeeEZ commented 2 years ago

I did some investigation on this topic. I used this package: https://github.com/dimitris-c/AudioStreaming The investigation is pushed in this feature branch: https://github.com/BLeeEZ/amperfy/tree/gapless

During my investigation I noticed that there is still a small but noticeable gap. I opened an issue regarding this issue: https://github.com/dimitris-c/AudioStreaming/issues/38

stefan1983 commented 2 years ago

Nice, good luck with that. Hope it can be resolved ;)

bbsixzz commented 2 years ago

Very nice, this is the last puzzle piece to reach important feature parity with other apps.

If the above package doesn't work you can check out https://github.com/einsteinx2/iSubMusicStreamer

The gapless playback works flawlessly there so maybe you can use the same framework.

BLeeEZ commented 2 years ago

@bbsixzz Thank you for the tip. To be honest iSub was the first repository I looked for the gapless implementation. He wrote his own implementation and it is interconnected with other player functionality. For that reason it is not usable for Amperfy.

BLeeEZ commented 2 years ago

I have talked with the developer of AudioStreaming. He mentioned that while playing mp3 a small gap can still occur/is unavoidable. Other file types shouldn’t be problem. You can read the conversation here: https://github.com/dimitris-c/AudioStreaming/issues/38 What do you think. Should we go this route? Is this a limitation that is bothering us? Notice: I will only use a third party package for this feature. I am not going to implement a gapless player solution by myself (I am open for pull requests). Or is there an alternative I am not aware of?

bbsixzz commented 2 years ago

I think not having (true) gapless playback is a serious limitation.

People coming from Apple Music, Spotify etc. will be put off instantly upon discovering the lack of it.

There is just too much music out there that requires it, we need a different solution.

bbsixzz commented 2 years ago

dimitris-c:

iSub uses BASS player by unseen https://www.un4seen.com under the hood - so it's quite different than AudioStreaming approach, which uses AudioFileStream from Core Audio to play audio content.

dweymouth commented 1 year ago

He mentioned that while playing mp3 a small gap can still occur/is unavoidable. Other file types shouldn’t be problem.

I don't think this is an issue. mp3 is generally not a format compatible with gapless playback since it doesn't provide metadata to ensure the length of the decoded audio is sample-accurate to the original. I think it's worth continuing to evaluate the AudioStreaming package and if it can playback FLAC and Opus gaplessly than it's good to go.

stefan1983 commented 1 year ago

No update yet. This feature will not come before v1.1.1.

We are at 1.1.3 now, any idea when gapless playback will be finally supported? :)

Thanks

bbsixzz commented 1 year ago

Not the right answer but I'm using https://github.com/dweymouth/supersonic now on desktop which has an mpv backend and plays gapless.

pjadeslandes commented 11 months ago

Hi there @BLeeEZ . Hope you're well. I recently adopted your player - I think it's the best Navidrome client on iOS by a long way - by far my favourite UX, and the fully integrated, one-click library download / offline mode is really important to me. If you could release your gapless playback fix, this would honestly make it the perfect iOS player for me. I don't need mp3 support - I haven't used that format for years, and I'd have thought the average Navidrome / Subsonic user would be interested in superior formats. Any chance you think you might be able to release it? I fully appreciate you do not want to make it yourself, and your 3rd party option seems great to me.

S-n-d commented 1 week ago

Hey @BLeeEZ thanks for your hard work! With the addition of transcoding in the 1.2.1 release this is almost the perfect iOS player for listening to my library on the go! I listen to a lot of mixed DJ compilations, so as you might imagine the lack of gapless support really is a vibe killer 😉 Would it be possible to share your thoughts on this? Maybe let us know why this hasn't been implemented yet or what is blocking it?

BLeeEZ commented 1 week ago

Hi, I tested in the past different audio engines:

None of them worked perfectly. I encountered in all engines some scenarios where a small gape was noticeable. Some performed in 90% of cases good (without a noticeable gap).

I will only switch the audio engine if it works in 100% of cases. I learned from the past that I will be flooded with bug tickets about these 10% of failing cases.

I will not write my own audio engine, this would go beyond the purpose of this app. I will not implement any additional audio engines because testing all the engines mentioned above already took way too much of my time.

I will test audio engine implementation provided as Pull Request.

S-n-d commented 1 week ago

Hi, thanks for your answer.

I fully understand your opinion on having a 100% working solution and appreciate all of your time and work evaluating different audio engines. It should not be your task to re-invent the wheel. Unfortunately mp3 was not designed with gapless support in mind so I guess that it will always remain a problem. People still using mp3 should be aware that their codec has inherent flaws.

As stated above in this thread, the average Navidrome user is probably not interested in a legacy codec like mp3. AAC and/or OPUS have become a standard now. Keep in mind that the target audience for Amperfy is proobably more tech savvy than your average music listener.

I think it's worth continuing to evaluate the AudioStreaming package. Gapless support really is the one killer feature that is missing to make this the number 1 music-on-the-go iOS app. Just my 2 cents 😊