mirror of
https://github.com/librespot-org/librespot.git
synced 2026-04-27 08:15:50 +03:00
[PR #456] [MERGED] Add gstreamer backend to librespot #936
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#936
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?
📋 Pull Request Information
Original PR: https://github.com/librespot-org/librespot/pull/456
Author: @allquixotic
Created: 4/7/2020
Status: ✅ Merged
Merged: 7/25/2020
Merged by: @sashahilton00
Base:
dev← Head:gst1.0-2020📝 Commits (10+)
6707389Forward port plietar's WIP gstreamer backend.ed04c04Working proof of concept with up to date gstreamer bindings and Rust 2018.664c76bFix playback on track change. Pause/resume is still weird.d30ffcdMostly fix play/pause/stop behavior. Pause is latent.ac0df7eMerge https://github.com/librespot-org/librespot into gst1.0-2020a55b226Merge https://github.com/librespot-org/librespot into gst1.0-2020c5c4552Mergef192bd1gstreamer-1.0 backend: Version updates and squelch warnings1e9a52bFix auto disposal of pipeline that needs to stay in structe7093cbgstreamer-backend: rustfmt.📊 Changes
7 files changed (+488 additions, -3 deletions)
View changed files
📝
.travis.yml(+3 -0)📝
Cargo.lock(+345 -0)📝
Cargo.toml(+1 -0)📝
playback/Cargo.toml(+8 -3)➕
playback/src/audio_backend/gstreamer.rs(+115 -0)📝
playback/src/audio_backend/mod.rs(+7 -0)📝
playback/src/lib.rs(+9 -0)📄 Description
Fixes https://github.com/librespot-org/librespot/issues/28
Thanks to the gapless playback enhancements, this is working much better than it did in December. I also recently got rid of all my warnings and did a rustfmt.
One current bug is that the apparent playback position in the Spotify GUI is very slightly (about 1 second) ahead of the actual position of the song as you're hearing it out of your headphones. It's much, much better with the gapless fixes from kaymes, but still slightly behind. This is because the appsrc has a 4k buffer, and some of the other pipeline elements (audio sinks, for example) also have buffers. Without a little bit of pipeline buffering it would be very choppy.
Note: I don't think this backend works particularly well with the assumptions of "gapless mode disabled." It works fine for gapless-enabled though.
I also need to document this backend on the wiki under Audio_Backends, but I don't want to add docs for something that won't be merged, so I'll add that afterwards.
The biggest thing for newbies to understand will be how to write a correct
deviceargument for gstreamer. This is only necessary if the user wants something other than the audio going directly to theautoaudiosink(a gstreamer-determined "sane default" for audio playback based on the user's system), but there are quite some valid use cases for wanting something different (network streaming over rtp or something to a "smart speaker," for instance.)I'm still sort of a rust newbie, so I will work on improving my branch if this isn't up to snuff yet.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
--deviceargument to various backends #1152