Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to build the server app from scratch and intergrate it to some other Unity App? #142

Open
zijianh4 opened this issue Sep 26, 2024 · 10 comments

Comments

@zijianh4
Copy link

Hi,
I am currently trying to run the hl2ss app in 2d version with another 3D app which uses the Anchor service of Microsoft. However, it seems that one of them always quit because of the HoloLens 2 resource limitation. Therefore, I wonder if there is a way to intergrate the hl2ss server app to another Unity project. Thanks!

@jdibenes
Copy link
Owner

Hi,
If you have access to the Unity project you can try adding the hl2ss plugin to it. See hl2ss_unity for an example.

@zijianh4
Copy link
Author

Hi, If you have access to the Unity project you can try adding the hl2ss plugin to it. See hl2ss_unity for an example.

Thanks. Sorry for another question. If I want to build the plugin directly from source in another project. Do you know how to do it. I notice that there is one guide for building the whole app directly from source and mention the plugin but I am not sure if I need to follow the same steps. Thanks!

@jdibenes
Copy link
Owner

jdibenes commented Oct 1, 2024

The plugin depends on winrt code generated when building the app so it may be complicated (the VS solution referenced by the guide builds the app and then the plugin).
What's your setup?
Are you trying to add the C++ files to Unity and use IL2CPP?

@zijianh4
Copy link
Author

zijianh4 commented Oct 2, 2024

The plugin depends on winrt code generated when building the app so it may be complicated (the VS solution referenced by the guide builds the app and then the plugin). What's your setup? Are you trying to add the C++ files to Unity and use IL2CPP?

Hi, I extracted the plugin files into the Assets folder as required and the Anchor App https://github.com/Azure/azure-spatial-anchors-samples can run with the Plugin on HoloLens 2. However, I keep getting this error which seems saying that the portal cannot transfer the data. Could you please help me to resolve this issue? Thanks! As for the context, I run the ./viewer/simple_recorder.py to receive the leftfront and right front cameras.
image

@jdibenes
Copy link
Owner

jdibenes commented Oct 2, 2024

Did you add the Hololens2SensorStreaming.cs script to the Main Camera?
The plugin requires some setup when added to a Unity project.
See "Adding the plugin to an existing project" under "Unity plugin" in the readme for details.

@zijianh4
Copy link
Author

zijianh4 commented Oct 2, 2024

Did you add the Hololens2SensorStreaming.cs script to the Main Camera? The plugin requires some setup when added to a Unity project. See "Adding the plugin to an existing project" under "Unity plugin" in the readme for details.

Hi,
Yes, I follow the set up under "Unity plugin", which is shown in the image.
image
I think it is a little bit strange that although it says recording start later it will report the timeout issue. Previously when I try collecting the data directly with the hl2ss app, if it does not connect successfully the recording starts line will not show. Here is also a codeblock of the Package.appxmanifest after I build the App.

<?xml version="1.0" encoding="utf-8"?>
<Package xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" xmlns:uap2="http://schemas.microsoft.com/appx/manifest/uap/windows10/2" xmlns:uap3="http://schemas.microsoft.com/appx/manifest/uap/windows10/3" xmlns:uap4="http://schemas.microsoft.com/appx/manifest/uap/windows10/4" xmlns:iot="http://schemas.microsoft.com/appx/manifest/iot/windows10" xmlns:mobile="http://schemas.microsoft.com/appx/manifest/mobile/windows10" IgnorableNamespaces="uap uap2 uap3 uap4 mp mobile iot" xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities">
  <Identity Name="Template3D" Publisher="CN=Microsoft" Version="1.0.0.0" />
  <mp:PhoneIdentity PhoneProductId="80053089-59db-9242-a659-45186024729c" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
  <Properties>
    <DisplayName>HelloAR U3D</DisplayName>
    <PublisherDisplayName>Microsoft</PublisherDisplayName>
    <Logo>Assets\StoreLogo.png</Logo>
  </Properties>
  <Dependencies>
    <TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.10240.0" MaxVersionTested="10.0.22621.0" />
  </Dependencies>
  <Resources>
    <Resource Language="x-generate" />
  </Resources>
  <Applications>
    <Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="Template3D.App">
      <uap:VisualElements DisplayName="HelloAR U3D" Square150x150Logo="Assets\Square150x150Logo.png" Square44x44Logo="Assets\Square44x44Logo.png" Description="Template_3D" BackgroundColor="transparent">
        <uap:DefaultTile ShortName="HelloAR U3D" Wide310x150Logo="Assets\Wide310x150Logo.png" />
        <uap:SplashScreen Image="Assets\SplashScreen.png" BackgroundColor="#FFFFFF" />
        <uap:InitialRotationPreference>
          <uap:Rotation Preference="landscape" />
          <uap:Rotation Preference="landscapeFlipped" />
          <uap:Rotation Preference="portrait" />
          <uap:Rotation Preference="portraitFlipped" />
        </uap:InitialRotationPreference>
      </uap:VisualElements>
    </Application>
  </Applications>
  <Capabilities>
    <rescap:Capability Name="perceptionSensorsExperimental" />
    <Capability Name="internetClient" />
    <Capability Name="internetClientServer" />
    <Capability Name="privateNetworkClientServer" />
    <uap2:Capability Name="spatialPerception" />
    <uap3:Capability Name="remoteSystem" />
    <DeviceCapability Name="webcam" />
    <DeviceCapability Name="microphone" />
    <DeviceCapability Name="bluetooth" />
    <DeviceCapability Name="gazeinput" />
    <DeviceCapability Name="backgroundSpatialPerception" />
    <DeviceCapability Name="wiFiControl" />
  </Capabilities>
</Package>

@jdibenes
Copy link
Owner

jdibenes commented Oct 3, 2024

I think it is a little bit strange that although it says recording start later it will report the timeout issue. Previously when I try collecting the data directly with the hl2ss app, if it does not connect successfully the recording starts line will not show. Here is also a codeblock of the Package.appxmanifest after I build the App.

Check that the Unity App has access to:

  • Camera (Settings -> Privacy -> Camera).
  • Eye tracker (Settings -> Privacy -> Eye tracker).
  • Microphone (Settings -> Privacy -> Microphone).
  • User movements (Settings -> Privacy -> User movements).

@zijianh4
Copy link
Author

zijianh4 commented Oct 3, 2024

I think it is a little bit strange that although it says recording start later it will report the timeout issue. Previously when I try collecting the data directly with the hl2ss app, if it does not connect successfully the recording starts line will not show. Here is also a codeblock of the Package.appxmanifest after I build the App.

Check that the Unity App has access to:

  • Camera (Settings -> Privacy -> Camera).
  • Eye tracker (Settings -> Privacy -> Eye tracker).
  • Microphone (Settings -> Privacy -> Microphone).
  • User movements (Settings -> Privacy -> User movements).

Hi,
I am not sure if I understand correctly, but I can only find the Project settings under Edit (I'm using Unity 2022.3.12f1)
image
and I follow the setup here to open the access
image
Is this correct? Thanks!

@jdibenes
Copy link
Owner

jdibenes commented Oct 3, 2024

Settings from the Start menu on the HoloLens, which opens when you tap your wrist.

@zijianh4
Copy link
Author

zijianh4 commented Oct 3, 2024

Settings from the Start menu on the HoloLens, which opens when you tap your wrist.

Hi,
Yes. I turn on all the permissions and the error still exists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants