-
Notifications
You must be signed in to change notification settings - Fork 634
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Null mixer to skip volume control #286
Conversation
Thanks for implementing this feature, it's a relevant use case, I need it as well. I implemented a fixed-volume setting but your solution is the better one. |
Implement a null mixer that does not control volume with software.
Might be interesting to have option to disable volume control in your case also in the clients. But sounds very similar to my use case: I had the soft volume disabled and then synced volume to my amplifier separately as it has a TCP/IP API. That said, as a workaround (or a better solution, depending on use case), you could create a null sink in PulseAudio and set that as a mixer for librespot. Then librespot controls the dummy mixer rather than the real sound device.
And then give librespot options I believe similar functionality exists in ALSA, but I used Pulse as I could quickly figure out how to have a meaningful name for the null sink. |
Thanks for your additional ideas. About disabling volume control in the clients - how could this be done when your client is the Spotify app? |
The additional pulse audio sink is there only to defeat volume control. I guess you could use any existing extra audio devices or in Alsa load dummy driver. Mixer card is separate from the audio device used for playback and no audio samples is going through the dummy device. Regarding disabling volume control, I'm not sure either how that could be done. However, I know that when I'm playing on a phone, the official Spotify client does not allow me to change volume of the device. There must be a flag in the protocol to disable remote volume control. |
Ah, I seem to have missed seeing this for some reason.
This can be done by setting A simpler solution that also seems to work is use the current protobuf format is to set |
@ashthespy - Trying to build your commit, I get these kinds of errors: I'm still relatively new to rust projects, so I may be missing something obvious, if so can you give me a hint how to build? Or has something gone awry with dependencies. |
@JohanGroenenboom that branch is setup to use a library, and not as a binary. You'd need to uncomment out the dependencies in |
Implement a null mixer that does not control volume with software. Having such mechanism is useful if you want to use some external method for volume control, but it isn't available in Librespot.
To support the null mixer, we'd most likely want to also expose volume changes as events that trigger external script.