[PATCH 2/3] alsa: Default to 30% in absence of sink hw volume

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

 




On 2014-11-16 09:10, Tanu Kaskinen wrote:
> If a sound card has no hardware volume that we could query when
> creating a sink, 30% is a better default volume than 100%. 100% is
> likely to be far too loud.

To reiterate Alexander's comment, this highly depends on the type of 
output. Also, not sure percentage is the correct unit here.

For reference here's ALSA's init defaults (/usr/share/alsa/init/default):

# Basic rules are:
#  - keep volumes at minimal level, but sound should be hearable
#  - enable just main speakers for playback and main microphone for 
recording
#

ENV{ppercent}:="75%"
ENV{cpercent}:="75%"
ENV{pvolume}:="-20dB"
ENV{cvolume}:="12dB"

(where p and c stands for "playback" and "capture").

> ---
>   src/modules/alsa/alsa-sink.c | 4 ++++
>   1 file changed, 4 insertions(+)
>
> diff --git a/src/modules/alsa/alsa-sink.c b/src/modules/alsa/alsa-sink.c
> index 4ab3a22..6db56db 100644
> --- a/src/modules/alsa/alsa-sink.c
> +++ b/src/modules/alsa/alsa-sink.c
> @@ -2387,6 +2387,10 @@ pa_sink *pa_alsa_sink_new(pa_module *m, pa_modargs *ma, const char*driver, pa_ca
>       } else {
>           if (u->sink->get_volume)
>               u->sink->get_volume(u->sink);
> +        else {
> +            /* Default to 30% volume to avoid being too loud. */
> +            pa_cvolume_set(&u->sink->real_volume, u->sink->sample_spec.channels, PA_VOLUME_NORM * 0.3);
> +        }
>       }
>
>       if (mute_is_set) {
>

-- 
David Henningsson, Canonical Ltd.
https://launchpad.net/~diwic


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

  Powered by Linux