BelledonneCommunications / linphone-desktop

Linphone is a free VoIP and video softphone based on the SIP protocol. Mirror of git://git.linphone.org/linphone-desktop.git
https://linphone.org/
GNU General Public License v3.0
393 stars 201 forks source link

[Bug]: No sound over SIP call despite speaker level shown and ring heard. Ubuntu 22.04 using pulseaudio over xrdp. #732

Open rpm-arch opened 1 year ago

rpm-arch commented 1 year ago

Context

I am using linphone as it seems to be the only maintained softphone available for current Ubuntu on ARM. Purpose is to create a SIP calling demonstration for my company.

General information

For remote access using: https://github.com/neutrinolabs/xrdp For sound using: https://github.com/neutrinolabs/pulseaudio-module-xrdp

Expected behaviour

I expect to hear the call audio over the xrdp-sink. This does work for a ring test in the linphone settings. However, during a call, even though I can see volume levels active in linphone, the ubuntu-desktop settings show no sound level.

Ring - works properly (I can hear it over xrdp, and you can see the output levels represented) ring

Call - does not work (I cannot hear it, and there is no activity in output levels) call

To Reproduce

Build process starting fresh with Ubuntu 22.04 image:

  1. sudo apt update
  2. sudo apt install ubuntu-desktop
  3. sudo apt install xrdp
  4. sudo apt install build-essential dpkg-dev libpulse-dev git autoconf libtool
  5. git clone https://github.com/neutrinolabs/pulseaudio-module-xrdp.git
  6. cd pulseaudio-module-xrdp
  7. scripts/install_pulseaudio_sources_apt_wrapper.sh
  8. ./bootstrap && ./configure PULSE_DIR=~/pulseaudio.src
  9. make
  10. sudo make install
  11. sudo apt install linphone

Recreate steps:

  1. Establish xrdp session
    • create user password for rdp session
    • open port or tunnel 3389 over SSH
    • connect using rdp
  2. Open linphone desktop interface
  3. Test ring sound
    • preferences > audio
    • ensure playback device is PulseAudio: xrdp sink
    • press Ring play button
    • observe sound or output levels in ubuntu-desktop settings > sound
  4. Test SIP call with RTP audio
    • several ways to do this. I am calling another instance running SIPp via sip:IPADDR
    • observe no sound or output levels in ubuntu-desktop settings > sound

Note, similar to the ring test, audio over xrdp works fine for other apps such as firefox or vlc. But, for some reason not for SIP call RTP audio.

Additional context

Thanks for reading. Actually testing the SIP call is a little more involved so not completely spelled out in the recreate. To clarify this call is direct peer-to-peer SIP on a LAN (albeit a virtual network in public cloud infrastructure). I have another client running a SIPp server script that reads a WAV file and returns the audio, and I am calling to it from the linphone. Another option is to deploy a second instance with sound input and output bridged together, then play a video or audio file there after establishing the call from the linphone. I have done this with an Oracle Linux instance which by default bridges the sound input and output, then play a video on firefox. I am running these on "always free" instances on Oracle cloud so this exact scenario can be recreated at no cost.

SDK logs URL

No response

rpm-arch commented 1 year ago

(sorry accidental close - issue resolved with workaround but may still be considered bug)

Figured it out - if there is no input level (in my case, not porting mic input over the rdp session), and if echo cancellation is enabled (it is by default), then there is no RTP leg established outbound. I believe this error is related:

2023-01-09 19:24:51:784 [AppRun.wrapped/bctbx] WARNING Getting reference signal but no echo to synchronize on.

Not establishing the RTP leg outbound results in a couple issues:

  1. If any codecs are enabled other than the codec received on inbound RTP (in my case, PCMA - payload type 8), then ortp/mediastreamer drops the packets as unknown payload:

2023-01-09 18:46:49:625 [AppRun.wrapped/ortp] WARNING Receiving packet with unknown payload type 8. 2023-01-09 18:46:49:625 [AppRun.wrapped/mediastreamer] WARNING Discarding packet with unknown payload type 8

  1. Even if the payload is accepted by limiting the codecs enabled on the account to only that one (resolving the log messages above), the sound represented in the linphone interface is still not heard nor represented in the gnome sound settings level (as per the second screenshot in my original post). Not sure exactly why this happens.

So, the workaround is simply disabling echo cancellation. Still, I am not sure why it is needed to have an outbound RTP payload to negotiate the codec or moreover for the sound which is shown in the app to be shared to pulseaudio.

I have confirmed this issue still exists on the latest appimage (5.0.5) using an x86 instance instead of aarch64.