Lowering volume below 0 causes overflow spike to 100% volume (volume goes
below 0 and back to 100 repeatedly). 0 overflows past infinity when holding
down z,x,c.
> value = lrint_dir(6000.0 * log10(volume), dir) + max;
(where volume = 0 , and dir = -1 . min = -9999999 , and max = -6)
> log10(0) is negative infinity = error
Fixes: https://github.com/alsa-project/alsa-utils/pull/266
Reported-by: genr8eofl <genBTC@gmx.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
exp10 is a GNU extension and not available everywhere (eg. uClibc-ng).
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Fixes Master, Headphones and Speaker stuck at -8 percentage after
building with Clang 7.0.1 and getting warned about implicit declaration
of exp10, which is behind _GNU_SOURCE as a non-standard feature. Thanks
Takashi Iwai for the CFLAGS suggestion on the mailing list. GCC build is
not affected, so not adding a compiler check to the configure script.
uClibc-ng has got exp10 since 1.0.12, so the fallback macro is no longer
needed. However, alsa-utils relies on gettext so might need further
patches to actually work on uClibc systems.
Signed-off-by: makepost <makepost@firemail.cc>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
exp10 is a glibc extension, which isn't supported on uClibc. Luckily,
exp10() is trivial to compute based on exp(), so add a wrapper for
the uClibc case.
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Instead of mapping the raw volume values linearly to the screen, use
a mapping where the bar height is proportional to the audible volume,
i.e., where the amplitude is the cube of the bar height.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>