summaryrefslogtreecommitdiff
path: root/src/modules/alsa/alsa-mixer.c
diff options
context:
space:
mode:
authorTanu Kaskinen <tanuk@iki.fi>2021-01-18 17:36:20 +0200
committerTanu Kaskinen <tanuk@iki.fi>2021-01-18 17:40:28 +0200
commitac7f2d96c7fc2d83f4a9fd74724ceaa9a634fe72 (patch)
tree441208920dcdb54ac98c85acdaa3554bd8380e00 /src/modules/alsa/alsa-mixer.c
parent10ac01a2066b3d0a58ecc3e3db98dd43c284a209 (diff)
alsa-mixer: Accept negative max_dB when using decibel fixes
Sometimes decibel fixes are used as a trick to set a maximum hardware volume, and in these cases max_dB may be negative yet still valid. Here's an example: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/292#note_671300 Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/447>
Diffstat (limited to 'src/modules/alsa/alsa-mixer.c')
-rw-r--r--src/modules/alsa/alsa-mixer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/modules/alsa/alsa-mixer.c b/src/modules/alsa/alsa-mixer.c
index 1cfc42633..0bbac262e 100644
--- a/src/modules/alsa/alsa-mixer.c
+++ b/src/modules/alsa/alsa-mixer.c
@@ -1712,7 +1712,7 @@ static bool element_probe_volume(pa_alsa_element *e, snd_mixer_elem_t *me) {
e->has_dB = snd_mixer_selem_get_capture_dB_range(me, &min_dB, &max_dB) >= 0;
/* Assume decibel data to be incorrect if max_dB is negative. */
- if (e->has_dB && max_dB < 0) {
+ if (e->has_dB && max_dB < 0 && !e->db_fix) {
pa_alsa_mixer_id_to_string(buf, sizeof(buf), &e->alsa_id);
pa_log_warn("The decibel volume range for element %s (%li dB - %li dB) has negative maximum. "
"Disabling the decibel range.", buf, min_dB, max_dB);