mirror of
https://github.com/librespot-org/librespot.git
synced 2026-04-27 08:15:50 +03:00
[GH-ISSUE #1162] Implement generic dummy mixer #536
Labels
No labels
A-Alsa
SpotifyAPI
Tokio 1.0
audio
bug
can't reproduce
compilation
dependencies
duplicate
enhancement
good first issue
help wanted
high priority
imported
imported
invalid
new api
pull-request
question
reverse engineering
wiki
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/librespot#536
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @sqozz on GitHub (May 11, 2023).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/1162
Is your feature request related to a problem? Please describe.
I route librespot into pulseaudio to mix it with other sources. The result is written into a socket which is consumed by snapcast. From a users perspective it would be nice if the volume slider in Spotify/the Spotify App could control the general master volume of snapcast.
Describe the solution you'd like
I would like to control the Spotify volume slider without adjusting the actual volume. The volume regulation should happen by an external script which receives the selected volume (I think
oneventalready receives the selected volume) and e.g. does http requests to something to adjust the volume.Describe alternatives you've considered
I considered (ab)using pulseaudio for that purpose. Unfortunately it seems like the PA backend is not supported for the
--mixeroption. I also tried to make use of--mixer softvol --volume-ctrl fixed --initial-volume 100(Which is described here) but this just disabled volume control via Spotify completely and therefore anonevent-script cannot receive the volume change.Additional context
Supporting pulseaudio as mixer might be a viable solution but I think a much more generic solution would be a "dummy" volume regulation which receives the selected level but does not adjust the audio stream.
@kingosticks commented on GitHub (May 11, 2023):
When you specify
--volume-ctrl fixedwe do not advertise the ability to change the volume and the UI will likely be disabled in a Connect controller, as you saw.We already have
librespot::playback::mixer::NoOpVolumebut it's not exposed through the--mixeroption. Adding it will probably be enough to make this use case work. Give it a try?@sqozz commented on GitHub (May 12, 2023):
Yes this sounds like it would actually cover my needs. I tried to come up with some code changes but never programmed in rust and it is not even close to be suitable as a PR so I will just attach it as patch here:
It somehow works but the whole "softvol as default" logic for
--mixeris now broken. If somebody has hints or wants to pick up my patch I'd be very happy :) My snippet is CC-0 so no mention, credit, anything needed.@martignlo commented on GitHub (Mar 13, 2025):
I'm also very interested in this feature. My use case is to listen for volume change events and execute a command (
ir-sendto increase/decrease the volume of the amplifier).I'm currently using
softvol, but the result is that the volume is adjusted on the amplifier, but also in librespot.Any chance the
NoOpMixercan be added to the list of mixers?