Skip to content
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

Make the default volume configurable #910

Closed
mgoltzsche opened this issue Sep 12, 2021 · 11 comments
Closed

Make the default volume configurable #910

mgoltzsche opened this issue Sep 12, 2021 · 11 comments
Labels
feature request next release fixed in develop branch and will be part of the next release

Comments

@mgoltzsche
Copy link

mgoltzsche commented Sep 12, 2021

@badaix First of all thanks for providing and maintaining this awesome piece of software!

Is your feature request related to a problem? Please describe.
When connecting a new snapclient, its volume is set to 100%.
However this can be very annoying and even damage speakers when audio is already playing at that point.
To give an example I am experimenting with a snapcast setup where a snapclient is run on a Raspberry Pi 3 with a Hifiberry Amp2 using the client option --mixer hardware:Digital. Setting the volume to 100% is very loud since it outputs 60W. Eventually it would even kill the old/cheap speakers I am using for testing purposes if I'd keep playing audio at that level (not sure if they got worse already after a couple of those accidents). Also I think my neighbors are angry with me now 😉.

This relates to #735, particularly to #735 (comment). cc @lucianm.

Describe the solution you'd like
To be safe, I'd like to be able to configure the default volume for new clients to eg. 30% to avoid such accidents.
I think it would be best to be able to make it configurable within the client. Though it would also be fine if it would be configurable on the server if that's easier to implement.

Describe alternatives you've considered
Stay focussed when connecting a new client, make sure no audio is playing, decrease the new client's volume before starting to play music.

@stuart12
Copy link
Contributor

stuart12 commented Nov 8, 2021

I have a similar use case for this feature request. My USB sound card does not have a hardware volume control so if snapserver is sending audio when my machine starts, the audio plays at 100% until homeassistant starts and turns the volume in snapcast down. I'd thus like to set the default (or initial volume) to 0% or muted.

@nis65
Copy link
Contributor

nis65 commented Dec 26, 2021

Is anyone working on that already? If not, I might have a look at the source if I would be able to implement this - at least with a little help from my friends 😄. Actually I won't have time before February/March 2022, but I would love to have this feature...

@nis65
Copy link
Contributor

nis65 commented Dec 28, 2021

@mgoltzsche @badaix I was thinking about where such a feature should be implemented and would be happy to receive your opinion:

From a users point of view I think it would be nice to set the initial snapclient volume as a snapclient parameter. With this, I could have individual defaults depending on whether I am deploying to a raspi with an AMP where the snapclient volume is the last volume control in the chain (e.g. initial snapclient volume 10%) and a snapclient with a line out that is connected to an amp with hardware volume control (e.g. initial snapclient volume 100%).

But from a technical point of view the snapclient volume is set/defined on the server (is that correct?). So it is simpler (and also probably more suitable to the snapcast architecture) just to have one global "initial volume" on the snapserver that is assigned to each snapclient on initial connect.

@nis65
Copy link
Contributor

nis65 commented Dec 28, 2021

Tried to understand the source / protocol

@nis65
Copy link
Contributor

nis65 commented Jun 20, 2022

Update: Finally had some the time to compile snapcast on my raspi. For a quick test, I manually replaced the snapserver binary in /usr/bin/with the one compiled by myself and everything still worked. Now the fun can begin...

@nis65
Copy link
Contributor

nis65 commented Jun 25, 2022

And YES, I have a working solution 😄

I'll have to properly prepare a merge request now and then hope that it'll get merged sometime.

Have a preview here, it's less than 10 lines added. You'll have to compile from source to test it. I did it on a Raspberry4 (to prevent me from having to play with crosscompile), a full recompile of everything takes a bit more than 30 minutes, you can try to compile snapserver only if you want.

Please contact me directly if you want me to get a copy of my snapserver Raspberry binary.

@mgoltzsche
Copy link
Author

mgoltzsche commented Jun 25, 2022 via email

@nis65
Copy link
Contributor

nis65 commented Jul 4, 2022

@badaix @mgoltzsche

As the change is now merged into develop, what happens to the issue here? Will/can you @mgoltzsche close it (as you opened it) or will @badaix have to do this?

And should this happen now or when the feature is promoted from develop to master only?

@badaix badaix added the next release fixed in develop branch and will be part of the next release label Jul 4, 2022
@badaix
Copy link
Owner

badaix commented Jul 4, 2022

My usual process is to mark it as "next release", once it is in develop and to close it when it's merged into master and releases.
So I will not forget to mention it in the release notes and anyone wanting a similar feature will see it and know that it will be part of the next release

@nis65
Copy link
Contributor

nis65 commented Jul 4, 2022

Perfect.So I'll await the next release 🙂 .

@badaix
Copy link
Owner

badaix commented Feb 5, 2023

Fixed in snapcast v0.27.0

@badaix badaix closed this as completed Feb 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request next release fixed in develop branch and will be part of the next release
Projects
None yet
Development

No branches or pull requests

4 participants