microsoft / MixedRealityToolkit-Unity

This repository is for the legacy Mixed Reality Toolkit (MRTK) v2. For the latest version of the MRTK please visit https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity
https://aka.ms/mrtkdocs
MIT License
6k stars 2.12k forks source link

Sharing Service: Invalid Schema Version #487

Closed DrNeuroSurg closed 7 years ago

DrNeuroSurg commented 7 years ago

If using SharingService with schema version 15 on client and server everything works fine (as in HoloToolkit-Sharing-240).

With schema version 17 it isn't working anymore !

StephenHodgson commented 7 years ago

Most likely related to the major sharing update (https://github.com/Microsoft/HoloToolkit-Unity/pull/459). Thanks for submitting.

[edit] I looks like the external resources got updated correctly with that update. You might need to update your copy of the binaries.

Lordinaire commented 7 years ago

I confirm, my application crashes when I try to use: SharingManager.Create(config);

StephenHodgson commented 7 years ago

@Lordinaire are you using the SharingStage.cs class or do you have your own implementation?

I have not been able to get my application to crash on SharingManager.Create(config); using the sharing.prefab.

I am getting these errors in the sharing test scene though:

SharingService [..\..\Source\Common\Private\XSocketManagerImpl.cpp (728)]: Failed to create incoming connection on port 20605.  Error code: 5

SharingService [..\..\Source\Common\Private\SessionListHandshakeLogic.cpp (67)]: 
***************************************************************
List Server Handshake Failed: Invalid schema version. 
Expected: 17, got 15 
Please sync to latest XTools
***************************************************************

First issue is because I launched the Session Manager from the editor before running the scene. The second error is the one @DrNeuroSurg is seeing.

Setting AutoDiscoverServer to true throws null reference exemptions in both the ImportExportAnchorManager and the RemoteHeadManager. (https://github.com/Microsoft/HoloToolkit-Unity/issues/491)

Starting the SharingService through the editor shows the schema version is 15.

StephenHodgson commented 7 years ago

RESOLUTION In the master HTK project launching the SharingService.exe always launches with schema v17.

If you're using the HoloToolkit from the unity package, or exported the package yourself chances are you got your SharingService.exe from another source or an older version. You just need to replace that old executable with the newest version.

You can find the latest version of the SharingService.exe here:

HoloToolkit-Unity\External\HoloToolkit\Sharing\Server

For example, in my project, I use a symbolic link to reference the HTK specific libraries in a folder named ThirdParty, and my External\HoloToolkit\Sharing folder doesn't get updated when the HTK updates. (I could just sym link those too, but I'm lazy and also if done improperly can break your project). So I had to copy the External folder over into my project root, and overwrite all changes.

NeerajW commented 7 years ago

Great catch @HodgsonSDAS !!

Lordinaire commented 7 years ago

@HodgsonSDAS I'm using the SharingStage.cs class and the latest version of HTK. I create a very simple project with just basic sharing scripts (see attached file) and it crashes after few seconds on my HoloLens. No exception are thrown :/

PS : I removed the HTK to be able to upload the project.

SharedHologram.zip (Removed by Moderator)

StephenHodgson commented 7 years ago

Sorry @Lordinaire I'm not going to download your zip file. You can share on GitHub if you'd like.

Lordinaire commented 7 years ago

Of course ! I put it on GitHub : https://github.com/Lordinaire/HoloLens_Sharing_Test If anyone can try to repro the crash it will help me a lot.

StephenHodgson commented 7 years ago

Have you tried pulling my PR https://github.com/Microsoft/HoloToolkit-Unity/pull/484 addressing some of the sharing service fixes?

GJ0hnson commented 7 years ago

Hello, I am working on a project using the sharing components of the HoloToolKit for Unity. I am using the current version of the HoloToolKit in a Unity and still receiving issues when launching the sharingservice.exe, similar to @Lordinaire. The sharingservice.exe does say Schema Version: 15 when launched, but as soon as I attempt to connect to the server address I receive the Error code 5, exactly as pictured above in the post from @StephenHodgson. I made sure to check the resolution previously posted, but I have already completed those steps and still have issues. Additionally, I was able to get the sharing services to work for the HoloToolKit-240, but am having issues here. Any updated resolutions or advice would be greatly appreciated! Thank you in advance.

Siman007 commented 7 years ago

Hi have a problem with the HoloToolKit for Unity. I am using the current version of the HoloToolKit in a Unity and still receiving issues when launching the sharingservice.exe. When I add the ImportExportAnchorManager the app dies as it loads on hololens with no debug. Tracing it through it appears to be after line 225 in ImportExportAnchorManager which in my build reads
SharingStage.Instance.SharingManagerConnected += Connected;

private void Start()
        {
            // SharingStage should be valid at this point, but we may not be connected.
            if (SharingStage.Instance.IsConnected)
            {
                Connected();
            }
            else
            {
               SharingStage.Instance.SharingManagerConnected += Connected;
            }
        }

The only debug I get after this line is in SharingStage.cs in HandleLog which is an Assert with the log message logString = "WinRTScriptingObjectWrapper::InternalAddRef Reference Count cannot be zero"

Any ideas gratefully received

StephenHodgson commented 7 years ago

@Siman007, I suggest opening a new issue instead of posting off topic. Thanks

StephenHodgson commented 7 years ago

@RaoAM Please make a new issue for this.