Crash with MLCamera API (we know it has deprecated)
Give us as much detail as possible regarding the issue you're experiencing:
Unity Editor version: 2022.3.x ML2 OS version: 1.4.0-dev2 ~ 1.4.1 Unity SDK version: 1.11.0 Host OS: (Windows/MacOS) Both
We developed the application for experiment from last year. and due to the schedule, we still using the deprecated ML API not the OpenXR API.
The crash appear in the order of long-used devices for development. The first device has been repaired due to this, and so far it seems to be working as normal. (Over an hour of use)
The devices with problem will crash at a usage time of about 10 minutes.
We using 1.4.0 until now, so when we updated the problematic device to 1.4.1 and initialized the factory, it was able to use it for more than 40 minutes, but after that, it returned to about 10 minutes of use.
This problem is also seen in sample applications using MLCamera API.
Error messages from logs (syntax-highlighting is supported via Markdown):
I'm not seeing anything directly in the logs, I also have not been able to reproduce the crash inside the Magic Leap Camera Capture example in Unity. Do you mind testing with SDK version 1.12.0? Are there any steps that I am missing when testing inside the Unity Example Project?
Thank you for that information. Do you mind providing more details about your application? You said that you were able to reproduce this in the Magic Leap Examples CVCamera scene?
Furthermore, the sample application that reproduces the problem is the WorldCamera scene.
We haven't checked CVCamera, but I think it will be the same.
We currently have three ML2 devices, and I believe it's an important point that the issue is only reproducible on the one that has been used the longest.
Interesting, I will test with the world camera demo.
Do you know if that device was upgraded following the upgrade path specified on the customer care website. I wonder if you are running into the same issue as this developer.
Thank you for sharing this information with us. Question regarding reproducing this issue in the Camera Example. Does the issue occur when using the MLSDK example's CVCamera scene and then switching to the WorldCamera example scene?
It occur randomly. such as switching between WorldCamera, CVCamera, AudioCapture (sorry for the inaccurate name—I'm currently working on a new application using the latest ML2 SDK), and back to CVCamera, and so on.
However, the key difference is that our application causes the device to reboot (it reboots after the 'tracking lost' message), while the sample app only causes the application to close.
It would be great if this could definitively narrow down the issue. Unfortunately, in the past, there were instances where only the application would close without causing the device to reboot.
And our issue is in the same line as the one previously reported(but the code base is not same. the common aspect is that both use the MLCamera API.). Could this be a clue to solving the problem?
Additionally, we faced new issue with MLCamera API that reported before. Would it be better to report this in a new thread?
Here is the log sample:
Environment: ML OS 1.9 + Unity SDK 2.4.0
10-18 14:57:11.769 24573 24594 I Unity : [WebRTC Steamer Log] CaptureVideoStart
10-18 14:57:11.771 24573 24594 I CameraManagerGlobal: Connecting to camera service
10-18 14:57:11.772 3319 3701 W ServiceManager: Permission failure: com.magicleap.permission.CAMERA_CAPTURE_CVIP from uid=10108 pid=24573
10-18 14:57:11.772 3319 3701 D ServiceManager: Permission check violation (permissive=0): com.magicleap.permission.CAMERA_CAPTURE_CVIP from uid=10108 pid=24573, Permission ARE enforcing.
10-18 14:57:11.773 3319 3701 W ServiceManager: Permission failure: com.magicleap.permission.CAMERA_CAPTURE_CVIP from uid=10108 pid=24573
10-18 14:57:11.773 3319 3701 D ServiceManager: Permission check violation (permissive=0): com.magicleap.permission.CAMERA_CAPTURE_CVIP from uid=10108 pid=24573, Permission ARE enforcing.
10-18 14:57:11.774 3319 3701 W ServiceManager: Permission failure: com.magicleap.permission.CAMERA_CAPTURE_CVIP from uid=10108 pid=24573
...
10-18 14:57:11.781 24573 24594 I Unity : [WebRTC Steamer Log] WebCam device found
10-18 14:57:11.783 24573 24594 I Unity : [WebRTC Steamer Log] Available webcam: Camera 0
10-18 14:57:11.783 24573 24594 I Unity : O2M.AppleCider.Network.WebRTC.<>c:<CaptureVideoStart>b__30_0(WebCamDevice)
10-18 14:57:11.783 24573 24594 I Unity : System.Collections.Generic.List`1:ForEach(Action`1)
10-18 14:57:11.783 24573 24594 I Unity : O2M.AppleCider.Network.WebRTC.<CaptureVideoStart>d__30:MoveNext()
10-18 14:57:11.783 24573 24594 I Unity : UniRx.<WrapEnumerator>d__291:MoveNext()
10-18 14:57:11.783 24573 24594 I Unity : UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
10-18 14:57:11.783 24573 24594 I Unity : UniRx.InternalUtil.ThreadSafeQueueWorker:ExecuteAll(Action`1)
10-18 14:57:11.783 24573 24594 I Unity :
10-18 14:57:11.784 24573 24594 I Unity : [WebRTC Steamer Log] Available webcam: Camera 1
10-18 14:57:11.784 24573 24594 I Unity : O2M.AppleCider.Network.WebRTC.<>c:<CaptureVideoStart>b__30_0(WebCamDevice)
10-18 14:57:11.784 24573 24594 I Unity : System.Collections.Generic.List`1:ForEach(Action`1)
10-18 14:57:11.784 24573 24594 I Unity : O2M.AppleCider.Network.WebRTC.<CaptureVideoStart>d__30:MoveNext()
10-18 14:57:11.784 24573 24594 I Unity : UniRx.<WrapEnumerator>d__291:MoveNext()
10-18 14:57:11.784 24573 24594 I Unity : UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
10-18 14:57:11.784 24573 24594 I Unity : UniRx.InternalUtil.ThreadSafeQueueWorker:ExecuteAll(Action`1)
10-18 14:57:11.784 24573 24594 I Unity :
10-18 14:57:11.784 24573 24594 I Unity : [WebRTC Steamer Log] Available webcam: Camera 2
10-18 14:57:11.784 24573 24594 I Unity : O2M.AppleCider.Network.WebRTC.<>c:<CaptureVideoStart>b__30_0(WebCamDevice)
10-18 14:57:11.784 24573 24594 I Unity : System.Collections.Generic.List`1:ForEach(Action`1)
10-18 14:57:11.784 24573 24594 I Unity : O2M.AppleCider.Network.WebRTC.<CaptureVideoStart>d__30:MoveNext()
10-18 14:57:11.784 24573 24594 I Unity : UniRx.<WrapEnumerator>d__291:MoveNext()
10-18 14:57:11.784 24573 24594 I Unity : UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
10-18 14:57:11.784 24573 24594 I Unity : UniRx.InternalUtil.ThreadSafeQueueWorker:ExecuteAll(Action`1)
10-18 14:57:11.784 24573 24594 I Unity :
10-18 14:57:11.821 24573 24653 W Android_FMOD_MLAudio: OutputMLAudio::recordLock, offset 5696, length 320, mRecordPositionBytes 0
10-18 14:57:11.821 24573 24653 W Android_FMOD_MLAudio: OutputMLAudio::recordUnlock, mRecordPositionBytes 0
10-18 14:57:11.821 24573 24653 W Android_FMOD_MLAudio: OutputMLAudio::recordLock, offset 6016, length 320, mRecordPositionBytes 0
10-18 14:57:11.821 24573 24653 W Android_FMOD_MLAudio: OutputMLAudio::recordUnlock, mRecordPositionBytes 0
The random reboot can suggest that there is a memory leak somewhere. Would it be possible for you to upgrade your application to OpenXR? You will still be able to use the MLCamera API as you did previously.
I will test the steps that you mentioned regarding the World Camera, CVCamera and Audio Capture.
Regarding the the com.magicleap.permission.CAMERA_CAPTURE_CVIP logs, these are just a warning related to a system function that are un related to your application.
I just tested the Unity 1.12.1 Unity Example project and unfortunately was unable to get the crash that you mentioned.
Can you verify that your application is disposing it's resources correctly? You can also try to profile your app to see if there are any undisposed references.