mirror of
https://github.com/librespot-org/librespot.git
synced 2026-04-27 08:15:50 +03:00
[PR #493] [MERGED] Alsa backend better buffering #949
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#949
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/493
Author: @sniperrifle2004
Created: 6/14/2020
Status: ✅ Merged
Merged: 7/24/2020
Merged by: @sashahilton00
Base:
dev← Head:alsa-backend-better-buffering📝 Commits (6)
aaef07eIntroduce an appropriate period for the desired buffer64081a1Introduce a buffer for a full periodcbe3c98Clear buffer when the sink is stoppeda68dfa0On stop write any chunk(s) left in the period buffer82e54dfRewrite buffer around the actual period size1e5d98bActually store the period_size📊 Changes
1 file changed (+54 additions, -17 deletions)
View changed files
📝
playback/src/audio_backend/alsa.rs(+54 -17)📄 Description
Based on experience with the alsa pulse plugin and raspotify (Particularly I was looking into the problem described in dtcooper/raspotify#210) and a comparison with aplay (Which can be regarded as a reference implementation of alsa playback and did fine job using the pipe backend) I started looking into the alsa backend, because it was clear that something was wrong there.
By comparing hw_params used in librespot with those in aplay and also a brief look through aplay.c, I was able to come up with the following two improvements to buffering in the alsa backend:
NOTE: I did not look for a suitable buffer type before implementing the buffer/buffered_data combination. If anyone is aware of a suitable solution I will gladly make the change if that is preferable.Now replaced with a vector to match the actual period size. Could still be replaced with a buffer type🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.