mirror of
https://github.com/librespot-org/librespot.git
synced 2026-04-27 00:05:55 +03:00
[GH-ISSUE #253] Spotify connect playback issues/lag #172
Labels
No labels
A-Alsa
SpotifyAPI
Tokio 1.0
audio
bug
can't reproduce
compilation
dependencies
duplicate
enhancement
good first issue
help wanted
high priority
imported
imported
invalid
new api
pull-request
question
reverse engineering
wiki
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/librespot#172
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Razorfoot on GitHub (Oct 2, 2018).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/253
Hi,
Im currently using an Rpi3b+ and a Suptronics X5000 DAC with some JBL 308P MkII powered 8" two-way studio monitors, connected via TRS 1/4" to RCA to the DAC (not ideal but im waiting for the ALLO Katana DAC to be re-released)
However I have an issue with Spotify connect taking 10-20 seconds to play a song every time I change song from any device I use, i.e. Desktop PC, Android phone, Android tablet. Skipping forward and back will intermittently play song on demand but more often not.
This seems to be via anything I browse on Spotify or from my playlists. Local USB drive stored audio works fine.
Removing the DAC and using the pi by itself results in the same issue. I have tried the latest Volumio OS and Moode OS
Any help would be appreciated as im fairly new to the Rpi scene.
@rage2dev commented on GitHub (Oct 3, 2018):
I guess you using alsa as backend? Had the same issue, looks like librespot is waiting for the song to fully download and than starting playback.
I worked around it by using jackd with "jackaudio"-backend.
@Razorfoot commented on GitHub (Oct 3, 2018):
And how would I go about setting that up? Sorry I'm new to this :)
@rage2dev commented on GitHub (Oct 4, 2018):
Build librespot:
cargo build --release --features jackaudio-backend
Install jackd1 or jackd2 (jackd2 seems to work better on newer kernel versions).
Use qjackctl to connect the librespot jacks, to your soundcard or if terminal only : jack_lsp (list all jacks) and jack_connect {from_jack} {to_jack}
But we still should fix the alsa bug! :)
@kingosticks commented on GitHub (Oct 4, 2018):
It would be interesting if that helps since the code doesn't suggest there would be any difference in the loading behaviour.
@ashthespy commented on GitHub (Oct 4, 2018):
I highly doubt it as well - as per
player.rsthe file is fetched either from the cache or from the servers and only then is the sink opened.@kingosticks commented on GitHub (Oct 7, 2018):
I had a closer look at how this all works and the player will open the sink and start writing data to output as soon as the first 128K chunk of data is received. The remaining chunks will be fetched in the background while the audio plays. You can see this yourself if you run with debug logging:
This is most obvious when you load a long track.
If there is a delay in audio starting you might be able to see where it is with the above log output. Maybe a delay in opening the device (why?) or the hardware is waiting until ALSA's ring buffer is sufficiently full before starting. librespot's ALSA implementation is very simple and maybe doesn't work well with some sound devices. It might be helpful to dump your ALSA parameters. For my onboard soundcard I get:
Jack is supposed to be a lot easier to interface with so I guess whatever the issue is is handled better.
@dowhiletrue commented on GitHub (Jan 20, 2019):
I'm facing similar issues. Sometimes it takes up to 10 seconds after "Track ... loaded" till the music starts to play. The delay might be longer when skipping track, while it is loaded. The time on my controller device starts to count but no sound. The CPU load is about 20% while loading.
@StopMotionCuber commented on GitHub (Mar 19, 2019):
Can you maybe check with the current master again as #297 got merged?
This should improve the behaviour