mirror of
https://github.com/librespot-org/librespot.git
synced 2026-04-27 08:15:50 +03:00
[PR #314] [CLOSED] [Rodio] Re-acquire audio sink when (re)starting playback. #874
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#874
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/314
Author: @willstott101
Created: 3/20/2019
Status: ❌ Closed
Base:
master← Head:rodio-release-sink📝 Commits (2)
6c6f355[Rodio] Re-acquire audio sink when (re)starting playback.c8806f5[Rodio] Drop sink don't stop it.📊 Changes
1 file changed (+37 additions, -30 deletions)
View changed files
📝
playback/src/audio_backend/rodio.rs(+37 -30)📄 Description
This releases the audio sink and re-acquires it when skipping/pausing a song.
This is useful for switching playback device on desktop machines.
In an ideal world Rodio would check to see if the default sink has changed and switch automatically. But for the moment I find this behaviour acceptable, as I have a couple of playback devices I use.
This has a nice side effect of clearing the sink when stopping playback, which can make librespot feel more responsive.
I expect the performance issues seen previously by @chrisbp in https://github.com/librespot-org/librespot/pull/277 will only be fixed by not using rodio::Sink and rodio's mixer. Meaning this whole backend will need re-writing at some point to support an as-yet-non-existent very simple Rodio API for efficient playback of a single Source. So this PR may prove pointless.
N.B. Currently this causes a fuzz noise because it plays the first 5ms of every queued audio chunk when stopping. Waiting on https://github.com/tomaka/rodio/pull/221 to fix that.
I have excluded Cargo.lock cause I'm using a local Rodio and CPAL so it's pretty meaningless.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.