Unity-Technologies / com.unity.webrtc

WebRTC package for Unity
Other
738 stars 186 forks source link

[BUG]: No data sent on VideoStreamTracks on Pico after multiple cleanups #1020

Open almill-heru opened 3 months ago

almill-heru commented 3 months ago

Package version

3.0.0-pre.7

Environment

* OS: Android
* Unity version: 2020.3

Steps To Reproduce

  1. Create a VideoStreamTrack and attach to a MediaStream
  2. Attach stream to 30 connections
  3. Teardown connections and tracks/channels
  4. Create another VideoStreamTrack and attach to a MediaStream
  5. Attach stream to any number of connections

One way we've reproduced this outside of our app: Build Samples/WebRTC/3.0.0-pre.7/Example/VideoReceive for pico, call, add track, remove track, add track, remove track, add track, remove track, etc (because there's a single texture, you'll need to do it about 30 times. I needed to do it 32 times), hang up and then call again. You'll see the receiving texture turn black.

Current Behavior

No data is sent on the recreated stream.

Expected Behavior

The new media streams work like the old ones and stream images.

Anything else?

We have an application that runs on a Pico Neo 3 Pro Eye. Our web portal establishes a connection with our HMD, and our HMD will create two MediaStreams, each with a VideoStreamTrack attached (one for each of the inward-facing camera feeds). This seems to work beautifully. We can support 50+ connections (all sharing the same two MediaStreams), no problem. They can disconnect, and new connections can form.

We can successfully stop and teardown our MediaStreams and connections and then create new connections with new MediaStreams. Everything is hunky dory until we've had about 16-20 connections (over 1-20 separate pairs of MediaStreams). The next time we try to create new MediaStreams and stream our videos with any number of connections, even though we appear to successfully add our tracks to our connection(s), we don't send any image data.

We suspect something related to closing Peer Connections or releasing graphics memory. Please let me know what else I can give you. Any guidance will be greatly appreciated!

karasusan commented 3 months ago

memo: WRS-487