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

Volume is too LOUD #574

Open
ali1234 opened this issue Feb 1, 2021 · 2 comments
Open

Volume is too LOUD #574

ali1234 opened this issue Feb 1, 2021 · 2 comments

Comments

@ali1234
Copy link
Contributor

ali1234 commented Feb 1, 2021

In my opinion, the volume slider doesn't have enough range at low volume levels, and too much at high levels. Basically, the lowest volume you can set is too loud for a quiet room, and anything above 50% is absurdly loud.

Volume handling code is here: https://github.com/pimoroni/32blit-beta/blob/master/32blit-stm32/Src/32blit.cpp#L215

This code attempts to do a logarithmic volume control. However, it seems to be actually doing anti-log. I made a graph to plot the output from this function:

https://www.desmos.com/calculator/rzxgdduvi7

H is the value of volume_log_base which is a constant in the code. In the existing code it equals 2. This makes the volume increase quickly at first, and then slowly at higher volumes. This seems backwards to me: it should increase slowly at first, and then quickly at higher volumes. In order to achieve that, H must be less than 1. (At 1 it would behave linearly, except that it causes a division by zero because log(1) = 0.)

From experimentation I have found that a value around 0.04 is needed to get the lowest volume setting suitable for a quiet room (and therefore an even lower value may be desirable).

(Note that this doesn't change how loud the loudest setting is, it just changes how quickly the volume increases.)

@tinwhisker
Copy link
Contributor

Would an 's' curve formula be more suited? This would give greater granularity at either end.

@ali1234
Copy link
Contributor Author

ali1234 commented Feb 15, 2021

Not really. Currently there is no discernable difference between the maximum and max-1 volume, while min+1 is about twice as loud as minimum volume. The backlight control behaves in a very similar way too. This is to be expected, because human senses are logarithmic (and the current volume algorithm in the firmware is anti-log ie it makes the problem worse).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants