ortclib / ortclib-sdk

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

High latency during streaming #10

Closed fcagnetta closed 6 years ago

fcagnetta commented 6 years ago

Hello there,

I'm using PeerCC to communicate with audio and video between an Hololens and a PC. The issue is the extreme lag that affects the communication, even if I am streming video from Holo to PC only.

Do you experience the same? Any suggestion to improve this?

jamescadd commented 6 years ago

Hi - could you let me know which branch you're using and if this is in release mode? There is further work underway to optimize the rendering but others have reported that the current solution is good enough for their purposes.

fcagnetta commented 6 years ago

Hi James,

I am using the branch Mosa/20180320-peercc-unity in debug mode. Release mode is currently not working, it looks like there is an unhandled exception which causes the app to crash, while in debug mode it works correctly.

jamescadd commented 6 years ago

Ok, the poor perf in Debug is not entirely unexpected. We should probably troubleshoot the exception in Release mode as that's what you would want to run.

fcagnetta commented 6 years ago

Hi James, the exception is:

DllNotFoundException: Unable to load DLL 'MediaEngineUWP': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

raised by ControlScript.Plugin.CreateRemoteMediaPlayback() in OnEnable().

jamescadd commented 6 years ago

I just cloned the latest and was able to build/run in release mode on the device. Not sure why you're seeing this error - any changes to the project that could be causing it?

fcagnetta commented 6 years ago

Just did it again on a different machine and got the same behaviour. I didn't change anything in the project. I really can't figure out why.

jamescadd commented 6 years ago

@morosev Do you have any insight? Maybe something's missing from the Unity install?

morosev commented 6 years ago

The stream latency could be caused by Debug build. Streaming performances are slightly worse when debug library is used, which is more noticeable on mobile devices like HoloLens. The missing library problem shouldn't be related to some serious bug. Build procedure for Unity sometimes fails when build configuration was changed. We should address this issue. Please just try to do a fresh clone and try Release build on clean sources.

fcagnetta commented 6 years ago

Hello @morosev, just tried on another machine, but this time idk why the prepare.bat script failed with this error:

CRITICAL ERROR: COULD NOT CREATE SYMBOLIC LINK TO Executing generateProjects function FROM

FAILURE:Preparing WebRTC development environment has failed.

zhangalex commented 6 years ago

@jamescadd

I encountered below exception, could you please tell me do you have any idea on this?

Running AssemblyConverter... 9> System.InvalidOperationException: Sequence contains no matching element 9> at System.Linq.Enumerable.Single[TSource](IEnumerable1 source, Func2 predicate) 9> at Unity.OperationContext.SetWinRTBridge(AssemblyDefinition assembly) 9> at Unity.CreateWinRTBridgeStep.Execute() 9> at Unity.Step.Execute(OperationContext operationContext, IStepContext previousStepContext) 9> at Unity.Operation.Execute() 9> at Unity.Program.Main(String[] args)

I struggled whole day on this error, but I cannot figure out what is happening.

zhangalex commented 6 years ago

@jamescadd thanks in advanced, do you have any idea on this?

jamescadd commented 6 years ago

@zhangalex Could you try with master on this repo https://github.com/webrtc-uwp/PeerCC-Sample and let me know? this also works around the need for the prepare script so could bypass the prepare issue for you @fcagnetta

morosev commented 6 years ago

@zhangalex The error comes from Unity engine. Have you checked the installed Unity Editor version. It should be: Unity version 2017.4.1 with Windows Store .NET Scripting Backend.

zhangalex commented 6 years ago

@jamescadd Hi James, thanks. Forget to tell you that I'm using branch Mosa/20180320-peercc-unity, I'm trying to capture video & holograms on Hololens. I think PeerCC-Sample does not include that feature, right?

@morosev I will download a newer Unity editor, thanks.

jamescadd commented 6 years ago

@fcagnetta @zhangalex Are you still experiencing latency issues?

fcagnetta commented 6 years ago

Hi @jamescadd no, I got a nice result in terms of latency and stability of the call.

Btw (it would be a different issue) I can no longer see holograms in the PC, but only Hololens cam. I can't understand why.

jamescadd commented 6 years ago

@fcagnetta is the holograms issue in the peercc sample or in your code? to get these to display on pc you need to enable mixed-reality capture which you can see in ControlScript.cs in the sample.

fcagnetta commented 6 years ago

@jamescadd sorry for the late reply. I can't find this setting in the script.

jamescadd commented 6 years ago

Do a search for "MrcEnabled" and it should show up, it's on Conductor.CaptureCapability

fcagnetta commented 6 years ago

Thanks @jamescadd You're awesome! It's working now.