5

I'm trying to figure out what's the best way of doing the following: having a peer connection between parties A and B, I want to add a third party C, but the difficulty is that I don't want a full mesh configuration, B should communicate with C only through A (an MCU setup, where A is the MCU).

B <-> A <-> C

What I tried so far is the following: when the peerConnectionAC is created and the didAddStream callback is called, I add the peerConnectionAB.remoteStream as a local stream to peerConnectionAC, like so:

peerConnectionAC.addStream(remoteStreamAB)

Then, I do it the other way around:

peerConnectionAB.addStream(remoteStreamAC)

At this point WebRTC triggers the renegotiation callback so a new offer is generated and sent to the respective parties.

Audio is now flowing between B and C through A, but it's terribly garbled, almost unintelligible. Audio flowing from A's microphone to B and C is still clear.

Both peer connections are using the same codec (OPUS, but also tried with iLBC) and the same sample rate.

The only reference I found for this is a question from over half a year ago, but without a clear answer.

This appears to be easily done in a browser setup, but I need it to work on iOS/Android as a standalone app.

Can anyone give me an idea or a pointer on how to fix the garbled audio?

clawoo
  • 791
  • 6
  • 14
  • You need to provide more info, for instance: Are you communicating over WIFI or 3G/4G? Are you using STUN or TURN servers? Could you post WebRTC stats between A - C, A - B and C - B (through A)? – AlexTa Jun 30 '17 at 08:59
  • For simplicity's sake, assume all three devices are on the same wifi with excellent connectivity. – clawoo Jul 03 '17 at 10:54

0 Answers0