Home of the Squeezebox™ & Transporter® network music players.
Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1
    Senior Member
    Join Date
    Oct 2010
    Posts
    180

    Long delay starting FLAC playback

    I just downloaded the latest Julien Baker (Turn Out the Lights) in FLAC 24/96k from HD Tracks. The start of each track took about 30 seconds before the music started. Really annoying since track 1 should flow gapless into track 2. It was very consistent. Every time I tried to play a track, there was 30 seconds of nothing before the track started playing, even though the display on the Touch said it was playing. Then the song would start (from the beginning of the track) and play normally. Until the next track. Then the same 30 seconds of silence. I tried rescanning, no change.
    I though it had something to do with the album art. The cover was 4000 x 4000 pixels, so maybe it took a long time to load. But I downsized it and replaced it with a 400 x 400 pixel cover. I used MP3Tag to replace the artwork. Still no change in the startup time.
    I opened the FLAC files with an audio editor (Goldwave) and there was no gap at the beginning of the tracks. I finally just used Goldwave to re-save the files (FLAC Hi-compression, 24/96k) and now the album plays like it should. I still have the original version. I can go back to it and it has the same long delay, but the new version plays like it should.

    Looking at the info screen for track 1 on iPeng:
    The original:
    File Format: FLAC
    Duration: 1:28
    Bitrate: 3932kbps VBR
    Sample Rate:96.0 kHz
    Sample Size: 24 bits
    File Length 51,181,684


    The new version:
    File Format: FLAC
    Duration: 1:28
    Bitrate: 2593kbps VBR
    Sample Rate:96.0 kHz
    Sample Size: 24 bits
    File Length 28,747,169

    Obviously the compression settings must be way different, but why would that cause such a consistently long startup time playing each track? I've never had this issue on any other FLAC download. Just curious what was going on....

    Terry

  2. #2
    Senior Member
    Join Date
    Apr 2005
    Location
    Watford, UK
    Posts
    1,846
    Quote Originally Posted by TerryS View Post
    Looking at the info screen for track 1 on iPeng:
    The original:
    File Format: FLAC
    Duration: 1:28
    Bitrate: 3932kbps VBR
    Sample Rate:96.0 kHz
    Sample Size: 24 bits
    File Length 51,181,684
    A 96kHz 24bit stereo file of length 1:28 would be 50,688,000 *uncompressed*. So your original FLAC file would appear to have no compression at all. (Maybe the additional half MB is the artwork).

    I wonder if it's possible that although it has a FLAC file suffix, it's actually just a normal LPCM file?
    Could it be that the LMS playback system is somehow smart enough to figure this out after a FLAC decode fails?
    Perhaps it takes a while for the decode to fail, and then LMS falls back on streaming it as PCM?
    Or perhaps it's recognising that it isn't FLAC and choosing to encode it prior to streaming - hence the delay?

    These are all just random musings, but the original file size is very suspicious.
    Transporter -> ATC SCM100A

  3. #3
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    15,316
    30secs is a very long time. With LMS default setting - LMS will send the Flac direct to Touch which will decode the file natively & start playing decode after about 2Mbytes have been sent.

    so either
    1. Network connection is erratic and/oir not good.
    2. There is some extra processing going on in the LMS server as a result of non default settings. 30secs delay would mean a lot of processing (e.g. resampling) on a low power system (e.g. NAS).
    3. Something odd in the file format (e.g. multiple tracks in one file with embedded cue sheet)

    Basically - you have give a lot more detailed info on your setup and the files.

    Any messages in the log file ?

    To get a little more detail on the problems. Stop LMS and delete log file, restart LMS, enable logging Player.source to DEBUG and then play the file. ZIP log file and attach the zipped log file to a post.

  4. #4
    Senior Member
    Join Date
    Oct 2010
    Posts
    180
    Well this is embarrassing to admit, but I don't know how to browse to a file location on my NAS, so I can't delete the log file. I only know how to use the web server interface for the NAS and LMS. But I did set the debug level on Player.source and restart the server. Then I captured the log file from the server page after playing track 1. I'm attaching what I captured. It shows that I restarted LMS at 17-10-31 19:05:45
    I tried to play the song at 17-10-31 19:05:50.9378

    It takes 32 seconds for the song to start playing according to the LMS screen. The log seems to show it starting at 17-10-31 19:06:33.9996

    I'm running on a QNAP TS-251 NAS over Wi-Fi. I don't know if you can tell what is going on from the log. Re-saving the file as FLAC with Goldwave has solve the problem, so it is just out of curiosity that I'm asking.
    I have a strong wi-fi connection and don't usually have any buffering problems. And it seems too consistent to be caused by buffering due to a poor wi-fi connection. It is always 30 seconds, even between songs on an album.

    I agree that the size makes it look like it is not compressed at all. Like maybe it is not a FLAC file even though the file extension says it is.

    Terry
    Attached Files Attached Files

  5. #5
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    15,316
    Quote Originally Posted by TerryS View Post
    I have a strong wi-fi connection and don't usually have any buffering problems. And it seems too consistent to be caused by buffering due to a poor wi-fi connection. It is always 30 seconds, even between songs on an album.
    Yes and No - failures often have backup retry mechanism which have fixed timeouts. Also with large files - timing can become very consistent as caches etc are exhausted.
    So wifi issues couldn't be excluded - rememebr it is the player which tells LMS when the internal buffer has reached a threshold and so LMS can give the command to start playing.
    The is when LMS has decided how to play the files (i.e. direct by Touch)
    Code:
    [17-10-31 19:06:05.6479] Slim::Player::TranscodingHelper::getConvertCommand2 (428) Matched: flc->flc via: -
    This is when the player has told LMS that it has enough data to start playing - about 28 secs later.
    Code:
    [17-10-31 19:06:33.9986] Slim::Player::StreamingController::playerTrackStarted (2286) 00:04:20:22:31:6d
    It is possible to get more details of buffer filling/ fullness by enabling the slimproto logging

    I agree that the size makes it look like it is not compressed at all. Like maybe it is not a FLAC file even though the file extension says it is.
    According to the log the file is being treated as a Flac file and sent to the player unprocessed. If there is 25Mb of filler in the header of the file which may be the cause of the delay - the whole file is sent to player serially and player has to get past the filler. Still taking 30 secs to skip past 25Mbytes seems to be a bit slow.

    If you are still curious - I'd investigate the 25Mbytes difference betrween the two files - is it compression, tags or a bit of both ?
    That said - there may be better uses of your time.

  6. #6
    Senior Member
    Join Date
    Feb 2011
    Location
    Cheshire, UK
    Posts
    2,843
    Quote Originally Posted by TerryS View Post
    Well this is embarrassing to admit, but I don't know how to browse to a file location on my NAS, so I can't delete the log file. I only know how to use the web server interface for the NAS and LMS.
    If you are a Windows person the easiest option is WinSCP. - https://winscp.net/eng/download.php
    Download and install it, leave the defaults, set up a connection to your NAS using its IP address and select SCP protocol.
    Username is admin password is the usual web password for the NAS.
    Left is local, right is the NAS - just don't go deleting stuff if you don't understand whats what.

    Name:  2017-11-01 10_10_06-flac - admin@10.0.0.2 - WinSCP.jpg
