yasirkula/UnityNativeCamera

Take Picture with AR Kit does not work and also shows a black screen (iOS only, ocurring on some devices)

marcolbx opened this issue · 4 comments

Description of the bug
When using AR Kit and trying to take a picture, the camera would appear black and would not actually work, since we have a black screen, we assume that the camera stream is not taken correctly. It seems like AR Kit locks the camera and would not allow other plugin to work on it. However, the video camera is actually working on all devices. Which makes us think that the problem could be on the TakePicture process somehow.

The same build was tested on the following devices:
List of devices that DO NOT have the problem
iPad 6 - iOS 13.4
iPad 6- iOS 14.3
iPad 7 - iOS 14.5
iPad Pro 11

List of devices that HAVE the problem:
iPad 8 - iOS 14.4
iPad 8 - iOS 15.3

Reproduction steps

Use AR Kit on your iOS device, make a button with the Take Picture method of the example and try to take a picture.
(Beware that if the problem does not happen, then your device could be on the white list. However if you could add the specs it would be helpful)

Additional info

  • RecordVideo method works perfectly on all devices, we get the camera stream and the video afterwards.
  • The TakePicture method works on all devices if ar kit is not used.

Something that is curious:
working:
iPad 7 : A10 Fusion chip
iPad 6: A10 Fusion chip
iPad Pro 11 (2020): A12Z Bionic chip
not working:
iPad 8: A12 Bionic chip
iPad 8: A12 Bionic Chip

I did find a workaround but it would be better if we did not use it.
Turn off AR Session before taking a pic and turn it back on after the picture was taken.

It's probably related to two processes not being able to use the camera simultaneously. My theory is that, on working devices, different rear cameras are used for photos and videos (some devices have multiple rear cameras).

Why don't you grab a screenshot from the AR camera in Unity, wouldn't that be the same thing as opening NativeCamera?

the comparison of the devices does not seem to show that there are multiple rear cameras. From iPad 7 to iPad 8 there is almost no difference.

I see. I unfortunately have no other theories at the moment.