Skip to content
Snippets Groups Projects
Commit 576b60a9 authored by Sébastien Blin's avatar Sébastien Blin Committed by Adrien Béraud
Browse files

pulseaudio: avoid to change volumes previously set

Because PulseAudio got flat-volumes on by default, getting an
echo-cancelled stream will, without option, set the master and
echo-cancelled volume to 33%.
This will make the user adjust their microphone every time.
Moreover, the module seems to re-adjust automatically the volume
with some gain control options.
So, in this patch, we load the echo-cancel without volume sharing
and with options to avoid to change a volume previously set.

Sources:
https://wiki.archlinux.org/title/PulseAudio/Troubleshooting
https://askubuntu.com/questions/1015327/disable-volume-auto-adjust-in-pulseaudio-module-echo-cancel
https://askubuntu.com/questions/279407/how-to-disable-microphone-from-auto-adjusting-its-input-volume

Change-Id: I981d1fedf7424895e6f44e9906e385f9c21bddee
parent 287cfa36
No related branches found
No related tags found
No related merge requests found
......@@ -59,6 +59,15 @@ AudioStream::AudioStream(pa_context* c,
std::unique_ptr<pa_proplist, decltype(pa_proplist_free)&> pl(pa_proplist_new(),
pa_proplist_free);
pa_proplist_sets(pl.get(), PA_PROP_FILTER_WANT, "echo-cancel");
pa_proplist_sets(
pl.get(), "filter.apply.echo-cancel.parameters", // needs pulseaudio >= 11.0
"use_volume_sharing=0" // share volume with master sink/source
" use_master_format=1" // use format/rate/channels from master sink/source
" aec_args=\""
"digital_gain_control=1"
" analog_gain_control=0"
" experimental_agc=1"
"\"");
audiostream_ = pa_stream_new_with_proplist(c,
desc,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment