> 99.9% of volume controls scale the output linearly.
Wrong. Windows's volume output is the percentage squared, and Linux PulseAudio's volume output is the percentage cubed. Nonetheless I would prefer that the volume output was exponential (2^(slider position / constant)). This way, pressing the "volume up" key 3 times always increases the volume by a constant factor, regardless if you're on loud or quiet speaker/headphones. Additionally, on loud headphones, you won't have to fine-tune the volume in the very bottom of the slider (eg. 1 is too quiet, 2 is a bit loud, 3 is painfully loud).
On Windows, I hide the default volume control and instead use Volume2[1] set to exponential mode. On Linux, I haven't found a good solution for getting PulseAudio to use exponential volumes.
When probing my Android phone's output in an oscilloscope, I also saw that it was not linear, and the volume increased more per level when louder. However I have not attempted to compute the exact curve. And I suspect it also differs between different versions of Android or different phones (my Android 11 phones has more volume levels than older phones), or with different audio APIs (some phones use tinyalsa, some use XML files to configure hardware volume gain, some don't).
You've given me an idea for a volume control - enter a function like x^2 or x^3, which is graphed (on a linear scale). Then pick an x. The y value will be your volume. (The component should reverse any platform specific non-linearity first.)
How would you compute the current volume level? You would have to either store the current x value (which could desync if you change the volume level using the OS volume control), or derive the nearest x from the current y value (which may be possible on PulseAudio, but I haven't checked if you're stuck to the nearest 1% or if you can get a more precise or dB level).
Well if the function you put in is continuous, single-valued , then you can invert it and compute x(y). At the end of the day if the volume is represented as a syscall with a float between 0 and 1 you can play arbitrary games with any bijective function to make setting that number arbitrarily complicated.
Wrong. Windows's volume output is the percentage squared, and Linux PulseAudio's volume output is the percentage cubed. Nonetheless I would prefer that the volume output was exponential (2^(slider position / constant)). This way, pressing the "volume up" key 3 times always increases the volume by a constant factor, regardless if you're on loud or quiet speaker/headphones. Additionally, on loud headphones, you won't have to fine-tune the volume in the very bottom of the slider (eg. 1 is too quiet, 2 is a bit loud, 3 is painfully loud).
On Windows, I hide the default volume control and instead use Volume2[1] set to exponential mode. On Linux, I haven't found a good solution for getting PulseAudio to use exponential volumes.
[1]: https://irzyxa.blogspot.com/p/downloads.html