On Mon, 2016-01-18 at 13:06 +0530, arun at accosted.net wrote: > From: Arun Raghavan <git at arunraghavan.net> > > --- > Â src/modules/echo-cancel/webrtc.cc | 14 ++++++++++---- > Â 1 file changed, 10 insertions(+), 4 deletions(-) > > diff --git a/src/modules/echo-cancel/webrtc.cc b/src/modules/echo-cancel/webrtc.cc > index 2732b38..5741f45 100644 > --- a/src/modules/echo-cancel/webrtc.cc > +++ b/src/modules/echo-cancel/webrtc.cc > @@ -284,7 +284,10 @@ bool pa_webrtc_ec_init(pa_core *c, pa_echo_canceller *ec, > Â Â Â Â Â Â Â Â Â webrtc::StreamConfig(play_ss->rate, play_ss->channels, false), /* reverse input stream */ > Â Â Â Â Â Â Â Â Â webrtc::StreamConfig(play_ss->rate, play_ss->channels, false), /* reverse output stream */ > Â Â Â Â Â }; > -Â Â Â Â apm->Initialize(pconfig); > +Â Â Â Â if (apm->Initialize(pconfig) != webrtc::AudioProcessing::kNoError) { > +Â Â Â Â Â Â Â Â pa_log("Error initialising audio processing module"); > +Â Â Â Â Â Â Â Â goto fail; > +Â Â Â Â } > Â > Â Â Â Â Â if (hpf) > Â Â Â Â Â Â Â Â Â apm->high_pass_filter()->Enable(true); > @@ -313,7 +316,8 @@ bool pa_webrtc_ec_init(pa_core *c, pa_echo_canceller *ec, > Â Â Â Â Â Â Â Â Â Â Â Â Â ec->params.webrtc.agc = false; > Â Â Â Â Â Â Â Â Â } else { > Â Â Â Â Â Â Â Â Â Â Â Â Â apm->gain_control()->set_mode(webrtc::GainControl::kAdaptiveAnalog); > -Â Â Â Â Â Â Â Â Â Â Â Â if (apm->gain_control()->set_analog_level_limits(0, WEBRTC_AGC_MAX_VOLUME) != apm->kNoError) { > +Â Â Â Â Â Â Â Â Â Â Â Â if (apm->gain_control()->set_analog_level_limits(0, WEBRTC_AGC_MAX_VOLUME) != > +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â webrtc::AudioProcessing::kNoError) { > Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â pa_log("Failed to initialise AGC"); > Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â goto fail; > Â Â Â Â Â Â Â Â Â Â Â Â Â } > @@ -361,7 +365,8 @@ void pa_webrtc_ec_play(pa_echo_canceller *ec, const uint8_t *play) { > Â Â Â Â Â pa_assert(play_frame.samples_per_channel_ <= webrtc::AudioFrame::kMaxDataSizeSamples); > Â Â Â Â Â memcpy(play_frame.data_, play, ec->params.webrtc.blocksize * pa_frame_size(ss)); > Â > -Â Â Â Â apm->ProcessReverseStream(&play_frame); > +Â Â Â Â if (apm->ProcessReverseStream(&play_frame) != webrtc::AudioProcessing::kNoError) > +Â Â Â Â Â Â Â Â pa_log("Failed to process playback stream"); > Â } > Â > Â void pa_webrtc_ec_record(pa_echo_canceller *ec, const uint8_t *rec, uint8_t *out) { > @@ -387,7 +392,8 @@ void pa_webrtc_ec_record(pa_echo_canceller *ec, const uint8_t *rec, uint8_t *out > Â Â Â Â Â } > Â > Â Â Â Â Â apm->set_stream_delay_ms(0); > -Â Â Â Â apm->ProcessStream(&out_frame); > +Â Â Â Â if (apm->ProcessStream(&out_frame) != webrtc::AudioProcessing::kNoError) > +Â Â Â Â Â Â Â Â pa_log("Failed to process capture stream"); I don't like error messages that can spam the syslog. Would a hard failure be acceptable here (that is, unload the module, or change to a failure state where the module stays around but does no processing)? --Â Tanu