Platform Troubleshooting
Every recoverable problem in this package arrives as data, not as an exception. Tracking
never throws from Update; it moves to TrackingState.Failed and tells you why through
TrackingError and a message.
Wire that up first — most of this page is quicker to diagnose with the reason on screen:
using Calium.Vision.Hands;
using UnityEngine;
public sealed class TrackingStateLogger : MonoBehaviour
{
[SerializeField] private HandTrackingManager _manager;
private void OnEnable() => _manager.OnTrackingStateChanged += HandleStateChanged;
private void OnDisable() => _manager.OnTrackingStateChanged -= HandleStateChanged;
private void HandleStateChanged(TrackingStateChange change)
{
if (change.Current == TrackingState.Failed)
Debug.LogWarning($"Hand tracking failed: {change.Error} — {change.Message}");
}
}
The Landmark Visualizer sample already does this and turns each error into a sentence on screen; it is the fastest scene to reproduce a problem in.
The camera never starts
Symptoms: TrackingState.Failed, or a black feed that never fills in.
Something else is holding the camera
The most common first-run failure on every platform, and on desktop it is nearly always a browser tab or a meeting app. Close it, exit Play, press Play again. No editor restart is needed.
What you will see: TrackingError.CameraUnavailable, with a message naming the device
and saying it "delivered no image within 5 seconds". That wording is exact and worth
understanding: the built-in WebCamTextureSource opens the device, waits up to five seconds
for a first image, and fails if none arrives.
CameraStartError.DeviceInUse exists in the API, but the bundled source never returns
it — Unity's WebCamTexture opens a busy device successfully and then delivers nothing,
which it gives no way to distinguish from "connected but silent", so both arrive as
NoCameraAvailable and the message lists the possibilities honestly rather than guessing.
That member is reserved for custom ICameraSource implementations, and is documented as
such on the enum itself. A source written over a platform camera API that does answer the
question — AVFoundation, Camera2, a native plugin, an AR session that already owns the
device — should return DeviceInUse where it genuinely knows; there is deliberately no
heuristic in the bundled source guessing at it. Either way the manager maps it to
TrackingError.CameraUnavailable, so a switch on the tracking error needs no change.
There is no camera
TrackingError.CameraUnavailable, with a message describing what enumeration found. On a
machine with several cameras you can pin one:
var source = new WebCamTextureSource("Logitech BRIO");
_manager.SetCameraSource(source); // call while Stopped
The name is a WebCamTexture device name. Pinning is exact — a device name that does not
match fails the start rather than quietly using a different camera.
The operating system is blocking it
Not a package problem, and the package cannot see the difference between this and a busy camera. Check:
- Windows — Settings ▸ Privacy & security ▸ Camera, and confirm desktop apps are allowed.
- macOS — System Settings ▸ Privacy & Security ▸ Camera, and confirm Unity (and your built app) is listed and enabled.
The permission was refused
TrackingError.CameraPermissionDenied. On Android and iOS the OS prompt appears on the first
start; once refused, the app cannot ask again — the user has to grant it in the system
settings for the app. Say that in your UI; do not retry in a loop.
Android
Camera permission
A project that has not taken over the Android manifest needs no action. Unity generates
the manifest at build time and adds android.permission.CAMERA itself because the app uses
WebCamTexture, which is what the package's camera source is built on.
The case that goes wrong is a project with its own
Assets/Plugins/Android/AndroidManifest.xml: that file replaces the generated one, and
with it the permission Unity would have added. The Setup Wizard checks exactly this and its
fix adds the uses-permission line to your manifest. It deliberately does not create a
manifest where there is none — that would replace a working arrangement with one you now
have to maintain.
The runtime prompt happens inside StartAsync; you do not have to request it yourself. If
you want to ask early — for instance on a menu screen, before the tracking scene loads:
CameraPermissionStatus status = await CameraPermission.RequestAsync();
Vulkan and OpenGLES3
Both work. The measured difference, on the one Android device this package has been benchmarked on (Galaxy A56, Xclipse 540 GPU):
| Vulkan | GLES3 | |
|---|---|---|
| Tracking fps, GPU-compute backend, one hand | 9.71 | 6.23 |
| Tracking fps, CPU backend, one hand | 25.46 | 22.18 |
| Application frame rate | 60.1 | 60.1 |
Vulkan is about 55% faster than GLES3 for the GPU backend, and the two are indistinguishable everywhere else. The CPU rows agreeing across the two APIs is the control that says the measurement is real — CPU inference does not touch the graphics API, so those rows should match, and they do.
Since the shipped Android default resolves to the CPU backend (why), the graphics API you pick makes little difference to a default build. Pick it for the rest of your game.
Do not ship Vulkan-only without an OpenGLES3 fallback. A device whose Vulkan driver your
build will not run on has nowhere to go and fails to start. The Setup Wizard flags an
explicit Vulkan-only list and its fix appends OpenGLES3 after Vulkan, which costs nothing
on devices that have Vulkan. Unity's automatic list already carries the fallback.
One benign GLES3 log line
On a forced-GLES3 build you may see exactly one line at camera-open:
OPENGL NATIVE PLUG-IN ERROR: GL_INVALID_ENUM
Once, on a worker thread, between camera enumeration and connect, with no functional effect.
It comes from Unity's own WebCamTexture GLES3 path setting a texture parameter the driver
rejects — this package never calls GL directly, everything goes through TextureConverter
and Blit. Vulkan on the same device is clean. It is recorded here so it is not
rediscovered as a mystery.
The overlay says the backend is Cpu
That is correct on Android. InferenceBackend.Auto resolves to CPU (Burst) on Android by
measurement — see Performance.
Setting Backend to GpuCompute explicitly in your config overrides it; on the measured
device that is about three times slower.
Orientation
Handled inside the camera source, and verified on hardware in all four screen orientations, on both the front and the back camera, while tracking — no restart between orientations. The image and the landmarks rotate together, and hands stay correctly labelled.
If you render the camera feed yourself rather than using the sample's, use
CameraFrame.DisplayTransform to orient it. The landmarks you receive are already corrected;
that matrix is exposed so that a feed you draw yourself can be made to agree with them.
iOS
NSCameraUsageDescription is mandatory
Player Settings ▸ iOS ▸ Camera Usage Description. If it is empty:
- iOS terminates your app the moment it opens the camera, and
- App Store review rejects the build before a user ever gets that far.
The Setup Wizard checks it and its fix writes a plain default. Reword it for your app — the string is shown to your user in the permission prompt, and a generic one is a poor first impression as well as a review risk.
Backend on iOS
Auto keeps GPU compute on iOS, deliberately. The Android CPU default was set on measured
evidence from an Android SoC; iOS runs Metal, and carrying an Android finding across to a
different GPU architecture would have been a guess rather than a measurement. If you profile
your target device and CPU wins there, set Backend explicitly in your config — one field.
Orientation
The orientation matrices for iOS (front and back camera, four screen orientations) are derived at runtime from the camera's own reported rotation and mirroring by one pure function, and every case in that matrix is covered by unit tests. On-device confirmation exists for Android; the iOS run lands with the device pass. Test the orientations your app allows before you ship, and tell us if anything disagrees.
Desktop and the editor
The image is mirrored — is that a bug?
No. A webcam is treated as a front-facing camera and the feed is horizontally mirrored on
purpose, so the hand on screen moves the way your own hand moves. CameraFrame.IsMirrored
is true and the mirroring is folded into DisplayTransform.
Handedness is reported from your point of view. Your right hand reports Right whether
the camera is mirrored or not; the mirroring is already resolved. If you are drawing your own
overlay and the hand looks right but the label looks wrong, the overlay is the thing to
check first, not the label.
Play mode, domain reloads and scene changes
OnEnable starts tracking (when AutoStart is on), OnDisable stops it and releases the
camera, OnDestroy disposes the session. Entering and leaving Play mode repeatedly, with
domain reload on or off, does not leak the camera or GPU resources.
If you drive HandTrackingSession yourself, you own that: dispose the session, and dispose
any ICameraSource you created — the session never takes ownership of a source you attach.
Conditions that make tracking harder
Everything in this section is measured — on the package's own fixture clips, or on the Android reference device — or is explicitly labelled where no measurement exists.
Low light
Acquisition suffers first; tracking suffers later. On the darkening fixture — one still at
three progressively darker and noisier exposure levels — the hand is acquired on tracking
result 4, is tracked in at most two continuous runs across the whole clip, and is still
tracked at the darkest level. The session stays Running throughout: a dark frame is a
frame, not an error, and no hand is ever reported that the model did not actually find.
Practically: when a hand is not picked up in a dim room, it is usually the palm search failing rather than tracking. Present the hand closer or in better light once; after that the tracker follows it from its own regions and copes with considerably less light than it needed to find it in the first place.
Hands at the edge of the frame
Handled deliberately. The region the landmark model runs on is allowed to extend past the edge
of the image, and the part that falls outside is filled with black — the same padding the models
were trained with — rather than being squeezed back inside, which would distort the hand and
drag every landmark with it. Landmarks the model places beyond the frame are reported outside
[0,1] rather than clamped, so a partly visible hand stays usable to your code.
What the padding does not buy is retention right up to the edge. A tracked hand is kept only while its own landmark result stays usable: the slot is freed as soon as the result's presence score fails to meet the threshold (a NaN score fails it too), or the region of interest and bounding box derived from those landmarks stop being valid. A hand sliding off the edge often fails one of those tests while it is still partly visible, so expect the loss slightly before the hand is genuinely gone.
What is measured is the round trip: a hand that travels out of frame is lost while it is gone and acquired again when it comes back — a fixture case in the test suite, not an expectation. On the device pass, every tracking loss observed happened at a physical limit: closer than roughly 10 cm to the lens, or far enough out of frame that the palm was no longer in it.
Gloves, jewellery, and sleeves
No fixture or device row covers gloved or heavily jewelled hands, so there is no accuracy number here to quote — and one will not be invented.
What can be said is mechanical: both stages work from appearance, so anything that changes the silhouette of the hand is a change of input to them. A ring or a watch is a small, local change; an opaque glove, a bulky cuff over the wrist, or a strongly reflective surface across the palm is not. Which stage feels it depends on when the covering appears. A hand that is already tracked is held by the landmark stage alone — palm detection does not maintain a hand a slot is already following — so a bare hand that becomes covered mid-session is dropped by the landmark stage's usability checks rather than by the detector: either presence fails to meet the threshold (a NaN presence fails it too), or the landmarks come back too degenerate to derive a region and bounds from. The detector's difficulty with a covered hand shows up in acquisition: finding a gloved hand in the first place, and finding it again after any loss.
If your application depends on hands that are covered, test with what your users will actually wear before you build around it — and remember that custom gestures can be recorded on exactly those hands (see the gesture recorder guide).
Things that look like bugs and are not
Tracking rate is much lower than frame rate
Expected, and it is the honest number. The application renders at its own rate; inference
runs on its own cadence and produces a new result every 30–130 ms depending on device,
backend and preset. VisionRuntimeStats.TrackingFps is the rate that describes how tracking
feels; see Performance.
CurrentFrame does not change every frame
Same cause. HandFrame.FrameId increments per tracking result, not per rendered frame,
and CurrentFrame repeats in between. Anything that accumulates over time — a dwell, a
debounce, a smoothing window — must advance on FrameId changes, or it will behave
differently at different frame rates. Every interaction sample in the package does it this way,
and each one is worth copying from.
The counter is monotonic for the life of the tracking session, so the usual
if (frame.FrameId > _lastSeen) test survives a pause: a background cycle releases the
camera and forgets every tracked hand, but ids carry on from where they were rather than
restarting, and there is no high-water mark to reset on resume. Only a new session — a new
HandTrackingManager, or one whose start failed and was retried — begins again at 0.
A hand pointed at the camera is labelled the wrong way round
Measured, and mitigated in the package. When a hand is heavily foreshortened — tilted so the
palm points at the lens — the model's handedness output degrades and can flip; in one measured
sitting a right hand read as Left at 0.90 and 0.70 confidence while flat poses read Right
at 0.99.
The mitigation that ships: handedness is latched when a tracking slot acquires a hand and held until that slot is lost, so a flip mid-pose changes nothing. What is still exposed is a hand acquired while heavily foreshortened. If your interaction depends on which hand it is, acquire the hand flat.
Calium.Fist on the non-dominant hand, at range
Calium.Fist scores 100% held-out on the dominant hand and 100% at 25 cm and 50 cm. The one
condition where it drops is the non-dominant hand beyond about 70 cm, and that condition is
tracker-side rather than classifier-side: a closed hand at that range gives palm detection and
landmark regression the least to work with, and a fist is the pose with the least geometry left
once the vector is scaled to unit hand size. Two rounds of extra training data confirmed it —
examples of a hand the tracker cannot resolve teach the classifier nothing.
Practical advice: for a critical action, prefer a more open gesture, or bring the hand closer. The FAQ has the full per-gesture accuracy table, published per condition rather than averaged.
Getting help
Open Tools ▸ Calium ▸ Vision Kit ▸ Setup Wizard and press Copy diagnostics. It puts the full check report — including the model validation output, which names the check, the operator and the tensor if a model failed — on your clipboard. Include it in your support request. It is what makes a problem answerable without a reproduction project.