[PR #277] [MERGED] Implement Rodio as default playback backend #858

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

📋 Pull Request Information

Original PR: https://github.com/librespot-org/librespot/pull/277
Author: @willstott101
Created: 12/5/2018
Status: Merged
Merged: 3/20/2019
Merged by: @sashahilton00

Base: masterHead: cpal-backend


📝 Commits (10+)

  • 8912981 Initial untested VecDeque concept.
  • ac9423d cpal backend builds. Panics building output stream on my system.
  • b81bdca QDH: Instantiate audio backend immediately when using "--device ?".
  • 1eb5b7d Turns out I don't have an appropriate output device.
  • 2c2bfc5 Cpal -> Rodio
  • 49fd48b Sink.play is not the opposite of Sink.stop in Rodio
  • 587aa9c Simple block of playback thread based on buffer size.
  • f1be508 Make rodio backend the default
  • 5ceb4db Improve formatting and macro usage in devices list.
  • 99703a2 Warn when there's a Rodio failure accessing a default device formats.

📊 Changes

6 files changed (+393 additions, -1 deletions)

View changed files

📝 Cargo.lock (+262 -0)
📝 Cargo.toml (+2 -1)
📝 playback/Cargo.toml (+3 -0)
📝 playback/src/audio_backend/mod.rs (+7 -0)
playback/src/audio_backend/rodio.rs (+115 -0)
📝 src/main.rs (+4 -0)

📄 Description

Hello, I'm new to Rust and librespot but I thought this https://github.com/librespot-org/librespot/issues/145 would be a reasonable first thing to look-at, as a vague attempt at helping to improve the cross-platform audio ecosystem and encourage projects such as Tomahawk.

I managed to get music playing with the back-end in this state... however there's a buzz when nothing is playing and the sink (in windows at least) has to be 44100 Hz for playback to work as cpal doesn't consider resampling to be in it's remit.

So I've decided to pause here, share what I've got and consider https://github.com/librespot-org/librespot/issues/195

Basically, would you prefer I had at go swapping in Rodio to handle everything it can, and reduce code here in librespot as much as possible, or perhaps use another approach... such as a Rodio back-end in the current structure with the intention of slowly removing the others.


🔄 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/277 **Author:** [@willstott101](https://github.com/willstott101) **Created:** 12/5/2018 **Status:** ✅ Merged **Merged:** 3/20/2019 **Merged by:** [@sashahilton00](https://github.com/sashahilton00) **Base:** `master` ← **Head:** `cpal-backend` --- ### 📝 Commits (10+) - [`8912981`](https://github.com/librespot-org/librespot/commit/891298171c5afb13c7be169918915679b6102912) Initial untested VecDeque concept. - [`ac9423d`](https://github.com/librespot-org/librespot/commit/ac9423d9d99eaf4fcf665e17bd55fe9073b479eb) cpal backend builds. Panics building output stream on my system. - [`b81bdca`](https://github.com/librespot-org/librespot/commit/b81bdca707ce4a563a201f8971c603a1d3496f37) QDH: Instantiate audio backend immediately when using "--device ?". - [`1eb5b7d`](https://github.com/librespot-org/librespot/commit/1eb5b7d127a2356c511065640519b6cb543b65a2) Turns out I don't have an appropriate output device. - [`2c2bfc5`](https://github.com/librespot-org/librespot/commit/2c2bfc52acd8d24af04870f4a657d32a5a12eb9f) Cpal -> Rodio - [`49fd48b`](https://github.com/librespot-org/librespot/commit/49fd48b42a671667966352947a352a4b06bd87ef) Sink.play is not the opposite of Sink.stop in Rodio - [`587aa9c`](https://github.com/librespot-org/librespot/commit/587aa9c711f761f5ce4e30d7c2624397983204a3) Simple block of playback thread based on buffer size. - [`f1be508`](https://github.com/librespot-org/librespot/commit/f1be5085ad5a183146059f6609fb0b50ff7fc9cb) Make rodio backend the default - [`5ceb4db`](https://github.com/librespot-org/librespot/commit/5ceb4db9b805d1f5319e4f53e3edeffa5d21bdaa) Improve formatting and macro usage in devices list. - [`99703a2`](https://github.com/librespot-org/librespot/commit/99703a268ff409755b1ec3004fcb1352863a2f40) Warn when there's a Rodio failure accessing a default device formats. ### 📊 Changes **6 files changed** (+393 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `Cargo.lock` (+262 -0) 📝 `Cargo.toml` (+2 -1) 📝 `playback/Cargo.toml` (+3 -0) 📝 `playback/src/audio_backend/mod.rs` (+7 -0) ➕ `playback/src/audio_backend/rodio.rs` (+115 -0) 📝 `src/main.rs` (+4 -0) </details> ### 📄 Description Hello, I'm new to Rust and librespot but I thought this https://github.com/librespot-org/librespot/issues/145 would be a reasonable first thing to look-at, as a vague attempt at helping to improve the cross-platform audio ecosystem and encourage projects such as Tomahawk. I managed to get music playing with the back-end in this state... however there's a buzz when nothing is playing and the sink (in windows at least) has to be 44100 Hz for playback to work as cpal doesn't consider resampling to be in it's remit. So I've decided to pause here, share what I've got and consider https://github.com/librespot-org/librespot/issues/195 Basically, would you prefer I had at go swapping in Rodio to handle everything it can, and reduce code here in librespot as much as possible, or perhaps use another approach... such as a Rodio back-end in the current structure with the intention of slowly removing the others. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 20:00:13 +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#858
No description provided.