mirror of
https://github.com/librespot-org/librespot.git
synced 2026-04-27 08:15:50 +03:00
[GH-ISSUE #158] Huge latency when seeking/playing #110
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#110
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 @bebehei on GitHub (Feb 19, 2018).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/158
Hi guys,
I've built librespot successfully with pulseaudio support. It also works reasonably well.
I had been using Spotify Connect already for a long time with my Smartphone and computer together and in comparison to this, there is a small thing which bugs me.
Seeking and switching tracks makes the audio output stop for multiple seconds before the track starts or jumps to the seeked point.
The log reads the following:
There is no difference, if I change the bitrate/caching options.
Also interestingly, there is no delay, if I pause and play the track again.
Reproducible on ArchLinux on my desktop (amd64) and on an Odroid C2 (aarch64).
@bebehei commented on GitHub (Feb 19, 2018):
Ok, I've got a workaround now. I'm using the
pipebackend now and I'm piping everything intopacat. Now librespot works like a usual Spotify Connect and doesn't have these huge latencies, but I'd still favor a native working pulseaudio support.See here for a the fully deployed workaround: https://bebehei.de/odroid-mediacenter/#librespot
@lassos commented on GitHub (Mar 4, 2018):
Have the same problem. Using pulseaudio. Huge delay with seeking and switching forward or back
@lassos commented on GitHub (Mar 9, 2018):
I have no kodi. Just debian with pulseaudio. And in default.pa is nothing with keeper audio sinken alive. In original librespot i have never had seek play latency
@bebehei commented on GitHub (Mar 9, 2018):
@lassos I don't have kodi either. Could you please elaborate?
@lassos commented on GitHub (Mar 9, 2018):
https://github.com/librespot-org/librespot/issues/180
So in this thread the talk about
Try disabling option "keep audio sink alive" in Kodi
So where can i do it. In pulseaudio config ---system.pa
So what do you need.
And i noticed another thing. The loudness is much more less than in old librespot
@ComlOnline commented on GitHub (Mar 10, 2018):
@lassos depending on how old your version of librespot was we implemented a change in the volume in #10 So that its no longer linear but logarithmic.
@bebehei I'll build a recent version with pulse audio and have a look tomorrow.
@bebehei commented on GitHub (Mar 10, 2018):
@ComlOnline I'm regularly rebuilding librespot to match current master. I've even started using librespot after #10 had been merged.
@MarcelKr commented on GitHub (Mar 11, 2018):
@lassos @bebehei My issue wasn't related to Kodi. I was not a member of the
audiogroupd and therefore I had no sound. Now that I fixed that, I get the exact symptoms seen in this issue. E.g. playback working but with theCould not write audoerror message and the delay when seeking.@lassos commented on GitHub (Mar 12, 2018):
Oh , OK. I am getting the same error -> Could not write audio
mpd@-XXX:/var/logRUST_BACKTRACE=1 /usr/bin/librespot --username XXX --password XXX --bitrate 320 --name XXX --backend pulseaudio INFO:librespot: librespot 593dfa0 (2018-02-27). Built on 2018-02-28. Build ID: heiwVZ8W INFO:librespot_core::session: Connecting to AP "gew1-accesspoint-b-pnns.ap.spotify.com:4070" INFO:librespot_core::session: Authenticated as "XXX" ! INFO:librespot_core::session: Country: "DE" INFO:librespot_playback::player: Loading track "Norrsken" INFO:librespot_playback::player: Track "Norrsken" loaded ERROR:librespot_playback::player: Could not write audio: Invalid argument ^[[A ERROR:librespot_playback::player: Could not write audio: Invalid argumentit would be great to get a solution cause it's really uncomftable to wait few seconds to seek or play next titles. thanks lars
@bebehei commented on GitHub (Mar 12, 2018):
Like I said it: Use
librespot --backend pipe | pacatas a workaround. This helps and lets the issue go away. It doesn't change the fact, that librespot's pulseaudio support is broken, but it works ™️If you need a full writeup, you can find it on my webpage.
@lassos commented on GitHub (Mar 12, 2018):
pretty cool, i have overlooked it, i am sorry. worked for me .-)
thanks a lot bebehei
@sashahilton00 commented on GitHub (Mar 20, 2018):
This is somewhat present on portaudio. What I believe the problem is, is that Track.load is called whenever a song is selected, even if only briefly when skipping through them. Hence, if you skip 5 songs, librespot loads 5 songs before the one you actually want. The solution is to implement an audio_queue, which will hopefully happen at some point. This leads to the loading latency. With regards to the seeking, that sounds like a CPU limitation, given that the pipe works.
@bebehei commented on GitHub (Jun 2, 2018):
I found out, that @brain0 fixed this in meantime with PR #194. Update to current master to have the changes included.
ping @Obrekr, you may want to update your commits again.