[PR #540] [MERGED] Improve PulseAudio backend #961

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

📋 Pull Request Information

Original PR: https://github.com/librespot-org/librespot/pull/540
Author: @jnqnfe
Created: 11/27/2020
Status: Merged
Merged: 12/14/2020
Merged by: @sashahilton00

Base: devHead: pa


📝 Commits (4)

  • cea63e5 use actual feature names rather than crate names for conditional compilation
  • 28061df upgrade to newer PulseAudio crate dependency
  • 0411e69 convert PulseAudio backend to use the available binding crates
  • 120bd88 fix alignment causing format check failure

📊 Changes

4 files changed (+98 additions, -103 deletions)

View changed files

📝 Cargo.lock (+42 -3)
📝 playback/Cargo.toml (+3 -2)
📝 playback/src/audio_backend/pulseaudio.rs (+48 -92)
📝 playback/src/lib.rs (+5 -6)

📄 Description

Hi, I'm not actually a librespot user, I just ended up here from noticing the dependency on such an old version of libpulse_sys and found myself working on fixing it...

This PR:

  • Bundles a trivial fix for instances of conditional compilation incorrectly using crate names instead of feature names.
  • Bumps the libpulse_sys dependency from v0.0.0 to v1.11+, which necessitates addition of libpulse-simple_sys since the 'simple' components were moved to their own crate (following the one crate per system library rule). This addresses the licensing issue mentioned in issue #539 with respect to this dependency.
  • Rewrites the PulseAudio backend code to use the higher-level libpulse-binding and libpulse-simple-binding crates (v2.13+), rather than the raw 'sys' layer crates, resulting in significant simplification.

You may want to consider bumping the dependency of the sys layer to v1.12+ (via v2.15+ of the bindings) which implemented use of pkg-config.

One detail of the last commit that's slightly uglier than I'd like is how the Option<String> device name attribute is used for the Option<&str> param. I'll see if I can improve the PulseAudio binding to allow it to be done in cleaner fashion.


🔄 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/540 **Author:** [@jnqnfe](https://github.com/jnqnfe) **Created:** 11/27/2020 **Status:** ✅ Merged **Merged:** 12/14/2020 **Merged by:** [@sashahilton00](https://github.com/sashahilton00) **Base:** `dev` ← **Head:** `pa` --- ### 📝 Commits (4) - [`cea63e5`](https://github.com/librespot-org/librespot/commit/cea63e57a4f4bd4393ad0da77eb7881bcb193d9b) use actual feature names rather than crate names for conditional compilation - [`28061df`](https://github.com/librespot-org/librespot/commit/28061dffe29963c0aa48619d54f1b9287133575d) upgrade to newer PulseAudio crate dependency - [`0411e69`](https://github.com/librespot-org/librespot/commit/0411e6954822cf97afb7d58b6088f8125aca78df) convert PulseAudio backend to use the available binding crates - [`120bd88`](https://github.com/librespot-org/librespot/commit/120bd88326c1f79b519fe3d07c212e34b2c4bc0a) fix alignment causing format check failure ### 📊 Changes **4 files changed** (+98 additions, -103 deletions) <details> <summary>View changed files</summary> 📝 `Cargo.lock` (+42 -3) 📝 `playback/Cargo.toml` (+3 -2) 📝 `playback/src/audio_backend/pulseaudio.rs` (+48 -92) 📝 `playback/src/lib.rs` (+5 -6) </details> ### 📄 Description Hi, I'm not actually a librespot user, I just ended up here from noticing the dependency on such an old version of `libpulse_sys` and found myself working on fixing it... This PR: - Bundles a trivial fix for instances of conditional compilation incorrectly using crate names instead of feature names. - Bumps the `libpulse_sys` dependency from v0.0.0 to v1.11+, which necessitates addition of `libpulse-simple_sys` since the 'simple' components were moved to their own crate (following the one crate per system library rule). This addresses the licensing issue mentioned in issue #539 with respect to this dependency. - Rewrites the PulseAudio backend code to use the higher-level `libpulse-binding` and `libpulse-simple-binding` crates (v2.13+), rather than the raw 'sys' layer crates, resulting in significant simplification. You may want to consider bumping the dependency of the sys layer to v1.12+ (via v2.15+ of the bindings) which implemented use of `pkg-config`. One detail of the last commit that's slightly uglier than I'd like is how the `Option<String>` device name attribute is used for the `Option<&str>` param. I'll see if I can improve the PulseAudio binding to allow it to be done in cleaner fashion. --- <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:37 +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#961
No description provided.