ortclib / ortclib-sdk

C# / C++ ORTC Lib SDK for UWP, iOS, and Android
BSD 2-Clause "Simplified" License
100 stars 36 forks source link

Problem with UI and other issues (PeerCC-Unity) #23

Open TiagoShen opened 5 years ago

TiagoShen commented 5 years ago

Hi there, I'm trying peercc sample on branch Mosa/20180320-peercc-unity and was able to run the app on HoloLens.

However, there are some problems I encountered:

  1. When I air tap the Connect button the text changes to Disconnect and quickly change back. The output suggests it established the connection with the server but disconnect immediately. I found a way avoid this problem by holding my finger a little bit longer
  2. The same problem happened when click the Call button. And this time the HoloLens began to recording (I can see it on the local video surface also the red recording icon was flashing) but PC (with the UWP app PeerConnectionClient.WebRtc running) cannot receive the stream. It shares the same way to avoid this problem
  3. When I click the buttons (Connect and Call) VS has lines of output "Invalid parameter passed to C runtime function." followed by "Exception thrown at 0x769DF2B2 in PeerCCUnity.exe: Microsoft C++ exception: Il2CppExceptionWrapper at memory location 0x0677F040."
  4. If initiate the call from PC using VP8 the HoloLens won't be able to receive video from PC
  5. The HoloLens app crashes after a few calls

I'm using VS2017 with Windows 10 SDK 10.0.16299.0, Unity 2018.2.15f1.

Any suggestions? Thanks in advance.

jamescadd commented 5 years ago

Hello, some feedback below. The branch you're using requires an older version of the Unity tooling (see the readme), for newer tooling try the releases/m62 branch.

  1. I notice the same thing, if I hold the button for about 3 seconds it appears to work correctly. We'll address this in the future.
  2. Let me know if you still see the issue on the releases/m62 branch. If you can provide full VS logs for the failure (make sure to enable mixed mode debugging and build in debug) it would help.
  3. Not sure about this exception but since it's related to Il2Cpp I wonder if it's due to the Unity tooling version.
  4. This could be related to several things, would be good to either change the Unity tooling or use a newer branch and see if it repros.
  5. Same as above.

Thanks, let us know how it goes.

TiagoShen commented 5 years ago

Hi, I followed your advice and try release/m62 branch but unfortunately it has the same problems as the previous one.

HoloLens cannot receive video when initiate the call from PC with VP8 video codec. The app crashes when initiate the third call from PC (in the previous two calls HoloLens cannot receive video stream from PC).

I copied the output and call stack of the exception that cause the app to crash. I hope it would help.

The the environment for building this project is still the same. And I use a Logitech HD Webcam C310 on my PC.

Thank you for your patience and feel free to ask for more information about this issue. Output.txt Exception&Callstack.txt

robin-raymond commented 5 years ago

Ok, the issue is related to the wrapper. There's a null Org::WebRtc::RTCIceServer structure either being passed into the array inside the Org::WebRtc::RTCConfiguration object or the wrapper has a glitch and is not properly allocating the structure. Can you isolate the code you are using for the RTCConfiguration?

anders-lundgren commented 5 years ago

I experienced the same issues. I was able to resolve both 1 and 2 by switching to a recent version of Unity and Windows 10 SDK (10.0.17134.0). Both Unity 2018.3.4f1 and 2019.1.0b1 seem to work. I still experience 3 and I think it may be related to the enumeration of clients (I can only call the first client and the list of clients is never shown in the HoloLens when building using IL2CPP). Issues 4 and 5 are still present, same in both Mosa/20180320-peercc-unity and release/m62, and I still see the same exceptions as you do @TiagoShen.

jamescadd commented 5 years ago

@anders-lundgren The Unity client has always called the first peer, though there could be a related error. Good to know that Unity 2018.3 resolves some of these issues. We're close to having a newer build ready and I'd prefer to do any troubleshooting there.