ashthespy / Vollibrespot

Spotify Connect daemon for Volumio
MIT License
20 stars 8 forks source link

Implement volume thresholds #4

Open ashthespy opened 4 years ago

ashthespy commented 4 years ago

Cross ref: https://github.com/volumio/volumio-plugins/issues/420

There's isn't any threshold on the volume implement for the mixer, so this makes it currently not possible to respect Volumio's volumemax option.

ashthespy commented 4 years ago

@Rick-T A question - How should this threshold be maped to 0 -100% range of the client? Should be a linear map - i.e if you set volumemax=40 as your threshold, then Client 50% = Alsa 20%? Or should it follow the cubic mapping of alsamixer? Or should it just be a simple hard threshold? Client 50% = Alsa 40%

Rick-T commented 4 years ago

@ashthespy Thank you asking, but I'm afraid I don't really know what the best solution would be as I don't know about the internal workings of alsa, volumio and your plugin.

Here's my thoughts anyways:

I think a hard limit would be weird. I think it would be more intuitive to have 100% in the client be max volume in alsa. I also think that the mapping between client volume and alsa volume should respect the settings from volumio, if possible. Afaik there's an option somewhere that lets you switch between linear and logarithmic volume control.

So to pick up your example, max volume at 40 and client volume at 50% would mean "volumio volume" at 20 and then the setting decides if the 20 is interpreted on a linear scale or a logarithmic one. Would that be possible?

ashthespy commented 4 years ago

I think a hard limit would be weird. I think it would be more intuitive to have 100% in the client be max volume in alsa.

This is where the confusion crept in - As I understand the volume control code, Volumio seems to just set a hard limit. Probably a good idea to check on what the "Audiophile" consensus in on this..

So to pick up your example, max volume at 40 and client volume at 50% would mean "volumio volume" at 20 and then the setting decides if the 20 is interpreted on a linear scale or a logarithmic one. Would that be possible?

Yes - this is how I would like to do it as well.