Offline files does not skip forward or back

App version

Production

Issue description

Hello all,

So I have been using Symfonium on multiple DAPs without an issue, syncing my navidrome music to play offline.

Today, I tried to play some music but I am unable to skip forward or back on played music, when trying, the track just goes back to the start and starts to play again.

Frustrating, I hope for a solution.

Thanks.

Device type

Phone

Media provider

Navidrome

Steps to reproduce

Sync some music to offline permanent cache, play the files, those files cannot be skipped forward or back.

I searched existing issues first

on

I understand that logs are mandatory

on

Log upload name / description

biofr0g

You are forcing FLAC transcoding on server side and Navidrome applies it. This generate unseekable flacs.

@deluan This is not the first report I got, even with the new api.

{
  "name": "Symfonium",
  "platform": "Android",
  "maxAudioBitrate": 0,
  "maxTranscodingAudioBitrate": 0,
  "directPlayProfiles": [
    {
      "containers": [
        "mp4",
        "mka",
        "m4a",
        "mp3",
        "mp2",
        "wav",
        "flac",
        "ogg",
        "alac",
        "opus",
        "vorbis",
        "dsf",
        "dff",
        "dsdiff",
        "iff"
      ],
      "audioCodecs": [],
      "protocols": [],
      "maxAudioChannels": 0
    }
  ],
  "transcodingProfiles": [
    {
      "container": "flac",
      "audioCodec": "flac",
      "protocol": "http",
      "maxAudioChannels": 6
    },
    {
      "container": "ogg",
      "audioCodec": "opus",
      "protocol": "http",
      "maxAudioChannels": 6
    },
    {
      "container": "mp3",
      "audioCodec": "mp3",
      "protocol": "http",
      "maxAudioChannels": 2
    }
  ],
  "codecProfiles": [
    {
      "type": "AudioCodec",
      "name": "vorbis",
      "limitations": [
        {
          "name": "audioSamplerate",
          "comparison": "LessThanEqual",
          "values": [
            "48000"
          ],
          "required": true
        }
      ]
    },
    {
      "type": "AudioCodec",
      "name": "opus",
      "limitations": [
        {
          "name": "audioSamplerate",
          "comparison": "LessThanEqual",
          "values": [
            "48000"
          ],
          "required": true
        }
      ]
    }
  ]
}
{
  "subsonic-response": {
    "status": "ok",
    "version": "1.16.1",
    "type": "navidrome",
    "serverVersion": "0.63.2 (be10f89c)",
    "openSubsonic": true,
    "transcodeDecision": {
      "canDirectPlay": false,
      "canTranscode": true,
      "transcodeParams": "xxxxxx",
      "sourceStream": {
        "protocol": "http",
        "container": "flac",
        "codec": "flac",
        "audioChannels": 2,
        "audioBitrate": 1026000,
        "audioSamplerate": 44100,
        "audioBitdepth": 16
      },
      "transcodeStream": {
        "protocol": "http",
        "container": "flac",
        "codec": "flac",
        "audioChannels": 2,
        "audioSamplerate": 44100,
        "audioBitdepth": 16
      }
    }
  }
}

Don’t know what they force and why, but with the new API Navidrome should not transcode FLAC to FLAC.

How do I cancel transcoding ?

Also, why does it affect only offline files , direct streams from navidrome are ok

You configured something on Navidrome side.

And playback works as Symfonium knows there’s transcoding and request new transcode sessions at the proper places.

Symfonium can’t fix the broken FLAC easily.

I think I found the issue, for some reason, I had transcoding to flac set on the Symfonium player in Navidrome, I never set it​:person_facepalming: I think I need to recache all my files again.

Also, can you please add a way to name the Symfonium instance so it could be recognizable easily ? I have a phone and a dap which identify the same.

PIng @deluan in case you did not see my post above about abnormal flac to flac transcodes.

After changing that setting it is working good again

Yes but this is still something that should be addressed on Navidrome side in the transcoding request handling.

Hey @Tolriq

You are right, and it turned out to be two bugs feeding one symptom.

The first is the one you spotted. ForceFormat was clearing the direct play
profiles unconditionally, so a player row set to “transcode to flac” re-encoded
a FLAC source to FLAC. Pointless work. Fixed.

The second is the one that actually broke seeking, and it is not specific to
flac to flac. Navidrome pipes ffmpeg’s stdout. The FLAC muxer writes STREAMINFO before
it knows the length, then rewinds at the end to fill in total_samples. A pipe is
not seekable, so ffmpeg logs “unable to rewrite FLAC header” and the field stays
0. Decoders need it to turn a timestamp into a byte offset.

Streaming survives because Symfonium re-requests with a new offset, which is why
only the offline copy was broken. But any legitimate FLAC transcode had the same
problem, 24/96 down to 16/44 for example, so dropping the player setting only
hid it. FLAC is the only one of our default targets that fails this way. mp3,
opus and aac all recover the duration from the bitrate or the granulepos.

Navidrome now rewrites total_samples as the first 26 bytes of the output go past,
using the duration it already has and the sample rate from the header ffmpeg
just wrote.

Both are in #6105. Not merged yet, but out of draft and tested end to end on a
real library. Sorry this one sat for so long.