Skip to main content

Integration with Sessions

The HoloCapturerPipeline is available as a local representation of data and also a remote one. The BasicIntegration is a local pipeline. Here we will provide step-by-step instructions to represent a remote pipeline.

Requirements

Follow the BasicIntegration tutorial to make sure a local pipeline works.

Integration

HoloCapturerSender

  1. Create a new scene and call it HoloCapturerSender.
  2. Create a new game object and call it HoloCapturerSender as well.
  3. Add to the HoloCapturerSender game object the components TrafoDistributor and HoloCapturerSender.

SenderComponents

  1. Add the necessary managers to the scene.
    • Create a new game object called IndexManager and add the component IndexManagerController.
    • Create a new game object called SessionManager and add the component SessionManagerController.
    • Create a new game object called MediaManager and add the component MediaManagerController.

ManagerObjects ManagerComponents

  1. Select the HoloCapturerSender and check out its Inspector. Here you can edit the SessionName and the SenderName, or leave the default ones.

SenderSettings

HoloCapturerReceiver

  1. Create a new scene and call it HoloCapturerReceiver.
  2. Create a new game object and call it HoloCapturerReceiver as well.
  3. Add to the HoloCapturerReceiver game object the components TrafoDistributor and HoloCapturerReceiver.

ReceiverComponents

  1. Add the necessary managers to the scene.
    • Create a new game object called IndexManager and add the component IndexManagerController.
    • Create a new game object called SessionManager and add the component SessionManagerController.
    • Create a new game object called MediaManager and add the component MediaManagerController.

ReceiverManagerObjects ManagerComponents

  1. Select the HoloCapturerReceiver and check out its Inspector. Here you can edit the SessionName, the ReceiverName, and the SenderName, or leave the default ones.
    IMPORTANT! The SessionName and the SenderName must align with the ones in the HoloCapturerSender.

SenderSettings

Building project

To use the remote features of the HoloCapturerPipeline, you must create a build for the HoloCapturerSender scene and another one for the HoloCapturerReceiver scene. That is because in a single run of the app, only one user in the session is possible. To use the remote features, two users (the sender and the receiver) are necessary — hence two builds that we will run simultaneously.

  1. Open the scene HoloCapturerSender.
  2. Open the tab File/Build Settings and hit Add Open Scenes. Make sure the scene HoloCapturerSender now appears in the section Scenes In Build and that it's the only one checked.

SenderBuildSettings

  1. Make sure the platform selected is Windows and hit Build.
  2. Create a directory for the build called HoloCapturerSender.
  3. Wait until Unity has finished building the project. This may take a while.

SenderBuildExplorer

  1. Repeat the steps for the HoloCapturerReceiver. Take into consideration that:
    • In the Scenes In Build section, now the only one checked is HoloCapturerReceiver.
    • You must create a new directory so you don't overwrite the already existing build.

ReceiverBuildSettings ReceiverBuildExplorer

  1. Run the HoloCapturerSender app.
  2. When the representation shows up, run the HoloCapturerReceiver app.
  3. It may take a while, but the representation running localy in the HoloCapturerSender now will also appear in the HoloCapturerReceiver as a remote representation.

RunWithSessions

Use cases and good practices

Take it one step at a time

Make sure that the local pipeline works properly before trying the remote. Use the HoloCapturerSender scene in editor by itself, it should show the local representation.

Build-Editor

You don't need to run both scenes as builds. If you wish to debug, you can run one in the editor and the other as a build to see the HoloMIT debug messages appear in the Console tab of the editor.

RunWithSessionsEditor

Debug in Build

If you wish to see these messages from a build, first open the Unity Editor and go to the tab Edit/Project Settings. Consult the tab Player and look for your Company Name and your Product Name. In our case, i2Cat and HoloMIT.

ProjectSettings

Afterwards, open your File Explorer and go to C:\Users\YourUser\AppData\LocalLow\YourCompanyName\YourProductName. In this location, you will find a file called Player.log. This file contains all the debug messages from your app.

PlayerLogLocation

Debug messages

If the remote representation is not working, look at the Console tab and look for HoloMIT messages that confirm the connection has been made correctly such as:

DebugConsoleHoloMIT

Sender:

  • The session was created:

[HoloMIT] [SessionManagerController][OnCreateSessionResponse] SampleSession - 3058080948 - SFU - Pilot0

  • You have joined the session:

[HoloMIT] [SessionManagerController][OnJoinSessionResponse] Joined to session SampleSession and assigned PlayerID 1076983080

  • The pipeline is sending data:

[HoloMIT] stats: seq=2, ts=34338,701, component=MediaWriterDual#0Capturer, streamid=0, tile=0, quality=0

Receiver:

  • You have joined the session:

[HoloMIT] [SessionManagerController][OnJoinSessionResponse] Joined to session and assigned PlayerID 2123110365

  • The pipeline is receiving data:

[HoloMIT] stats: seq=5, ts=54798,204, component=MediaReaderDual#0, fps=16,31, process_time_ms=0, bytes_per_packet=81381, last_stream_id=0, Mbps=20,5