Hier mal als Zitat der relevante Text für linphone
ZitatAlles anzeigen
Sound and echo cancellation settings
Sound levels
It is possible to tune the microphone input gain and speaker/receiver
output gain by setting parameters into the linphonerc factory config
file loaded when instanciating the LinphoneCore.
These gains are liblinphone's internal software gains and are unrelated
to volume levels managed by the operating system. For example:
[sound]#set the speaker or receiver playback gain in dbm0 (0 db = no change). playback_gain_db=-3#set the microphone gain in linear scale:mic_gain=0.1
Echo cancellation
On Android devices, there are two kind of situations regarding echo cancellation:
- The new (after 2011) high end devices, on which manufacturers often include a hardware echo cancellation. If available, liblinphone will make use of it and no software correction is required. Source file linphone-android/submodules/linphone/mediastreamer2/java/src/org/linphone/mediastream/video/capture/hwconf/Hacks.java contains a method hasBuiltInEchoCanceller() that returns true if an hardware echo canceller is available, based on device model identifier. The current list is incomplete.
- The other devices, for which it is recommended to enable the software echo canceller of liblinphone.
Echo calibration tool
The echo calibration procedure is a five second audio test which
consists in playing small beeps to the receiver while the microphone
input is recorded.
If the device is subject to echo (or doesn't have hardware echo
cancellation), then beeps recorded by the microphone will be detected
and a measurement of echo delay can be computed.
Echo calibration procedure can be started by calling LinphoneCore.startEchoCalibration.
The measurement of the echo delay is important to save CPU computations
by restricting the temporal area where the software echo canceller has
to perform.
Echo limiter
The echo limiter is a liblinphone algorithm to clear out echo with a
brute force method. It consists in cutting down the microphone signal
when active signal is played by the speaker/receiver, to prevent voice
to feed back into the microphone. This algorithm has disadvantages
compared to the hardware or software echo cancellers because the remote
user will be not hear any background noise when speaking, which is
confusing. As a result the echo limiter method shall be used only under
situation where echo canceller can't perform, that is loud signals with
heavy saturations, which usually happens when using the device in
speaker mode. Echo limiter can be enabled or disabled during a call with
LinphoneCall.enableEchoLimiter().
Recommandations to applications for optimal audio performance
In order to benefit from the best echo cancellation solution, we
recommend applications to run the following procedure, when they are run
for the first time:
- Use the Hacks.hasBuiltInEchoCanceller() method to first check if the device has hardware echo cancellation. If yes, then echo canceller must be turned off.
- If hasBuiltInEchoCanceller() returned false, then it is recommended to run the echo calibration procedure. This procedure can produce the following results:
- success with no echo detected: it means that the device has an hardware echo canceller but is not (yet) referenced in our list of devices having hardware echo cancellation. Echo cancellation should be disabled with LinphoneCore.enableEchoCancellation(false)
- success with an estimated echo delay: the echo canceller should be enabled.
- failure: it means that some echo has been detected but the delay could not be estimated. In this case it is recommended to activate the echo canceller. A typical for android minimum delay of 250 ms will be used as default.
During calls, the echo limiter should be disabled while using the
receiver, but enabled while using the hands-free speaker. It is also
recommended to disable echo canceller while using the echo limiter,
because the first one would be useless. Therefore you should have the
following situations:
- While using the receiver
- Echo canceller enabled, unless the device has hardware echo cancellation
- Echo limiter disabled
- While using the hands-free speaker
- Echo canceller disabled
- Echo limiter enabled, unless the device has hardware echo cancellation.
Controlling echo limiter during a call has to be done with LinphoneCall.enableEchoLimiter().
Controlling echo canceller during a call has to be done with LinphoneCall.enableEchoCancellation().
Echo limiter settings
Echo limiter requires settings to be defined in linphonerc factory config file for correction operation.
Typical settings are:
[sound]el_type=mic#speaker energy threshold (linear scale) above which echo limiter decreases mic gain.el_thres=0.03#attenuation applied to mic gain (linear scale)el_force=100000#minimum time in milliseconds during which attenuation is appliedel_sustain=600#double talk detection: threshold of ratio mic-energy/speaker-energy above which mic input is sent anyway.el_transmit_thres=1.7#noise gate floorgain (gain applied when no voice is detected).ng_floorgain=0.01Up to date settings must be found from linphone-android/res/raw/linphonerc file.
Im nächsten Schritt werde ich versuchen, mal dieser Prozedur zu folgen.
LG
pah