[PR #1196] [CLOSED] Adding option and flag to limit sink write rates (concerning #1195) #1273

Closed
opened 2026-02-27 20:01:49 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/librespot-org/librespot/pull/1196
Author: @JoeyEamigh
Created: 8/6/2023
Status: Closed

Base: devHead: control-sink-write-speed


📝 Commits (2)

  • 5c63476 adding option and flag to limit sink write rates
  • d3a24a5 finish hooking up config changes

📊 Changes

3 files changed (+40 additions, -1 deletions)

View changed files

📝 playback/src/config.rs (+2 -0)
📝 playback/src/player.rs (+27 -1)
📝 src/main.rs (+11 -0)

📄 Description

Hello!

Earlier today I opened #1195 which talks about how certain backends without buffering may accept all of the audio packets from librespot as soon as they are available, leading songs to end seconds after they begin. This PR is one option at addressing that.

This PR adds a flag and option called --limit-sink-write, which effectively checks if the sink writes are running faster than the speed at which the song should be playing, and if so sleeps for the difference.

I am not sure if this is the best way to be doing this, but it was the most consistent of any method I tried. Limiting based on bitrate alone left the song about 10 seconds ahead on librespot's side, and backed-specific implementation didn't make much sense for me due to my relative lack of knowledge on this topic.

Hopefully this PR is helpful, but if not hopefully it gives y'all a bit of insight into a way of fixing #1195 that does work.

Thanks!


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/librespot-org/librespot/pull/1196 **Author:** [@JoeyEamigh](https://github.com/JoeyEamigh) **Created:** 8/6/2023 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `control-sink-write-speed` --- ### 📝 Commits (2) - [`5c63476`](https://github.com/librespot-org/librespot/commit/5c63476337589cf7b7cfece7f1cfc9478e2c9cfb) adding option and flag to limit sink write rates - [`d3a24a5`](https://github.com/librespot-org/librespot/commit/d3a24a5df2850c831b02d7404d71c67372066658) finish hooking up config changes ### 📊 Changes **3 files changed** (+40 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `playback/src/config.rs` (+2 -0) 📝 `playback/src/player.rs` (+27 -1) 📝 `src/main.rs` (+11 -0) </details> ### 📄 Description Hello! Earlier today I opened #1195 which talks about how certain backends without buffering may accept all of the audio packets from librespot as soon as they are available, leading songs to end seconds after they begin. This PR is one option at addressing that. This PR adds a flag and option called `--limit-sink-write`, which effectively checks if the sink writes are running faster than the speed at which the song should be playing, and if so sleeps for the difference. I am not sure if this is the best way to be doing this, but it was the most consistent of any method I tried. Limiting based on bitrate alone left the song about 10 seconds ahead on librespot's side, and backed-specific implementation didn't make much sense for me due to my relative lack of knowledge on this topic. Hopefully this PR is helpful, but if not hopefully it gives y'all a bit of insight into a way of fixing #1195 that does work. Thanks! --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 20:01:49 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/librespot#1273
No description provided.