[pulseaudio-commits] 2 commits - src/modules src/pulsecore

Arun Raghavan arun at kemper.freedesktop.org
Fri Nov 4 04:34:27 PDT 2011


 src/modules/echo-cancel/webrtc.cc |    4 +-
 src/pulsecore/cli-command.c       |   58 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 61 insertions(+), 1 deletion(-)

New commits:
commit 0a238f69ad6b068ac62df85010da54cf75e3be35
Author: Arun Raghavan <arun.raghavan at collabora.co.uk>
Date:   Thu Aug 18 11:56:26 2011 +0530

    cli: Add a dump-volumes command
    
    The purpose of this command is to print all the internal volume
    variables for sinks/sources and all corresponding
    sink-inputs/source-outputs  to make debugging and reasoning about
    volume-related issues easier.

diff --git a/src/pulsecore/cli-command.c b/src/pulsecore/cli-command.c
index 6a2e5ce..c38637d 100644
--- a/src/pulsecore/cli-command.c
+++ b/src/pulsecore/cli-command.c
@@ -130,6 +130,7 @@ static int pa_cli_command_update_source_output_proplist(pa_core *c, pa_tokenizer
 static int pa_cli_command_card_profile(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
 static int pa_cli_command_sink_port(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
 static int pa_cli_command_source_port(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
+static int pa_cli_command_dump_volumes(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
 
 /* A method table for all available commands */
 
@@ -187,6 +188,7 @@ static const struct command commands[] = {
     { "set-log-meta",            pa_cli_command_log_meta,           "Show source code location in log messages (args: bool)", 2},
     { "set-log-time",            pa_cli_command_log_time,           "Show timestamps in log messages (args: bool)", 2},
     { "set-log-backtrace",       pa_cli_command_log_backtrace,      "Show backtrace in log messages (args: frames)", 2},
+    { "dump-volumes",            pa_cli_command_dump_volumes,       NULL, 1 },
     { NULL, NULL, NULL, 0 }
 };
 
@@ -1662,6 +1664,62 @@ static int pa_cli_command_dump(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_b
     return 0;
 }
 
+static int pa_cli_command_dump_volumes(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail) {
+    pa_sink *s;
+    pa_source *so;
+    pa_sink_input *i;
+    pa_source_output *o;
+    uint32_t s_idx, i_idx;
+    char v_str[PA_CVOLUME_SNPRINT_MAX];
+
+    pa_core_assert_ref(c);
+    pa_assert(t);
+    pa_assert(buf);
+    pa_assert(fail);
+
+    PA_IDXSET_FOREACH(s, c->sinks, s_idx) {
+        pa_strbuf_printf(buf, "Sink %d: ", s_idx);
+        pa_strbuf_printf(buf, "reference = %s, ", pa_cvolume_snprint(v_str, sizeof(v_str), &s->reference_volume));
+        pa_strbuf_printf(buf, "real = %s, ", pa_cvolume_snprint(v_str, sizeof(v_str), &s->real_volume));
+        pa_strbuf_printf(buf, "soft = %s, ", pa_cvolume_snprint(v_str, sizeof(v_str), &s->soft_volume));
+        pa_strbuf_printf(buf, "current_hw = %s, ", pa_cvolume_snprint(v_str, sizeof(v_str), &s->thread_info.current_hw_volume));
+        pa_strbuf_printf(buf, "save = %s\n", pa_yes_no(s->save_volume));
+
+        PA_IDXSET_FOREACH(i, s->inputs, i_idx) {
+            pa_strbuf_printf(buf, "\tInput %d: ", i_idx);
+            pa_strbuf_printf(buf, "volume = %s, ", pa_cvolume_snprint(v_str, sizeof(v_str), &i->volume));
+            pa_strbuf_printf(buf, "reference_ratio = %s, ", pa_cvolume_snprint(v_str, sizeof(v_str), &i->reference_ratio));
+            pa_strbuf_printf(buf, "real_ratio = %s, ", pa_cvolume_snprint(v_str, sizeof(v_str), &i->real_ratio));
+            pa_strbuf_printf(buf, "soft = %s, ", pa_cvolume_snprint(v_str, sizeof(v_str), &i->soft_volume));
+            pa_strbuf_printf(buf, "volume_factor = %s, ", pa_cvolume_snprint(v_str, sizeof(v_str), &i->volume_factor));
+            pa_strbuf_printf(buf, "volume_factor_sink = %s, ", pa_cvolume_snprint(v_str, sizeof(v_str), &i->volume_factor_sink));
+            pa_strbuf_printf(buf, "save = %s\n", pa_yes_no(i->save_volume));
+        }
+    }
+
+    PA_IDXSET_FOREACH(so, c->sources, s_idx) {
+        pa_strbuf_printf(buf, "Source %d: ", s_idx);
+        pa_strbuf_printf(buf, "reference = %s, ", pa_cvolume_snprint(v_str, sizeof(v_str), &so->reference_volume));
+        pa_strbuf_printf(buf, "real = %s, ", pa_cvolume_snprint(v_str, sizeof(v_str), &so->real_volume));
+        pa_strbuf_printf(buf, "soft = %s, ", pa_cvolume_snprint(v_str, sizeof(v_str), &so->soft_volume));
+        pa_strbuf_printf(buf, "current_hw = %s, ", pa_cvolume_snprint(v_str, sizeof(v_str), &so->thread_info.current_hw_volume));
+        pa_strbuf_printf(buf, "save = %s\n", pa_yes_no(so->save_volume));
+
+        PA_IDXSET_FOREACH(o, so->outputs, i_idx) {
+            pa_strbuf_printf(buf, "\tOutput %d: ", i_idx);
+            pa_strbuf_printf(buf, "volume = %s, ", pa_cvolume_snprint(v_str, sizeof(v_str), &o->volume));
+            pa_strbuf_printf(buf, "reference_ratio = %s, ", pa_cvolume_snprint(v_str, sizeof(v_str), &o->reference_ratio));
+            pa_strbuf_printf(buf, "real_ratio = %s, ", pa_cvolume_snprint(v_str, sizeof(v_str), &o->real_ratio));
+            pa_strbuf_printf(buf, "soft = %s, ", pa_cvolume_snprint(v_str, sizeof(v_str), &o->soft_volume));
+            pa_strbuf_printf(buf, "volume_factor = %s, ", pa_cvolume_snprint(v_str, sizeof(v_str), &o->volume_factor));
+            pa_strbuf_printf(buf, "volume_factor_source = %s, ", pa_cvolume_snprint(v_str, sizeof(v_str), &o->volume_factor_source));
+            pa_strbuf_printf(buf, "save = %s\n", pa_yes_no(o->save_volume));
+        }
+    }
+
+    return 0;
+}
+
 int pa_cli_command_execute_line_stateful(pa_core *c, const char *s, pa_strbuf *buf, pa_bool_t *fail, int *ifstate) {
     const char *cs;
 

commit 0d13f6ebd28e034a02e33a191e9ef97118fa890b
Author: Arun Raghavan <arun.raghavan at collabora.co.uk>
Date:   Thu Nov 3 19:16:47 2011 +0530

    echo-cancel: Fix webrtc gain control initialisation

diff --git a/src/modules/echo-cancel/webrtc.cc b/src/modules/echo-cancel/webrtc.cc
index f84555b..df4d34d 100644
--- a/src/modules/echo-cancel/webrtc.cc
+++ b/src/modules/echo-cancel/webrtc.cc
@@ -111,7 +111,7 @@ pa_bool_t pa_webrtc_ec_init(pa_core *c, pa_echo_canceller *ec,
     }
 
     dgc = DEFAULT_DIGITAL_GAIN_CONTROL;
-    if (pa_modargs_get_value_boolean(ma, "analog_gain_control", &dgc) < 0) {
+    if (pa_modargs_get_value_boolean(ma, "digital_gain_control", &dgc) < 0) {
         pa_log("Failed to parse digital_gain_control value");
         goto fail;
     }
@@ -203,6 +203,8 @@ pa_bool_t pa_webrtc_ec_init(pa_core *c, pa_echo_canceller *ec,
             pa_log("Analog gain control isn't implemented yet -- using ditital gain control.");
             apm->gain_control()->set_mode(webrtc::GainControl::kAdaptiveDigital);
         }
+
+        apm->gain_control()->Enable(true);
     }
 
     apm->voice_detection()->Enable(true);



More information about the pulseaudio-commits mailing list