question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

songs stop several seconds before end

See original GitHub issue

Im using librespot-java (spocon) on armhf to output to pipe/pipe.metadata and pick up from forked-daapd, it all works perfectly except that with nearly all songs it chops the last 2-3 seconds (mainly songs that dont fade out) I have been playing around with crossfading, no difference. I have been as well trying without preload, still no difference.

Not sure if this is a spotify, spocon, librespot-java or forked-daapd issue, so forgive me if this is not the right place to ask.

To Reproduce

Install spocon from http://ppa.launchpad.net/spocon/spocon/ubuntu bionic/main armhf Packages

Make pipes

mkfifo /srv/dev-disk-by-label-shares/Media/Audio/librespot-java.metadata
mkfifo /srv/dev-disk-by-label-shares/Media/Audio/librespot-java

spocon config.toml

deviceType = "COMPUTER"
deviceName = "SpoCon-Spotify"
deviceId = ""
logLevel = "TRACE"
preferredLocale = "de"

[cache]
        dir = "./cache/"
        enabled = true
        doCleanUp = true

[auth]
        credentialsFile = "credentials.json"
        password = ""
        blob = ""
        storeCredentials = false
        strategy = "ZEROCONF"
        username = "

[preload]
        enabled = true

[network]
        connectionTimeout = 10

[proxy]
        password = ""
        address = ""
        port = 0
        auth = false
        type = "HTTP"
        enabled = false
        username = ""

[zeroconf]
        listenAll = true
        interfaces = ""
        listenPort = -1

[shell]
        onTrackSeeked = ""
        onConnectionDropped = ""
        onMetadataAvailable = ""
        onTrackChanged = ""
        onPanicState = ""
        enabled = false
        onPlaybackResumed = ""
        onConnectionEstablished = ""
        onPlaybackEnded = ""
        onContextChanged = ""
        onPlaybackPaused = ""
        onInactiveSession = ""
        onVolumeChanged = ""

[time]
        manualCorrection = 0
        synchronizationMethod = "NTP"

[api]
        port = 24879
        host = "0.0.0.0"

[player]
        enableNormalisation = false
        initialVolume = 20536
        bypassSinkVolume = true
        releaseLineDelay = 20
        normalisationPregain = 0.0
        metadataPipe = "/srv/dev-disk-by-label-shares/Media/Audio/librespot-java.metadata"
        autoplayEnabled = true
        preferredAudioQuality = "VERY_HIGH"
        localFilesPath = ""
        output = "PIPE"
        crossfadeDuration = 0
        retryOnChunkError = true
        outputClass = ""
        pipe = "/srv/dev-disk-by-label-shares/Media/Audio/librespot-java"
        mixerSearchKeywords = ""
        logAvailableMixers = true
        volumeSteps = 64

Start librespot/spocon

/usr/bin/java -jar /opt/spocon/librespot-java-api-v1.6.0.jar

Stream playlist from any spotify app to SpoCon-Spotify

Expected behavior Play with no/minimal gaps but without truncations.

Actual behaviour It plays but truncates the last 2-3 seconds of previous songs, especially annoying when song has no fadeout.

May 23 21:45:54 odroid java[4251]: 2021-05-23 21:45:54,101 DEBUG PlayerQueueEntry:234 - PlayerQueueEntry{01e79412cf4e7720b6f8bbd7f13240ca} has been removed from output.

Too early

Screenshots/Stracktraces/Logs

May 23 21:45:44 odroid java[4251]:  provider: "context" album_uri: "spotify:album:3l4cjJdGu4pn81pFM5jjGi" artist_uri: "spotify:artist:1xm7iJLJRw7lcRM4MeoebZ" } context_metadata { key: "context_description" value: "Finnish" } context_metadata { key: "context_owner" value: "pj2crjnenb8cir8kl2z5doa69" } context_metadata { key: "image_url" value: "" } context_metadata { key: "track_count" value: "22" } context_metadata { key: "zelda.context_uri" value: "spotify:playlist:0nda5N8gV11RhWbVJA2kNq" } session_id: "Z+1iugQdYsX1HUBUsFaJWw" } } member_type: CONNECT_STATE is_active: true put_state_reason: PLAYER_STATE_CHANGED last_command_sent_by_device_id: "66c518c580c5d0dda96d1f0d6ff21a295c6e76e7" last_command_message_id: 448989416 started_playing_at: 1621799132366 has_been_playing_for_ms: 62962 client_side_timestamp: 1621799143089}
May 23 21:45:54 odroid java[4251]: 2021-05-23 21:45:54,099 DEBUG PlayerQueueEntry:330 - Player time offset is 625. {id: 01e79412cf4e7720b6f8bbd7f13240ca}
May 23 21:45:54 odroid java[4251]: 2021-05-23 21:45:54,100 TRACE MixingLine:184 - Toggle first channel: false
May 23 21:45:54 odroid java[4251]: 2021-05-23 21:45:54,101 DEBUG PlayerQueueEntry:234 - PlayerQueueEntry{01e79412cf4e7720b6f8bbd7f13240ca} has been removed from output.
May 23 21:45:54 odroid java[4251]: 2021-05-23 21:45:54,107 TRACE MercuryClient:156 - Send Mercury request, seq: 4, uri: hm://event-service/v1/events, method: POST
May 23 21:45:54 odroid java[4251]: 2021-05-23 21:45:54,120 DEBUG CrossfadeController:192 - Changed fade out. {curr: null, custom: false, why: TRACK_DONE, id: 01e79412cf4e7720b6f8bbd7f13240ca}
May 23 21:45:54 odroid java[4251]: 2021-05-23 21:45:54,120 DEBUG CrossfadeController:170 - Changed fade in. {curr: null, custom: false, why: TRACK_DONE, id: 0144a92ff466af18e27bff57f7076346}
May 23 21:45:54 odroid java[4251]: 2021-05-23 21:45:54,121 TRACE MixingLine:184 - Toggle first channel: true
May 23 21:45:54 odroid java[4251]: 2021-05-23 21:45:54,121 DEBUG PlayerSession:283 - PlayerQueueEntry{0144a92ff466af18e27bff57f7076346} has been added to the output. {sessionId: Z+1iugQdYsX1HUBUsFaJWw, pos: 0, reason: TRACK_DONE}
May 23 21:45:54 odroid java[4251]: 2021-05-23 21:45:54,132 TRACE PlayerQueueEntry:350 - PlayerQueueEntry{01e79412cf4e7720b6f8bbd7f13240ca} terminated.
May 23 21:45:54 odroid java[4251]: 2021-05-23 21:45:54,707 TRACE MercuryClient:199 - Handling packet, cmd: MercuryReq, seq: 4, flags: 1, parts: 1
May 23 21:45:54 odroid java[4251]: 2021-05-23 21:45:54,708 DEBUG EventService:51 - Event sent. {body: 12|38|0|a00adceb8082ed6d0c198f77f804405e9782d126|01e79412cf4e7720b6f8bbd7f13240ca|00000000000000000000000000000000|playlist|clickrow|playlist|endplay|2142636|10269100|257121|257121|257746|10|0|0|0|1|52190|0|-1|context|491|0|0|0|0|0|257121|257121|0|176400|spotify:playlist:0nda5N8gV11RhWbVJA2kNq|vorbis|d23be0b3cd8f4db099622da2a48e4f5e||0|1621799132503|0|context|your_library|xpui_2021-05-21_1621590990778_7e04046|com.spotify|crossfade|none|66c518c580c5d0dda96d1f0d6ff21a295c6e76e7|na|none, result: 200}
May 23 21:45:54 odroid java[4251]: 2021-05-23 21:45:54,710 TRACE MercuryClient:156 - Send Mercury request, seq: 5, uri: hm://event-service/v1/events, method: POST
May 23 21:45:54 odroid java[4251]: 2021-05-23 21:45:54,751 INFO  DeviceStateHandler:273 - Put state. {ts: 1621799154127, connId: YTAwY...wMkJF, reason: PLAYER_STATE_CHANGED, request: device { device_info { can_play: true volume: 20536 name: "SpoCon-Spotify" capabilities { can_be_player: true gaia_eq_connect_id: true supports_logout: true is_observable: true volume_steps: 64 supported_types: "audio/episode" supported_types: "audio/track" command_acks: true supports_playlist_v2: true is_controllable: true supports_transfer_command: true supports_command_request: true supports_gzip_pushes: true } device_software_version: "librespot-java 1.6.0" device_type: COMPUTER spirc_version: "3.2.6" device_id: "a00adceb8082ed6d0c198f77f804405e9782d126" client_id: "65b708073fc0480ea92a077233ca87bd" } player_state { timestamp: 1621799154125 context_uri: "spotify:playlist:0nda5N8gV11RhWbVJA2kNq" context_url: "context://spotify:playlist:0nda5N8gV11RhWbVJA2kNq" context_restrictions { } play_origin { feature_identifier: "playlist" feature_version: "xpui_2021-05-21_1621590990778_7e04046" referrer_identifier: "your_library" feature_classes: "connect" } index { track: 6 } track { uri: "spotify:track:6ff0XZuZgUMaWusNjv1VQr" uid: "05fdd1a695830110" metadata { key: "added_at" value: "1621764668000" } metadata { key: "added_by_username" value: "pj2crjnenb8cir8kl2z5doa69" } metadata { key: "album_artist_name" value: "Juice Leskinen" } metadata { key: "album_artist_uri" value: "spotify:artist:4W6vvLzFQKixmJXSJK3wLp" } metadata { key: "album_disc_number" value: "1" } metadata { key: "album_title" value: "Ajan henki" } metadata { key: "album_uri" value: "spotify:album:2P8ssBO8PcUJRN2stYH9EZ" } metadata { key: "artist_name" value: "Juice Leskinen Slam" } metadata { key: "artist_uri" value: "spotify:artist:1F5luCKmbkRLdxkqPcZJOc" } metadata { key: "available_file_formats" value: "[\"OGG_VORBIS_320\",\"OGG_VORBIS_160\",\"OGG_VORBIS_96\",\"AAC_24\"]" } metadata { key: "duration" value: "263173" } metadata { key: "image_large_url" value: "spotify:image:ab67616d0000b2730fd7a0f4be1c342

Version/Commit

apt-cache policy spocon
spocon:
  Installed: 1.6.0
  Candidate: 1.6.0
  Version table:
 *** 1.6.0 500
        500 http://ppa.launchpad.net/spocon/spocon/ubuntu bionic/main armhf Packages
        100 /var/lib/dpkg/status

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:19 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
flostrucommented, May 30, 2021

Just trying your fix, works great, now everything is perfect. This rocks! You rock!

0reactions
applicature-mark-boychukcommented, Jul 20, 2021

🚀

Read more comments on GitHub >

github_iconTop Results From Across the Web

Songs stop playing after a few seconds
I've been having an ongoing issue where songs stop playing in the Apple Music after a few seconds (anywhere from 5 to 30...
Read more >
Solved: Music stops after 10 seconds
Music stops playing after about 10 seconds. Attempted fresh install. Restarted phone no less than 3 times. Have tried on cellular and wifi...
Read more >
Spotify stopping songs for several seconds when a new ...
It's always 20 seconds before the end of a song regardless of the length of the song, so it's not a buffering issue....
Read more >
Music stops playing around 20 seconds before end of track
Every song I play in groove in Windows 10 stops playing around 20 seconds before the end of the track. It will then...
Read more >
Music player stops a few seconds before the end of a track
I use of Podcast Addict (PA) successfully for over a year, but recently, each track stops playing about 3 or 4 seconds before...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found