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>
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);