Log in or register to post comments

SetFlashTorchMode() fails on Android 9

April 5, 2019 - 8:35am #1

Hi Everybody,

I think I just came across a peculiar bug in the Unity API when trying to turn on the flash torch.

On some Android devices it seems that Vuforia can't control the flash torch any more. Any calls from

CameraDevice.Instance.SetFlashTorchMode(true)

return "Toggle flash ON FAILED" in the console.

My guess is that it's related to Android 9.0, where the camera interface was changed. I say this because the call does not work on OnePlus 6T and Samsung Galaxy Note 8, both with Android Pie (9.0), but it works without issues on Nexus 5x and on a Samsung Galaxy S7, both with Android Oreo (8.0).

The problem is that I can't use native calls from CameraManager to turn on the torchlight because Vuforia has exclusive access to the camera. I really need this to work in my next projet across all the devices and I am pretty much stuck here. Maybe there is another way to do it with Vuforia, but I couldn't find it.

Does anybody have any suggestions?

Thanks,

Sabin

SetFlashTorchMode() fails on Android 9

April 11, 2019 - 9:42am #5

Hello,

Thanks for the response and sorry that I didn't get back to you sooner. Glad you found the solution on your own.

sabinSerban wrote:

The funny thing is that my Samsung S7 with Android 8 also has ARCore installed, but in the ADB log it is not activated by Vuforia Fusion.

Correct. Unfortunately, there are ARCore limitations with the Engine integration on the S7 which required us to selectively disable it on that device. The following table reflects that status:

https://library.vuforia.com/articles/Solution/vuforia-fusion-supported-devices.html

Providing here for your future reference.

Thanks,

Vuforia Engine Support

SetFlashTorchMode() fails on Android 9

April 9, 2019 - 3:54am #4

Solved it by setting the following, before initializing Vuforia:

VuforiaRuntimeUtilities.SetAllowedFusionProviders(FusionProviderType.VUFORIA_VISION_ONLY)

Now the flash works on all my devices.

SetFlashTorchMode() fails on Android 9

April 9, 2019 - 1:48am #3

Hi medabit,

You were right. After disabling ARCore on my Android 9 device, the torch works without issues.

The funny thing is that my Samsung S7 with Android 8 also has ARCore installed, but in the ADB log it is not activated by Vuforia Fusion.

Fortunately in my current project I don't need ARCore capabilities, so I'm perfectly fine with disabling it. I'll look for ways of doing that, but if you're still following this thread maybe you can help me by telling me where to go in order to disable ARCore support in Vuforia Fusion.

Thanks,

Sabin

SetFlashTorchMode() fails on Android 9

April 5, 2019 - 2:18pm #2

Hello,

I'm wondering if this is related to ARCore as currently torch is not supported.

ADB logs will indicate if Vuforia is using ARCore:

$ adb logcat AR:D Unity:D *:S

And if ARCore is installed on device, by default Vuforia Fusion will try and use it. If ARCore is installed on those devices, I suggest you try to uninstall/disable it and run again to see if the torch works.

Thanks,

Vuforia Engine Support

 

Log in or register to post comments