Home of the Squeezebox™ & Transporter® network music players.
Results 1 to 9 of 9
  1. #1
    Junior Member
    Join Date
    Jul 2018
    Posts
    4

    Spotty lags behind

    I'm using Spotty in spotify connect mode. However when I choose my squeezebox receiver under 'devices available' in the Spotify app and start playing a song, I have to wait for about 20s for the song to begin. The same thing happens when I change tracks or start another song from another playlist.

    I have the impression that LMS is converting the pcm stream it receives from Spotify, hence the lag.

    I found a file 'custom-convert.conf' under '/opt/logitechmediaserver/cache/InstalledPlugins/Plugins/Spotty' in my linux distro which seems to control conversion. However I cannot interprete its contents in an easy way.

    On top of that, my subscription (Spotify Premium for Family) should output 320 kbps ogg Vorbis which my distro can decode without problem so why the conversion ?
    On the other hand, I have also the Spotify application installed on my linux distro and here no lag and no conversion takes place as far as I can notice.

    Any idea how to disable the conversion in Spotty ?

  2. #2
    Senior Member pippin's Avatar
    Join Date
    Oct 2007
    Location
    Berlin
    Posts
    14,414
    I don’t know why you have the lag but it’s not the conversion.
    The conversion is necessary because Spotify‘s Ogg Vorbis streams are encrypted and can be read by nothing except Spotify‘s run-time library, which isn’t running on the Squeezebox
    ---
    learn more about iPeng, the iPhone and iPad remote for the Squeezebox and
    Logitech UE Smart Radio as well as iPeng Party, the free Party-App,
    at penguinlovesmusic.com
    New: iPeng 9, the Universal App for iPhone, iPad and Apple Watch

  3. #3
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    20,014

    Spotty lags behind

    > I have the impression that LMS is converting the pcm stream it receives
    > from Spotify, hence the lag.


    You can check this in Settings/Advanced/File Formats. Spotty would
    likely transcode from PCM to Flac - which you can disable. Check the
    settings for "spt" or "Spotty".

    Whether this is the root cause of the delay you're seeing I don't know.
    Maybe you should provide some information about your system.

    --

    Michael

  4. #4
    Junior Member
    Join Date
    Jul 2018
    Posts
    4
    Pippin, Michael,

    thanks for the replies.
    I checked the settings that Michael referred to. Under 'Spotty' I find 3 file formats : FLAC, MP3 and PCM. I disabled 'PCM' but than I do not have any sound output at all.
    When I revert to the original setting for PCM (being 'spotty-x86_64') than I get output back.
    What I then did on my linux box is check how much resources this process ('spotty-x86_64') uses. When I change a track I noticed that the current process is stopped gradually. A new one is spawned (with an overlap : so I have both the old and the new one running until the old one is completely stopped). When the new one takes off, it initially consumes a lot of CPU and then turns back to normal level. All of this is probably causing the 'lag'/temporarily mute I experience when I change tracks.

    Note that the 'lag' problem does not exist when there is a track change within a playlist without me interfering : meaning when a songs is at the end and the next one begins, the transition is smooth. I now understand why : the same process keeps on running and I do not have the process switch which occurs when I change to a next song while another one is still playing.

    So I now have to found out how I can disable the process switch when I change tracks ...

    Michael,

    my system setup is the following : linux sever (4 core AMD processor) running logitechmediaserver v7.9.1 under Arch linux, connected via wire to a squeezebox receiver (I have a Squeezebox Duet) who is optically connected to a pair of active speakers. I have the Spotify app installed on my iPhone on which I select the squeezebox receiver. Note that the IPhone connects to my wireless router who has my linux box and squeezebox receiver connected via UTP cable. I tried using Spotty in LMS mode and than control it via iPeng on my iPhone but I prefer it a lot less since for some reason my library does not show up correctly under the LMS Spotify app.

  5. #5
    Junior Member
    Join Date
    Jul 2018
    Posts
    4
    Pippin, Michael,

    thanks for the replies.
    I checked the settings that Michael referred to. Under 'Spotty' I find 3 file formats : FLAC, MP3 and PCM. I disabled 'PCM' but than I do not have any sound output at all.
    When I revert to the original setting for PCM (being 'spotty-x86_64') than I get output back.
    What I then did on my linux box is check how much resources this process ('spotty-x86_64') uses. When I change a track I noticed that the current process is stopped gradually. A new one is spawned (with an overlap : so I have both the old and the new one running until the old one is completely stopped). When the new one takes off, it initially consumes a lot of CPU and then turns back to normal level. All of this is probably causing the 'lag'/temporarily mute I experience when I change tracks.

    Note that the 'lag' problem does not exist when there is a track change within a playlist without me interfering : meaning when a songs is at the end and the next one begins, the transition is smooth. I now understand why : the same process keeps on running and I do not have the process switch which occurs when I change to a next song while another one is still playing.

    So I now have to found out how I can disable the process switch when I change tracks ...

    Michael,

    my system setup is the following : linux sever (4 core AMD processor) running logitechmediaserver v7.9.1 under Arch linux, connected via wire to a squeezebox receiver (I have a Squeezebox Duet) who is optically connected to a pair of active speakers. I have the Spotify app installed on my iPhone on which I select the squeezebox receiver. Note that the IPhone connects to my wireless router who has my linux box and squeezebox receiver connected via UTP cable. I tried using Spotty in LMS mode and than control it via iPeng on my iPhone but I prefer it a lot less since for some reason my library does not show up correctly under the LMS Spotify app.

  6. #6
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    20,014
    Streaming PCM should use the least CPU, as it's what I receive from the spotty helper. Transcoding to flac/mp3 would use more CPU, but less bandwidth. I doubt this is the bottleneck, but feel free to play with it.

    You could set logging for plugin.spotty to INFO, then "tail -f server.log" (the exact path you can find in Settings/Information). Watch the log while you interact using the Spotify app on your mobile or desktop. You should see events triggered in the log when you change a track in the app. Is there a lag in between those? Or is the lag introduce later, when the streaming starts?

    What kind of internet connection are you using?

    And don't try to mess with those processes. You're more likely going to cause problem than solve anything.
    Michael

    http://www.herger.net/slim-plugins - Spotty, MusicArtistInfo

  7. #7
    Senior Member
    Join Date
    Jan 2010
    Location
    Hertfordshire
    Posts
    1,595
    FWIW I see a lag of 5 seconds before a track starts playing which I assume is normal.

    Sent from my SM-G900F using Tapatalk

  8. #8
    Junior Member
    Join Date
    Jul 2018
    Posts
    4
    Michael,
    tailing my server.log the following appears when I change tracks :

    [18-07-10 20:54:43.0323] Plugins::Spotty::Connect::_connectEvent (276) Got called from spotty helper: change
    [18-07-10 20:54:43.0338] Plugins::Spotty::API::__ANON__ (1379) Trying to read from cache for me
    [18-07-10 20:54:43.0342] Plugins::Spotty::API::__ANON__ (1388) API call: me
    [18-07-10 20:54:43.1313] Plugins::Spotty::API::__ANON__ (1388) API call: me/player
    [18-07-10 20:54:43.2755] Plugins::Spotty::API::__ANON__ (1436) Caching result for 60 using max-age (https://api.spotify.com/v1/me)
    [18-07-10 20:54:43.2763] Plugins::Spotty::API::__ANON__ (1438) Data cached (https://api.spotify.com/v1/me)
    [18-07-10 20:54:43.2845] Plugins::Spotty::Connect::__ANON__ (308) Got a change event, but actually this is a play next track event
    [18-07-10 20:54:43.2851] Plugins::Spotty::Connect::__ANON__ (314) Got a new track to be played: spotify:track:5NCDNPLzJvyHzAAsyaMpcf
    [18-07-10 20:54:43.2907] Plugins::Spotty::API::__ANON__ (1379) Trying to read from cache for me
    [18-07-10 20:54:43.2912] Plugins::Spotty::API::__ANON__ (1382) Returning cached data for me
    [18-07-10 20:54:43.2916] Plugins::Spotty::Connect::getNextTrack (123) Don't get next track as we got called by a play track event from spotty
    [18-07-10 20:54:43.2924] Plugins::Spotty::API::__ANON__ (1388) API call: me/player
    [18-07-10 20:54:43.5598] Plugins::Spotty::API::__ANON__ (1379) Trying to read from cache for me
    [18-07-10 20:54:43.5605] Plugins::Spotty::API::__ANON__ (1382) Returning cached data for me
    [18-07-10 20:54:43.5612] Plugins::Spotty::Connect::Context::new (55) Create new Connect context...
    [18-07-10 20:54:43.5638] Plugins::Spotty::Plugin:urgeAudioCacheAfterXTracks (456) Played 3 song(s) since last audio cache purge.
    Internet connection is broadband, so there should be no problem with that.

  9. #9
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    20,014
    Quote Originally Posted by Strider3 View Post
    Michael,
    tailing my server.log the following appears when I change tracks :
    As you can see from the timestamps all of this happens within a fraction of a second. When trailing the log file, did you notice where the delay was? Before this snippet appeared or afterwards?
    Michael

    http://www.herger.net/slim-plugins - Spotty, MusicArtistInfo

Posting Permissions

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