Search Issue Tracker
Won't Fix
Votes
0
Found in
Issue ID
1337938
Regression
No
Photo Capture callbacks are lost when Unity pauses during photo capture
If unity is paused during a photo capture, script callbacks may be lost and never called even after Unity resumes.
To reproduce, use the attached project.
The script in the project will continuously taking photos so long as no callbacks are dropped. If a callback drops, then the script will not update it's IsTakingPicture bool and will stop taking photos. This usually happens when an app is backgrounded during the photo capture process.
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Articulation Body with 'Revolute' Joint Type has erratic behavior when Upper Limit is set to above 360
- WebGL Player fails to render Scene when Terrain with Detail Mesh is added and WebGPU Graphics API is used
- Inconsistent errors are logged when different types are passed into the Query "Q<>" method in UIToolkit and the ancestor VisualElement is null
- Crash on GetMaterialPropertyByIndex when opening a specific Scene
- Discrepancies in the styling are present when using a TSS file instead of a USS file in custom EditorWindow
Resolution Note (2021.2.X):
There's a strange race-condition that prevents the StopPhotoModeAsync callback from firing when the app loses focus, primarily on HoloLens. Unfortunately, fixing this race-condition isn't trivial and changing the code paths will introduce significant regression risk for PhotCapture, KeywordRecognizer, and DictationRecognizer.
Instead, as a good practice, the app should automatically Dispose all media capture objects (video, speech, photo, etc.) whenever the app loses focus. For example:
private void OnApplicationFocus(bool focus)
{
if (!focus && _photoCaptureObject != null)
{
// Shutdown photo capture
_photoCaptureObject.Dispose();
_photoCaptureObject = null;
...
}
}