How to Debug issue’s Related to VoIP Call

来源:互联网 发布:知乎值得关注的博主 编辑:程序博客网 时间:2024/06/05 08:51

Depending on the VOIP application and the configuration of the TX and RX path either VOIP driver or PCM driver is used.

Sometimes VOIP driver is used for RX path only and the PCM driver is used for TX path only or vice versa .

For a VoIP call to be set up the Application need to set the mode to AUDIO_MODE_IN_COMMUNICATION as defined in audio_mode_t in the file /system/core/include/system/audio.h The Configuration parameters for the AudioTrack and AudioRecord decide whether Audio Path should be used or VoIP driver Path will be used .

The Configuration parameters that decide the whether Audio data path or VoIP driver data path is used are as follows

Configuration parameters for AudioTrack

    Sample rate    Number of channels    Format     Streamtype  as defined in  audio_stream_type in the file  /system/core/include/system/audio.h    Output Flag as defined in  audio_output_flags_t  in file  /system/core/include/system/audio.h

Configuration Parameters for AudioRecord

    Sample rate    Number of Channels    Format     Audio source  as defined in audio_source_t enum  in  file  /system/core/include/system/audio.h

AudioTrack and AudioRecord are opened independently and it may sometimes so happen that aysmmetric data path are chosen ( ie . Audio Track uses Audio Data path and AudioRecord uses the VOIP Driver TX path and vice versa ) depending on the AudioTrack and AudioRecord configuration Parameters .

这里写图片描述
这里写图片描述

Log collection User space logs
logs in below files need to be enabled while collecting the userspace logs

    /frameworks/av/media/libmedia/AudioTrack.cpp    /frameworks/av/media/libmedia/AudioRecord.cpp    /hardware/qcom/audio/hal/voice_extn/compress_voip.c    /hardware/qcom/audio/hal/audio_hw.c    /frameworks/av/services/audioflinger/AudioFlinger.cpp    /frameworks/av/media/libmedia/AudioEffect.cpp    /frameworks/opt/net/voip/src/jni/rtp/AudioGroup.cpp

Below command can be used to collect the userspace logs

adb logcat -c && adb logcat -v threadtime | tee logcat.txt

Kernel logs

echo -n "file msm-pcm-voip-v2.c +p" > /sys/kernel/debug/dynamic_debug/controlecho -n "file msm-pcm-routing-v2.c +p" > /sys/kernel/debug/dynamic_debug/controlecho -n "file q6voice.c +p" > /sys/kernel/debug/dynamic_debug/controlecho -n "file msm-pcm-q6-v2.c +p" > /sys/kernel/debug/dynamic_debug/control

Additional logging

echo -n "file soc-pcm.c +p" > /sys/kernel/debug/dynamic_debug/controlecho -n "file audio_acdb.c +p" > /sys/kernel/debug/dynamic_debug/controlecho -n "file q6adm.c +p" > /sys/kernel/debug/dynamic_debug/controlecho -n "file q6afe.c +p" > /sys/kernel/debug/dynamic_debug/control

Debugging

1、VoIP mute(No audio)
Check logcat for Device Mute, or Zero Volume setting.

2、Noise(Noise during VoIP call)
Collect QXDM logs and check the PCM logs at various points in DSP to narrow down the issue.

3、Packet loss(Glitches during conversation)
Log in kernel driver msm-pcm-voip-v2.c can be checked to see if UL and DL functions to exchange data are called at regular intervals of 20 ms or not.

4、Mute function not working in 3 way VOIP Conf call(Mute function not working in 3 way VOIP Conf call)
The reason is Playback and record path may be used for 3 way VOIP call and the VOIP RX Mute Mixer control is not applicable.

5、Echo issues(Echo is present during call )

Some of the VoIP Apps(ex: Mitalk, Viber) choose – Rx on Audio path and Tx on Voice path causing issues related to echo cancellation.From the logs, check if any of below conditions are failing resulting in Rx taking Audio path.• stream type is VOICE_CALL or VOIP_CALL• Check if channel is CHANNEL_OUT_MONO• Check if sample rate is 8000 or 16000

6、Echo issues are observed with VoIP which uses Audio Path(Echo is present during call )

Check if ACDB file ECNS enabled based on whether OEM's are using single Mic ECNS or Dual Mic ENCS. If not, add device pair as below and save ACDB file.• Added HANDSET_MIC&APKR_PHONE_SPKR_STERIO to Audio EC Device Pair Designer• For HANDSET_MIC ,  add VOICE_TX_SingleMicEcns as Audio COPP Topology• Enable TABLE_AudProc -> HANDSET_MIC -> TX_VOICE_SMECNS -> VOICE_MOD_ENABLE (Set to ACDB)
原创粉丝点击