Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Sometimes fails to connect unity app with browser client

Discussion in 'Unity Render Streaming' started by kengorou2014, Jul 28, 2022.

  1. kengorou2014

    kengorou2014

    Joined:
    Jun 12, 2018
    Posts:
    8
    Hi,

    We are currently having a problem with unity's sample app. Most time I got succeeded, but about once in 10 times, the browser failed to connect to the unity app and the state becomes disconnected and shows the play button again.

    My environment is
    • webserver for Linux in 3.1.0-exp.3 running on AWS instance with -w -p 8888 option(not SSL)
    • Unity Broadcast sample in 3.1.0-exp.3 with hardware encoder enabled on AWS g4dn instance
    • Build with Unity2021.2.19
    • Windows 11
    • google chrome
    • Receiver sample page of web app
    The attached images are the captures of chrome://webrtc-internals. one is when succeeded, and the other is when failed.
    I also looked into SDP and compare the two situations, and only found that the UDP port for negotiation was the diff ( and I think this is an ordinary thing, so I think the SDP is working correctly.)

    Our teammates do not have this issue and he is using windows10 and chrome.

    Does anyone have an idea to fix this?

    Sincerely
     

    Attached Files:

    Last edited: Jul 28, 2022
  2. kazuki_unity729

    kazuki_unity729

    Unity Technologies

    Joined:
    Aug 2, 2018
    Posts:
    803
    > Our teammates do not have this issue and he is using windows10 and chrome.

    This means that the issue is caused by the Windows version of the receiver side. Is it correct?
     
  3. kengorou2014

    kengorou2014

    Joined:
    Jun 12, 2018
    Posts:
    8
    Thank you for your reply.
    Maybe so, but I'm not sure because we are currently WFH and don't share the same network. The problem may come from the Wi-fi or router things.

    WebRTC experts advised us to use TURN server(e.g. coturn) along with STUN server, so we will try it and share a report here.
     
    kazuki_unity729 likes this.
  4. kengorou2014

    kengorou2014

    Joined:
    Jun 12, 2018
    Posts:
    8
    At last, we found this problem was solved by introducing a TURN server.
    A coturn server with ubuntu AMI on AWS EC2 instance worked.
    The official doc was very helpful. Thank you kazuki-san!
     
    kazuki_unity729 likes this.
  5. kazuki_unity729

    kazuki_unity729

    Unity Technologies

    Joined:
    Aug 2, 2018
    Posts:
    803
    It is my pleasure!
    I will appreciate if you share your knowledge for our community.

    Good luck!