Views: 126
Size:  72.0 KB
    Pi3 with piCoreplayer music on QNAP TS419p via NFS iThingys/iPeng/Tablets/Jogglers
    Living Room - Joggler & SB3 -> Onkyo TS606 - > Celestion Ditton F20s
    Office - Pi -> Sony TA FE320 -> Celestion F10s / Pi & SB3 -> Onkyo CRN 755 -> Wharfedale Modus Cubes
    Dining Room -> SB Boom Kitchen -> UE Radio (upgraded to SB Radio)
    Bedroom (Bedside) - SB Touch -> Topping TP21 -> AKG Headphones

  7. #7
    Senior Member
    Join Date
    Oct 2010
    Posts
    180
    Thanks for the tip on browsing to the NAS files. I will definitely give WINSCP a try.

    On the long start delay,
    The original FLAC files from HD Tracks had a 4000 x 4000 pixel cover art embedded in each track. My first thought is that was so large it was delaying the start of the music while it streamed the album cover. So the first thing I tried was shrinking the cover art to 400 x 400 pixels and using MP3Tag to replace the cover art. That didn't seems to make any difference in the start up time, but now I'm wondering if somehow the FLAC file still had a large space reserved for the larger cover art file. Then re-saving the FLAC file with Goldwave reduced the file size by reducing the space for the cover art.
    I don't know if there is any way to examine the FLAC file contents and see how much is music and how much is tags and art.

    Thanks for everyone's help with this. I'm learning a lot.

    Terry

  8. #8
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    15,316
    Quote Originally Posted by TerryS View Post
    I don't know if there is any way to examine the FLAC file contents and see how much is music and how much is tags and art.
    There are many analysis tools - something like mediainfo might be a good starting point.

  9. #9
    Senior Member
    Join Date
    Oct 2010
    Posts
    180
    Here is what MediaInfo says about the file that loads slowly:
    General
    Complete name : C:\Users\Terry\Music\HDtracks\Julien Baker\Turn Out the Lights\01-Over.flac
    Format : FLAC
    Format/Info : Free Lossless Audio Codec
    File size : 48.8 MiB
    Duration : 1 min 28 s
    Overall bit rate mode : Variable
    Overall bit rate : 4 633 kb/s
    Album : Turn Out the Lights
    Album/Performer : Julien Baker
    Part : 1
    Part/Total : 1
    Track name : Over
    Track name/Position : 01
    Track name/Total : 11
    Performer : Julien Baker
    Producer : Matador
    Genre : Alternative
    Description : OLE11297
    Recorded date : 2017
    Writing application : Lavf57.34.103
    ISRC : USMTD1710061
    Copyright : 2017 Matador Records Limited
    Cover : Yes
    Cover type : Cover (front)
    Cover MIME : image/jpeg
    UPC : 744861112976

    Audio
    Format : FLAC
    Format/Info : Free Lossless Audio Codec
    Duration : 1 min 28 s
    Bit rate mode : Variable
    Bit rate : 3 933 kb/s
    Channel(s) : 2 channels
    Channel positions : Front: L R
    Sampling rate : 96.0 kHz
    Bit depth : 24 bits
    Stream size : 41.4 MiB (85%)
    Writing library : Lavf57.34.103




    And here is the file that plays like it should:
    General
    Complete name : C:\Users\Terry\Music\Music\Hi-Res\Julien Baker\Turn Out the Lights\01-Over.flac
    Format : FLAC
    Format/Info : Free Lossless Audio Codec
    File size : 27.4 MiB
    Duration : 1 min 28 s
    Overall bit rate mode : Variable
    Overall bit rate : 2 602 kb/s
    Album : Turn Out the Lights
    Album/Performer : Julien Baker
    Track name : Over
    Track name/Position : 01
    Performer : Julien Baker
    Genre : Alternative
    Description : OLE11297
    Recorded date : 2017
    ISRC : USMTD1710061
    Copyright : 2017 Matador Records Limited
    Cover : Yes
    Cover type : Cover (front)
    Cover MIME : image/jpeg

    Audio
    Format : FLAC
    Format/Info : Free Lossless Audio Codec
    Duration : 1 min 28 s
    Bit rate mode : Variable
    Bit rate : 2 593 kb/s
    Channel(s) : 2 channels
    Channel positions : Front: L R
    Sampling rate : 96.0 kHz
    Bit depth : 24 bits
    Stream size : 27.3 MiB (100%)
    Writing library : libFLAC 1.3.2 (UTC 2017-01-01)


    About all I can conclude is that the one that loads slowly has a file size of 48.8M and a stream size of 41.4M = 7.4M of something extra.
    The one that plays correctly has a file size of 27.4M and a stream size of 27.3M = 0.1M of something extra.
    So the problematic file has a lot more of something besides music.

    Terry

  10. #10
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    15,316
    Did a Google on the encoder Lavf57.34.103 with terms HD and Flac and there are quite a few reports of unplayable files such as
    UPDATE 17October2016: Seems that the SuperMini does not support the Encoder "FLAC Lavf57.34.103". I had purchased the FLAC 24bit/96KHz album, SCATTERED ASHES, from HDtracks that used this encoder - and the PMP would not play it. After a bit of fiddling about, I finally used dBpoweramp's converter to simply reconverted right back to FLAC 24/96KHz, and thus into dBpoweramp's standard encoder, "FLAC reference libFLAC 1.3.1 20141125". And album plays a charm now.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •