[PATCH] alsa-mixer: When setting hw volume, round always up with playback and always down with capture.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This was discussed on the mailing list:

https://tango.0pointer.de/pipermail/pulseaudio-discuss/2011-May/010091.html
---
 src/modules/alsa/alsa-mixer.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/modules/alsa/alsa-mixer.c b/src/modules/alsa/alsa-mixer.c
index f236da0..8375a2f 100644
--- a/src/modules/alsa/alsa-mixer.c
+++ b/src/modules/alsa/alsa-mixer.c
@@ -893,7 +893,7 @@ static int element_set_volume(pa_alsa_element *e, snd_mixer_t *m, const pa_chann
 
         if (e->has_dB) {
             long value = to_alsa_dB(f);
-            int rounding = value > 0 ? -1 : +1;
+            int rounding = e->direction == PA_ALSA_DIRECTION_OUTPUT ? +1 : -1;
 
             if (e->volume_limit >= 0 && value > (e->max_dB * 100))
                 value = e->max_dB * 100;
-- 
1.7.5.1




[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux