mirror of
https://github.com/devgianlu/go-librespot.git
synced 2026-04-26 13:25:49 +03:00
[GH-ISSUE #31] Gapless playback with Crossfade #22
Labels
No labels
bug
enhancement
pull-request
spotify-side
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/go-librespot#22
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 @tylkie on GitHub (Apr 18, 2024).
Original GitHub issue: https://github.com/devgianlu/go-librespot/issues/31
Your java version had a crossfade option along with internal prefetching for gapless playback. Currently, if my senses do not trick me, the first chunk gets loaded on demand, while the rest of the chunks of the same song get prefetched. With a very bad internet connection this sometimes results in gaps between songs.
When looking at the log, one can see that the player currently even emits a "not_playing" event between songs.
Apr 18 08:50:24 mysterion librespot-go[470966]: time="2024-04-18T08:50:24+02:00" level=debug msg="selected format OGG_VORBIS_160 for spotify:track:6FKU84JHM1lbiy5Dx0Dyqd"Apr 18 08:50:24 mysterion librespot-go[470966]: time="2024-04-18T08:50:24+02:00" level=debug msg="requested aes key for file 4edb75d47086de2a3d55b067cd8e3d00cc2e1a9e, gid: 6FKU84JHM1lbiy5Dx0Dyqd"Apr 18 08:50:25 mysterion librespot-go[470966]: time="2024-04-18T08:50:25+02:00" level=debug msg="fetched first chunk of 8, total size is 4127448 bytes"Apr 18 08:50:25 mysterion librespot-go[470966]: time="2024-04-18T08:50:25+02:00" level=trace msg="seek to 0ms (diff: -198ms, samples: 0, bytes: 0)"Apr 18 08:50:25 mysterion librespot-go[470966]: time="2024-04-18T08:50:25+02:00" level=info msg="loaded track \"The Joker\" (uri: spotify:track:6FKU84JHM1lbiy5Dx0Dyqd, paused: false, position: 0ms, duration: 217800ms)"Apr 18 08:50:25 mysterion librespot-go[470966]: time="2024-04-18T08:50:25+02:00" level=debug msg="vorbis: corrupt or missing data in bitstream"Apr 18 08:50:25 mysterion librespot-go[470966]: time="2024-04-18T08:50:25+02:00" level=debug msg="put connect state because PLAYER_STATE_CHANGED"Apr 18 08:50:25 mysterion librespot-go[470966]: time="2024-04-18T08:50:25+02:00" level=trace msg="emitting websocket event: metadata"Apr 18 08:50:25 mysterion librespot-go[470966]: time="2024-04-18T08:50:25+02:00" level=debug msg="put connect state because PLAYER_STATE_CHANGED"Apr 18 08:50:25 mysterion librespot-go[470966]: time="2024-04-18T08:50:25+02:00" level=trace msg="emitting websocket event: playing"Apr 18 08:50:26 mysterion librespot-go[470966]: time="2024-04-18T08:50:26+02:00" level=debug msg="fetched chunk 1/7, size: 524288"Apr 18 08:50:26 mysterion librespot-go[470966]: time="2024-04-18T08:50:26+02:00" level=debug msg="fetched chunk 2/7, size: 524288"Apr 18 08:50:27 mysterion librespot-go[470966]: time="2024-04-18T08:50:27+02:00" level=debug msg="fetched chunk 3/7, size: 524288"Apr 18 08:50:42 mysterion librespot-go[470966]: time="2024-04-18T08:50:42+02:00" level=debug msg="fetched chunk 4/7, size: 524288"Apr 18 08:51:09 mysterion librespot-go[470966]: time="2024-04-18T08:51:09+02:00" level=debug msg="fetched chunk 5/7, size: 524288"Apr 18 08:51:37 mysterion librespot-go[470966]: time="2024-04-18T08:51:37+02:00" level=debug msg="fetched chunk 6/7, size: 524288"Apr 18 08:52:05 mysterion librespot-go[470966]: time="2024-04-18T08:52:05+02:00" level=debug msg="fetched chunk 7/7, size: 457432"Apr 18 08:54:01 mysterion librespot-go[470966]: time="2024-04-18T08:54:01+02:00" level=trace msg="emitting websocket event: not_playing"Apr 18 08:54:01 mysterion librespot-go[470966]: time="2024-04-18T08:54:01+02:00" level=debug msg="loading track spotify:track:0NIRG3SEn2Zf88o3qHJil5 (paused: false, position: 0ms)"Apr 18 08:54:01 mysterion librespot-go[470966]: time="2024-04-18T08:54:01+02:00" level=debug msg="put connect state because PLAYER_STATE_CHANGED"Apr 18 08:54:01 mysterion librespot-go[470966]: time="2024-04-18T08:54:01+02:00" level=trace msg="emitting websocket event: will_play"Apr 18 08:54:02 mysterion librespot-go[470966]: time="2024-04-18T08:54:02+02:00" level=debug msg="selected format OGG_VORBIS_160 for spotify:track:0NIRG3SEn2Zf88o3qHJil5"Apr 18 08:54:02 mysterion librespot-go[470966]: time="2024-04-18T08:54:02+02:00" level=debug msg="requested aes key for file 4569298b745f1ef6d32a3ae636537bab5ae7509a, gid: 0NIRG3SEn2Zf88o3qHJil5"@devgianlu commented on GitHub (May 18, 2024):
@tylkie I have started implemented some prefetching with the latest commits if you're interested in trying it out.
@tylkie commented on GitHub (May 21, 2024):
Not just interested... I am excited to try it out. Just merged the commits along with the player and stream commits. Works smoothly so far. Gonna let it run for a couple of days.
@tylkie commented on GitHub (May 25, 2024):
After four days of continuous usage, I conclude that prefetching works flawlessly for me.
@devgianlu commented on GitHub (May 26, 2024):
Nice! Which commit are you using exactly?
@tylkie commented on GitHub (May 27, 2024):
I used the latest release source files (0.0.15) and merged the diff files from
75ef7eband51a1509manually. From your question I deduced that I have missed some commits in between. And indeed I missed2a52394. My bad. I now downloaded the entire repository up to5385999. Thank you for the hint. This is like endless Christmas... unpacking the same goodie over and over :-D@devgianlu commented on GitHub (May 27, 2024):
Yeah I mentioned because I had some "temporary" commits in there that weren't quite ready, as of now master includes all gapless changes.
@devgianlu commented on GitHub (Jul 25, 2024):
Considering #45, gapless should be working well now. Please open another issue for crossfading.