App waits about ten seconds before starting to stream transcoded audio from the server

Issue description:

I’m using Navidrome as media server. I’ve set the max bitrate to 96k to force transcode.

When I open any non-downloaded song, the play status changes to “pause” and waits for about ten seconds before it actually starts streaming.

I’ve checked the logs of Navidrome, it said “write tcp xxx:xxx → xxx:xxx write: broken pipe” and sometimes “http: wrote more than the declared Content-Length”.

When I pause a song and resume it, the above problem does not occur, and there are no new errors in Navidrome’s logs.

I’ve also tried substreamer, the above problem didn’t occur, and there are no errors in Navidrome’s logs.

When the app automaticly switch to the next song, the above problem didn’t occur. But this is probably because the app pre-caches the music, as I still see the same error in Navidrome’s logs.


debug.log (992.1 KB)

Additional Information:

Navidrome’s logs:

From the logs transcoding does not work properly, Symfonium ask for estimated content length to support seeking.
This is necessary as the Subsonic API does not support timeOffset for music don’t know why…

Seems your navidrome sends wrong estimated value then bug the transcoding when Exoplayer tries to get the metadata on it. After the 10 seconds timeout it plays without transcoding.

I suppose I’ll need to stop asking for estimated content length and drop seeking for Subsonic since it’s broken for 2 servers now :frowning:

Please test attached APK.

app-beta-final.apk (5.6 MB)

The attached apk works fine. The opened music starts streaming immediately.

Navidrome still reports errors from time to time, but very infrequently and randomly. I don’t know whether it’s due to Navidrome or Symfonium. Anyway, these errors do not affect the streaming.

The app’s log: debug.log (313.6 KB)

I think it’s most probably caused by ffmpeg and the reason of the delay you had some glitches at the end of files. As long as it does not impact playback this does not really matters.

Just check that any cache directory for transcoding on navidrome is property cleaned up.