Table of Contents

Using session validation tool

This article introduces how to use the session validation tool to quickly validate session workflows in the editor and perform simulation runs using EIF files.

Before you begin

Simulation runs use EIF files as input, so you need to record an EIF file before starting:

Additionally, you should understand:

session validation tool

The session validation tool helps developers quickly validate session workflows in the Unity editor and perform simulation runs using EIF files.

By default, you can see the session validation tool in the Inspector window of the AR Session (EasyAR) object. It is part of the DiagnosticsController editor:

alt text

Click the button in the upper-right corner of the tool to pop it out as a standalone window for easier viewing and operation. When the window is closed or the button is pressed, the tool will reappear in the Inspector window.

alt text

The runtime effect of the tool is shown in the following video:

This video demonstrates the usage effect of the session validation tool, recorded in Unity's play mode. The upper-left part shows the Hierarchy view, the middle shows the Scene view, and the right shows the Game view. The lower part shows the session validation tool. The content in the Game view is the same as what users see in the real world on their phones.

The upper-left part of the tool shows the EIF playback progress bar, which changes as playback progresses. The lower-left part shows the current session status. The right side displays session components and available center modes.

In the scene, you can see three simultaneously working AR features:

  • Motion tracking: Provided by the frame player, the blue sphere is the XR Origin, and the blue cone represents the user's position.
  • Dense spatial mapping: Semi-transparent mesh models are continuously generated as the viewpoint moves.
  • Sparse spatial tracking: A Christmas tree is being tracked in the video, with overlaid virtual objects appearing as light blue point clouds.

Starting the tool

Click the button at the top of the tool to start it. Pressing this button has the same effect as pressing the button on the Unity toolbar.

alt text

If the tool is already running, the button will change to , and clicking it will stop the tool.

When the tool is displayed as a standalone window, the dropdown next to the button allows you to select the session object used by the tool. If the window is reset and the session is lost, you can reselect it here.

Controlling EIF playback

To use the EIF playback feature, check the Frame Player option in the tool before running. This allows the tool to manage frame source selection during session assembly. Regardless of the AssembleOptions.FrameSource setting, the frame player component will be enabled.

alt text

Therefore, a pop-up will appear at runtime, indicating that the current session's frame source is managed by the tool:

alt text

Note

The tool only manages frame source selection during assembly in the Unity editor. This option has no effect when the application is packaged and run.

During normal operation, the EIF playback control features appear in the boxed area at the top of the tool:

alt text

You can control EIF file playback using these buttons:

  • : Play, resume playback from paused or stopped state
  • ▮▮: Pause
  • : Stop
  • ▮◀: Jump back 5 seconds (when supported by the file)
  • ◀◀: Decrease playback speed (when supported by the file)
  • ▶▶: Increase playback speed (when supported by the file)
  • ▶▮: Jump forward 5 seconds (when supported by the file)
  • : Open file
  • Progress bar: Click to jump to a playback position (when supported by the file)

You can adjust content and interaction logic in the scene while playing, enabling most development work on a computer with visual feedback.

Note

When playing new data or jumping playback positions, existing data in the scene is not cleared. The state of AR components is not reset either. They will behave as if the camera data suddenly jumped from the previous frame to new data.

While this may not significantly affect some features, it can cause abnormal states in motion tracking-dependent features (such as dense spatial mapping, Mega, etc.), potentially impacting runtime performance.

Controlling session workflow

To use the session workflow control feature, check the Session Workflow option in the tool before running. This option is checked by default.

alt text

During normal operation, session workflow controls appear below the playback controls in the boxed area:

alt text

Above this entire area, the EasyARController.IsReady and ARSession.State statuses are displayed.

Below this area, buttons are provided to control the session workflow:

  • Initialize: Initialize the session, choosing to use the license key configured in Project Settings or entering one manually
  • Assemble: Assemble but do not start the session
  • StartSession (Assembled): Start the assembled session
  • StartSession: Assemble and start the session
  • StopSession: Stop the session
  • StopSession (keep image): Stop the session but retain the image background
  • Deinitialize: Deinitialize the session
Note

Since these controls directly call relevant methods of ARSession and EasyARController, you can use these buttons to verify the impact of session state changes on content. However, note that if similar methods are called in application scripts, the application's flow may deviate from its intended behavior.

Controlling session components

To use the session component control feature, check the Session Workflow option in the tool before running. This option is checked by default.

alt text

During normal operation, session component controls appear at the bottom or right side of the tool (position varies with window width) in the boxed area:

alt text

The content displayed in this area depends on the specific session. For example, the session used in the image above includes image tracking, dense spatial mapping, and sparse spatial tracking components, so the tool displays checkboxes for these three features.

Generally, this area shows all available AR feature components in the session and provides enable/disable (enabled) controls for them, including:

  • AR Session: Controls enable/disable of the session itself
  • Image Renderer: Controls enable/disable of physical camera image rendering
  • Camera: Controls enable/disable of virtual cameras
  • Frame Source: Controls enable/disable of frame sources (only controllable when frame player is not enabled; when frame player is enabled, control is handled by the EIF playback section)
  • Frame Filter: Controls enable/disable of specific AR features
  • Frame Recorder: Controls enable/disable of EIF recording components (only visible when frame player is not enabled; when frame player is enabled, this component is not assembled into the session)

The area also displays available center modes and session reports.

Note

The available center modes and session reports displayed in the tool are results from running in the editor and may differ when run on actual devices.