Unity-Technologies / Unity-Technologies/com.unity.webrtc

[BUG]: Unable to connect streams between two devices with relay-only mode forced

Open
#1,029 0 comments 0 reactions 1 assignee View on GitHub

@karasusan is already working on this.

Since Apr 19, 2024.

bug
Dominant language
Assembly
Stars
852
Forks
238
PR merge metrics
No merged PRs in 30d

Description

Package version

3.0.0-pre.7

Environment
* OS: Tested on latest versions of *iOS*, macOS, and Windows
* Unity version: 2023.2.0f1
Steps To Reproduce

Set RTCConfiguration.iceTransportPolicy, to RTCIceTransportPolicy.Relay during RTCPeerConnection instantiation.

Current Behavior

Audio, data, and video streaming does not always work across different networks.

Expected Behavior

Audio, data, and video streaming works across different networks.

Anything else?

I am unable to connect audio, nor video streams, with relay-only mode forced.

The reason why I have forced relay mode is, because in many scenarios, peer-to-peer communication is not possible, therefore needs to be able to stream audio, video, and data through relay, (TURNS) as well as peer-to-peer. (STUN/TURN)

The initial issue with audio, video, and data streaming was, that for example on different networks, streaming would not always work, and on mobile, even less.

For testing purposes, I was able to isolate the issue with streaming, by forcing streaming to relay mode. (RTCConfiguration.iceTransportPolicy is set to RTCIceTransportPolicy.Relay)
That made even local network streaming impossible. (Peer-to-peer)

I want to ensure, that the Unity WebRTC implementation works through different networks.
To test, if the issue was with AWS, we have tested signaling, and RTC through example native iOS apps, which worked flawlessly.

The idea of TURN/TURNS is, to solve the issue with, whenever peer-to-peer is not possible, by relaying streams.

ICE servers, with correct authentication are specified, and awaited till negotiation is needed, in order to create an offer, and connect to a signaling server. (Session descriptions are empty, if offers are created outside RTCPeerConnection.OnNegotiationNeeded, after it being invoked. This is a different issue for sure)
Session descriptions, and ICE candidates are correct, and successfully exchanged through a signaling server, provided by AWS.
From observation, for example the received video stream is reported to be empty, if connection is relayed.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.