VoiSmart / pjsip-android

SIP Service for Android based on PJSIP
http://www.pjsip.org/
Apache License 2.0
288 stars 140 forks source link

My Android device cannot do echo cancellation? #183

Open SmartSystemElectronics opened 1 year ago

SmartSystemElectronics commented 1 year ago
  Endpoint ep = new Endpoint();
  epGlobal = ep;
  ep.libCreate();

  EpConfig epConfig = new EpConfig();
  ep.libInit( epConfig );

  MediaConfig media_cfg =epConfig.getMedConfig();

  media_cfg.setSndAutoCloseTime(0);
  media_cfg.setEcOptions(pjmedia_echo_flag.PJMEDIA_ECHO_SPEEX
      |pjmedia_echo_flag.PJMEDIA_ECHO_USE_NOISE_SUPPRESSOR
      |pjmedia_echo_flag.PJMEDIA_ECHO_AGGRESSIVENESS_AGGRESSIVE);

  media_cfg.setEcTailLen(200);
  media_cfg.setQuality(10);
  media_cfg.setHasIoqueue(true);
  media_cfg.setThreadCnt(2);
  media_cfg.setClockRate(16000);

  // Create SIP transport. Error handling sample is shown
  TransportConfig sipTpConfig = new TransportConfig();
  sipTpConfig.setPort(5060);
  ep.transportCreate(pjsip_transport_type_e.PJSIP_TRANSPORT_UDP, sipTpConfig);
  // Start the library
  ep.libStart();

Actually, I configure my sip settings as you see above part. I set echo options with setEcOptions and setEcTailLen to 200. But, my device cannot echo cancellation. When I speak from intercom to custom smartphone device, I can hear my voice. In the other hand when I speak from my custom smartphone device, I didn't hear my voice. I think, this means my smartphone device cannot echo cancellation. In my device, there is no sound card in its board. Maybe that could cause this problem. I don't know it is hardware problem or not, but if it's hardware related, can I fix this with software? Do you have any advice to fix this?

About my device;

Rockchip px30_evb Android version : 8.1.0 Kernel version : 4.4.138 (gcc version 6.3.1 20170404 (Linaro GCC 6.3 - 2017.05))

ashishsecrets commented 1 year ago

microphone in communication mode when handling a call then to mode normal when call has ended

defeden commented 6 months ago

I am encountering an issue with echo cancellation when using the loudspeaker. Even after setting the pjmedia_echo_flag.PJMEDIA_ECHO_USE_NOISE_SUPPRESSOR option, there is no noticeable improvement. The audio remains unintelligible when the loudspeaker is enabled.

xiezhouyan1027 commented 3 months ago

Yes, I have the same problem.