[PR #40] [MERGED] Implement synchronisation between ALSA and Spotify volume #182

Closed
opened 2026-02-28 14:26:09 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/devgianlu/go-librespot/pull/40
Author: @tooxo
Created: 5/27/2024
Status: Merged
Merged: 7/2/2024
Merged by: @devgianlu

Base: masterHead: implement_alsa_mixer_sync


📝 Commits (7)

  • adb7227 poc for implementing synchronization between alsa mixer and spotify volume
  • 1e62028 feat: don't touch mixer volume if externalVolume is enabled
  • fe7f27d extracted RingBuffer to struct
  • 0aeb7e1 fixed unexpected issues with external volume
  • b237bcb Merge branch 'devgianlu:master' into implement_alsa_mixer_sync
  • b57a149 let mixer and externalVolume behave as specified
  • d774d7c un-capitalize log messages

📊 Changes

6 files changed (+201 additions, -47 deletions)

View changed files

📝 cmd/daemon/main.go (+33 -7)
📝 cmd/daemon/player.go (+10 -6)
📝 config_schema.json (+7 -2)
📝 output/driver_unix.go (+105 -19)
📝 output/output.go (+33 -1)
📝 player/player.go (+13 -12)

📄 Description

This is a first POC for implementing the feature I mentioned in #36.
I've never written any GO before, so it would be nice if someone could give me some feedback on where I could make improvements.

Features:

  • Everytime the ALSA volume is changed, the volume in spotify also changes.
  • Sync the volume from ALSA to Spotify on connect or startup
  • Make the behaviour configurable
    • (The synchronization should only be enabled, if externalVolume is true)
    • The ALSA control name needs to be configurable (currently hardcoded as master)
    • Mixer functionality should be opt-in instead of opt-out
    • ...
  • Documentation explaining the feature

🔄 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/devgianlu/go-librespot/pull/40 **Author:** [@tooxo](https://github.com/tooxo) **Created:** 5/27/2024 **Status:** ✅ Merged **Merged:** 7/2/2024 **Merged by:** [@devgianlu](https://github.com/devgianlu) **Base:** `master` ← **Head:** `implement_alsa_mixer_sync` --- ### 📝 Commits (7) - [`adb7227`](https://github.com/devgianlu/go-librespot/commit/adb72278fca5da2590cb580a208665810dbe91ce) poc for implementing synchronization between alsa mixer and spotify volume - [`1e62028`](https://github.com/devgianlu/go-librespot/commit/1e62028946a8c1c3d39243be2a216ccf199ffdcb) feat: don't touch mixer volume if externalVolume is enabled - [`fe7f27d`](https://github.com/devgianlu/go-librespot/commit/fe7f27d3856da628a04ba75f5bc65d6a03755f10) extracted RingBuffer to struct - [`0aeb7e1`](https://github.com/devgianlu/go-librespot/commit/0aeb7e1c0e6b235e42de829d6ee1d9e1f95a981f) fixed unexpected issues with external volume - [`b237bcb`](https://github.com/devgianlu/go-librespot/commit/b237bcbaba0d526ee70df656a9bfdf1b2f70d8a7) Merge branch 'devgianlu:master' into implement_alsa_mixer_sync - [`b57a149`](https://github.com/devgianlu/go-librespot/commit/b57a1492d51fc67e97d6d02fdd4d71277c6b4947) let mixer and externalVolume behave as specified - [`d774d7c`](https://github.com/devgianlu/go-librespot/commit/d774d7c90a9ae4b29eee7ff7de196ec6a1101167) un-capitalize log messages ### 📊 Changes **6 files changed** (+201 additions, -47 deletions) <details> <summary>View changed files</summary> 📝 `cmd/daemon/main.go` (+33 -7) 📝 `cmd/daemon/player.go` (+10 -6) 📝 `config_schema.json` (+7 -2) 📝 `output/driver_unix.go` (+105 -19) 📝 `output/output.go` (+33 -1) 📝 `player/player.go` (+13 -12) </details> ### 📄 Description This is a first POC for implementing the feature I mentioned in #36. I've never written any GO before, so it would be nice if someone could give me some feedback on where I could make improvements. Features: - [x] Everytime the ALSA volume is changed, the volume in spotify also changes. - [x] Sync the volume from ALSA to Spotify on connect or startup - [x] Make the behaviour configurable - [x] ~~(The synchronization should only be enabled, if externalVolume is true)~~ - [x] The ALSA control name needs to be configurable (currently hardcoded as master) - [x] Mixer functionality should be opt-in instead of opt-out - [ ] ... - [ ] Documentation explaining the feature --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-28 14:26:09 +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/go-librespot#182
No description provided.