HeadTracking() Permission Denied Error - App will not run

I am building my first app with the ML2. I have followed the guide to a T and even tried the example projects. I am able to build and run the application but it will not appear in the headset. The Unity logo does not appear and the app does not run. Using Android Logcat I have included a number of errors below. The biggest issue seems to be around the HeadTracking permissions in the core framework. Has anyone seen this before or know if this is a hardware issue?

Unity Version: 2022.2.0b16.112.5806

SDK Version: 1.1.0
XR Version: 7.0.0 - Pre.1

ML2 OS version: Version 10 - Build Number: B3E.220619.07-R.107

'''
2022/12/07 14:44:35.738 7774 7774 Warn UnityMain type=1400 audit(0.0:572): avc: denied { search } for name="traces" dev="nvme0n1p37" ino=8511491 scontext=u:r:untrusted_app:s0:c100,c256,c512,c768 tcontext=u:object_r:trace_data_file:s0 tclass=dir permissive=0
2022/12/07 14:44:35.738 7774 7774 Info chatty uid=10100(com.roundtablelearning.ml) identical 7 lines
2022/12/07 14:44:35.742 7774 7774 Warn UnityMain type=1400 audit(0.0:580): avc: denied { search } for name="traces" dev="nvme0n1p37" ino=8511491 scontext=u:r:untrusted_app:s0:c100,c256,c512,c768 tcontext=u:object_r:trace_data_file:s0 tclass=dir permissive=0
2022/12/07 14:44:35.756 7774 7795 Error vulkan internal vkGetInstanceProcAddr called for vkEnumerateInstanceExtensionProperties with an instance
2022/12/07 14:44:35.757 7774 7795 Info Unity [XR] [XRPreInit]: Telling EGL/Vulkan to use the offscreen swapchain!
2022/12/07 14:44:35.757 7774 7795 Info vulkan Loaded layer VK_LAYER_MAGICLEAP_dirty_tile_map
2022/12/07 14:44:35.768 7774 7795 Error vulkan internal vkGetInstanceProcAddr called for vkEnumerateInstanceExtensionProperties with an instance
2022/12/07 14:44:35.801 7774 7795 Warn Android_FMOD_MLAudio OutputMLAudio::getDescriptionEx, ...
2022/12/07 14:44:35.804 7774 7845 Error AudioTrack-JNI AudioTrack::getMinFrameCount() for sample rate 24000 failed with status -1
2022/12/07 14:44:35.804 7774 7845 Error android.media.AudioTrack getMinBufferSize(): error querying hardware
2022/12/07 14:44:35.804 7774 7845 Error AudioTrack-JNI Error -1 initializing AudioTrack
2022/12/07 14:44:35.805 7774 7845 Error AudioTrack Failed to destroy audio output: -1643053055
2022/12/07 14:44:35.805 7774 7845 Error android.media.AudioTrack Error code -20 when initializing AudioTrack.
2022/12/07 14:44:35.805 7774 7845 Warn AudioTrack Use of stream types is deprecated for operations other than volume control
2022/12/07 14:44:35.805 7774 7845 Warn AudioTrack See the documentation of AudioTrack() for what to use instead with android.media.AudioAttributes to qualify your playback use case
2022/12/07 14:44:35.805 7774 7845 Error FMOD AudioTrack failed to initialize (status 0)
2022/12/07 14:44:35.805 7774 7845 Error AudioTrack-JNI AudioTrack::getMinFrameCount() for sample rate 24000 failed with status -1
2022/12/07 14:44:35.805 7774 7845 Error android.media.AudioTrack getMinBufferSize(): error querying hardware
2022/12/07 14:44:35.805 7774 7845 Error AudioTrack-JNI Error -1 initializing AudioTrack
2022/12/07 14:44:35.805 7774 7845 Error AudioTrack Failed to destroy audio output: -1643053055
2022/12/07 14:44:35.805 7774 7845 Error android.media.AudioTrack Error code -20 when initializing AudioTrack.
'''

