Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Unable to connect over TURN server from WebBrowserInput sample on WAN. Bug?

Discussion in 'Unity Render Streaming' started by phila666, Sep 25, 2023.

  1. phila666

    phila666

    Joined:
    Jul 30, 2013
    Posts:
    9
    This issue is seen using the samples from renderstreaming 3.1.0-exp.7 and associated WebApp, configured to use a CoTurn TURN server over WAN connection, Coturn running on Ubuntu desktop behind NAT, tests ok from Trickle test page. Example works fine over LAN, but does not need to use TURN in that configuration.

    Deploying a build of the WebBrowserInput scene on a remote VM,
    configured with ICEServer url turn:<companydomain>:5349, with user credentials], Unity sends the configured TURN candidate to the signaling server, and the TURN server is successfully contacted, but The ICE connection does not progress to make use of the TURN relay.

    The initial set of candidates from the WebServer.exe VideoPlayerSample page always includes an incomplete candidate message,
    "type":"candidate","data":{"candidate":"","sdpMLineIndex":"0","sdpMid":0,"datetime":1695657638965},
    which generates the error
    ArgumentException: create candidate is failed. error type:InvalidParameter, candidate:
    sdpMid:0
    sdpMLineIndex:0

    (This incomplete candidate error still occurs when running the example, even if no turn url is configured, so probably not the source of the issue. It does seem, however, that the turn server should be offered as a candidate from the the web page peer?)

    Following this, negotiations continue, the TURN server is reached, and logs a successful relay creation, responding to ALLOCATE and BINDING packets, but then continues to receive BINDING packets every few seconds for as long as the Unity app and WebServer page are active, but the relay connection is never completed.

    Attached are some pertinent entries from the player log of the Unity app during the failed negotiation:

    Since this occurs using the provided sample code, and the coturn server is responding, and passes the qualification tests, it seems likely this is being caused by some bug in the sample code or in the Unity renderstreaming or webrtc packages.
     

    Attached Files:

  2. kazuki_unity729

    kazuki_unity729

    Unity Technologies

    Joined:
    Aug 2, 2018
    Posts:
    766
    I thought this issue is fixed here. It whould be another bug.
    https://github.com/Unity-Technologies/UnityRenderStreaming/pull/934

    How about Broadcast sample?
     
  3. phila666

    phila666

    Joined:
    Jul 30, 2013
    Posts:
    9
    The broadcast/receiver sample works as expected, but the WebBrowserInput sample fails to make use of the TURN relay under the same circumstances, hosts and configuration.
     
  4. phila666

    phila666

    Joined:
    Jul 30, 2013
    Posts:
    9
    I can also connect to the app I am developing using the WebApp receiver page, although it does not contain the customizations I need to add to that page, but I will try a new set of modifications to add the interactivity I need based on that page instead of the WebBrowserInput example, which was closer to the end result I need.
     
  5. kazuki_unity729

    kazuki_unity729

    Unity Technologies

    Joined:
    Aug 2, 2018
    Posts:
    766
    WebBrowserInput is made earlier than Receiver sample, so there might be bugs for signaling.