[PR #245] [MERGED] Support for alsa mixer #848

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

📋 Pull Request Information

Original PR: https://github.com/librespot-org/librespot/pull/245
Author: @ashthespy
Created: 9/5/2018
Status: Merged
Merged: 3/25/2019
Merged by: @ashthespy

Base: masterHead: alsa


📝 Commits (8)

  • a67048c Add initial support for alsamixer
  • 08cfb15 Switch to latest alsa-rs crate
  • 99106c5 Rework alsa hw and mixer parameters
  • 0e11470 Add run time option flags for AlsaMixer
  • a80bf86 Clean up alsa stragglers and typos
  • cc6c9b2 More alsa stragglers
  • 8fd0caf Explicitly set start_threshold and pretty print devices
  • 9cb2f49 Switch alsa to crates.io

📊 Changes

7 files changed (+247 additions, -33 deletions)

View changed files

📝 Cargo.lock (+25 -4)
📝 playback/Cargo.toml (+1 -1)
📝 playback/src/audio_backend/alsa.rs (+74 -13)
playback/src/mixer/alsamixer.rs (+78 -0)
📝 playback/src/mixer/mod.rs (+27 -4)
📝 playback/src/mixer/softmixer.rs (+2 -2)
📝 src/main.rs (+40 -9)

📄 Description

Following up from @joerg-krause's work from https://github.com/plietar/librespot/pull/160 (#45)

Have finally found time to better understand (by just a little) the alsa hardware parameters (snd_pcm_hw_params_t) and get this working with the latest version of the alsa-rs crate.

What remains to be done is passing the mixer/card/index parameters in. I currently cheat and use environment variables, but will polish it up based on what would work best.
Have exposed some new mixer-name, mixer-card and mixer-index run time flags.

Also - let me know if you see gaping holes in the arithmetic for the conversion


🔄 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/245 **Author:** [@ashthespy](https://github.com/ashthespy) **Created:** 9/5/2018 **Status:** ✅ Merged **Merged:** 3/25/2019 **Merged by:** [@ashthespy](https://github.com/ashthespy) **Base:** `master` ← **Head:** `alsa` --- ### 📝 Commits (8) - [`a67048c`](https://github.com/librespot-org/librespot/commit/a67048c3d711bf8dd5b9bd68034b8c9ce37d235b) Add initial support for `alsamixer` - [`08cfb15`](https://github.com/librespot-org/librespot/commit/08cfb1516ddb0ad45bdff6c5f5d1924b362a1f33) Switch to latest `alsa-rs` crate - [`99106c5`](https://github.com/librespot-org/librespot/commit/99106c5ae335377d6510ad649fa7cdae54aa364a) Rework `alsa` hw and mixer parameters - [`0e11470`](https://github.com/librespot-org/librespot/commit/0e1147077c590d26d04cb469c386f0a00f69c2f3) Add run time option flags for `AlsaMixer` - [`a80bf86`](https://github.com/librespot-org/librespot/commit/a80bf86a2b71ab0721fbb68ae9cedbd2b30c3e7e) Clean up alsa stragglers and typos - [`cc6c9b2`](https://github.com/librespot-org/librespot/commit/cc6c9b2dc4fae61ad79a96384357fd9d4e3b3dc1) More `alsa` stragglers - [`8fd0caf`](https://github.com/librespot-org/librespot/commit/8fd0caf583e7def555cfbb595d88d709980ae0a8) Explicitly set `start_threshold` and pretty print devices - [`9cb2f49`](https://github.com/librespot-org/librespot/commit/9cb2f49d529052f9f0d1f1a4999e7d1396afed51) Switch `alsa` to crates.io ### 📊 Changes **7 files changed** (+247 additions, -33 deletions) <details> <summary>View changed files</summary> 📝 `Cargo.lock` (+25 -4) 📝 `playback/Cargo.toml` (+1 -1) 📝 `playback/src/audio_backend/alsa.rs` (+74 -13) ➕ `playback/src/mixer/alsamixer.rs` (+78 -0) 📝 `playback/src/mixer/mod.rs` (+27 -4) 📝 `playback/src/mixer/softmixer.rs` (+2 -2) 📝 `src/main.rs` (+40 -9) </details> ### 📄 Description Following up from @joerg-krause's work from https://github.com/plietar/librespot/pull/160 (#45) Have finally found time to better understand (by just a little) the alsa hardware parameters [(`snd_pcm_hw_params_t`)](http://www.alsa-project.org/alsa-doc/alsa-lib/group___p_c_m___h_w___params.html) and get this working with the latest version of the `alsa-rs` crate. ~~What remains to be done is passing the mixer/card/index parameters in. I currently cheat and use environment variables, but will polish it up based on what would work best.~~ Have exposed some new `mixer-name`, `mixer-card` and `mixer-index` run time flags. Also - let me know if you [see gaping holes in the arithmetic for the conversion](https://play.rust-lang.org/?gist=842a9c3ed89bd5e9a2a5c92f17573d9d&version=stable&mode=debug&edition=2015) --- <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:11 +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#848
No description provided.