'''
2022/12/07 14:44:36.052 7774 7795 Error com.roundtablelearning.ml leapcore/frameworks/perception/components/head_tracking/src/head_tracking.cpp(256) HeadTracking():
2022/12/07 14:44:36.052 7774 7795 Error com.roundtablelearning.ml ERR: exception: Permission Denied
2022/12/07 14:44:36.140 7774 7795 Error com.roundtablelearning.ml leapcore/frameworks/perception/components/head_tracking/src/head_tracking.cpp(256) HeadTracking():
2022/12/07 14:44:36.140 7774 7795 Error com.roundtablelearning.ml ERR: [stack trace begin]
2022/12/07 14:44:36.140 7774 7795 Error com.roundtablelearning.ml #00 pc 0000000000015ee3 /system/lib64/libml_perception_head_tracking.so (_ZN2ml10perception10components13head_tracking12HeadTrackingC2ENSt3__110unique_ptrINS0_11datasources17DataSourceManagerIJNS6_24ITimeQueriableDataSourceINS_3pil2ss17world_pose_resultEEEEEENS4_14default_deleteISD_EEEE+1059)
2022/12/07 14:44:36.140 7774 7795 Error com.roundtablelearning.ml #01 pc 000000000001cbf6 /system/lib64/libml_perception_head_tracking.so (_ZN2ml10perception10components13head_tracking19HeadTrackingFactory6CreateINS_8PlatformILNS_14TargetPlatformE2EEEEENSt3__110unique_ptrINS2_13IHeadTrackingENS8_14default_deleteISA_EEEEPKNS_12MockHeadposeE+790)
2022/12/07 14:44:36.140 7774 7795 Error com.roundtablelearning.ml #02 pc 00000000000fa52f /system/lib64/libopenxr_runtime.magicleap.so (_ZN2ml3oxr8instance6CreateINS_8PlatformILNS_14TargetPlatformE2EEEEENS_7HResultERKNS1_10CreateInfoIT_EERP12XrInstance_T+1775)
2022/12/07 14:44:36.140 7774 7795 Error com.roundtablelearning.ml #03 pc 00000000000f0976 /system/lib64/libopenxr_runtime.magicleap.so (_ZN2ml3oxr20OXR_xrCreateInstanceINS_8PlatformILNS_14TargetPlatformE2EEEEE8XrResultPK20XrInstanceCreateInfoPP12XrInstance_T+342)
2022/12/07 14:44:36.140 7774 7795 Error com.roundtablelearning.ml #04 pc 0000000000036b2f /system/lib64/libopenxr_loader.magicleap.so (RuntimeInterface::CreateInstance(XrInstanceCreateInfo const*, XrInstance_T**)+63)
2022/12/07 14:44:36.140 7774 7795 Error com.roundtablelearning.ml #05 pc 00000000000239b2 /system/lib64/libopenxr_loader.magicleap.so (LoaderXrTermCreateInstance(XrInstanceCreateInfo const*, XrInstance_T**)+2162)
2022/12/07 14:44:36.140 7774 7795 Error com.roundtablelearning.ml #06 pc 000000000002834f /system/lib64/libopenxr_loader.magicleap.so (_ZN14LoaderInstance14CreateInstanceEPF8XrResultP12XrInstance_TPKcPPFvvEEPFS0_PK20XrInstanceCreateInfoPS2_EPFS0_SC_PK20XrApiLayerCreateInfoSD_ENSt3__16vectorINSL_10unique_ptrI17ApiLayerInterfaceNSL_14default_deleteISO_EEEENSL_9allocatorISR_EEEESC_PNSN_IS_NSP_IS_EEEE+2991)
2022/12/07 14:44:36.140 7774 7795 Error com.roundtablelearning.ml #07 pc 000000000001d83b /system/lib64/libopenxr_loader.magicleap.so (LoaderXrCreateInstance(XrInstanceCreateInfo const*, XrInstance_T**)+3131)
2022/12/07 14:44:36.140 7774 7795 Error com.roundtablelearning.ml #08 pc 000000000022cadb /system/lib64/libgraphics.magicleap.so (ml::graphics::XrInstanceData::CreateInstance()+331)
2022/12/07 14:44:36.140 7774 7795 Error com.roundtablelearning.ml #09 pc 0000000000230622 /system/lib64/libgraphics.magicleap.so (ml::graphics::CreateClientCommon(unsigned long, ml::graphics::SessionGraphicsDevice const&, ml::graphics::GraphicsOptionsInternal const&, XrBaseInStructure const&, unsigned long&)+354)
2022/12/07 14:44:36.140 7774 7795 Error com.roundtablelearning.ml #10 pc 000000000023104f /system/lib64/libgraphics.magicleap.so (ml::graphics::CreateClientVK(ml::graphics::GraphicsOptionsInternal const&, unsigned long&)+2447)
2022/12/07 14:44:36.140 7774 7795 Error com.roundtablelearning.ml #11 pc 0000000000234675 /system/lib64/libgraphics.magicleap.so (MLGraphicsCreateClientVk+101)
2022/12/07 14:44:36.140 7774 7795 Error com.roundtablelearning.ml #12 pc 00000000001b6fee /data/app/com.roundtablelearning.ml-AWPrfDFF4cJ4jJj8K4O7SA==/lib/x86_64/libml_sdk_loader.so (ZN9DelayCallI8graphics33MLGraphicsCreateClientVkDelayCalliJPK17MLGraphicsOptionsP12VkInstance_TP18VkPhysicalDevice_TP10VkDevice_TPmEE11LoadAndCallES4_S6_S8_SA_SB+142)
2022/12/07 14:44:36.140 7774 7795 Error com.roundtablelearning.ml #13 pc 00000000001b6f4d /data/app/com.roundtablelearning.ml-AWPrfDFF4cJ4jJj8K4O7SA==/lib/x86_64/libml_sdk_loader.so (ZN9DelayCallI8graphics33MLGraphicsCreateClientVkDelayCalliJPK17MLGraphicsOptionsP12VkInstance_TP18VkPhysicalDevice_TP10VkDevice_TPmEEclES4_S6_S8_SA_SB+93)
2022/12/07 14:44:36.140 7774 7795 Error com.roundtablelearning.ml #14 pc 00000000001b527b /data/app/com.roundtablelearning.ml-AWPrfDFF4cJ4jJj8K4O7SA==/lib/x86_64/libml_sdk_loader.so (Z28MLGraphicsCreateClientVkShimIJPK17MLGraphicsOptionsP12VkInstance_TP18VkPhysicalDevice_TP10VkDevice_TPmEEiDpT+139)
2022/12/07 14:44:36.140 7774 7795 Error com.roundtablelearning.ml #15 pc 00000000001b5191 /data/app/com.roundtablelearning.ml-AWPrfDFF4cJ4jJj8K4O7SA==/lib/x86_64/libml_sdk_loader.so (MLGraphicsCreateClientVk+65)
2022/12/07 14:44:36.140 7774 7795 Error com.roundtablelearning.ml #16 pc 000000000008a93c /data/app/com.roundtablelearning.ml-AWPrfDFF4cJ4jJj8K4O7SA==/lib/x86_64/libUnityMagicLeap.so (graphics::create_client(UnityGfxRenderer, MLGraphicsOptions const*, graphics::client*)+92)
2022/12/07 14:44:36.140 7774 7795 Error com.roundtablelearning.ml #17 pc 0000000000078373 /data/app/com.roundtablelearning.ml-AWPrfDFF4cJ4jJj8K4O7SA==/lib/x86_64/libUnityMagicLeap.so (GraphicsThreadDisplayProvider::InitGraphicsClientAndRenderTargets()+163)
2022/12/07 14:44:36.140 7774 7795 Error com.roundtablelearning.ml #18 pc 00000000000780d1 /data/app/com.roundtablelearning.ml-AWPrfDFF4cJ4jJj8K4O7SA==/lib/x86_64/libUnityMagicLeap.so (GraphicsThreadDisplayProvider::GraphicsThreadDisplayProvider(IUnity
'''

1 Like

Thank you for your post @sstachiw, I'll take a look and report back asap.

1 Like

Hi @sstachiw, the first step is to update the ML2 OS version you're using to our latest version, which you can do in the ML Hub. Please let me know if you're still having issues after updating.

1 Like

Thank you @kdowney, I will give that a try now.

1 Like

@kdowney that was the issue. Updated and running as expected. Thank you!

2 Likes

@sstachiw Great to hear. Thank you for the update and best of luck with your app.

1 Like