Give us as much detail as possible regarding the issue you're experiencing:
Unity Editor version: 2022.3.6f1
ML2 OS version: 1.8.0
Unity SDK version: 2.3.0
Host OS: Windows
I was working on updating an existing project to newer versions of MLSDK. Having some trouble with trying to obtain an RGB camera image, I found this post and tried to revert my project. However, the following bug happened, when I tried to determine the camera pose in the callback with if (MLCVCamera.GetFramePose(extras.VCamTimestamp, out Matrix4x4 cameraTransform).IsOk)
:
08-14 18:56:22.954 1047 3270 3343 E amdCamera3MetaArb: mAFMode : 4
08-14 18:56:22.954 1047 3270 3343 E amdCamera3MetaArb: ANDROID_CONTROL_AF_TRIGGER : 0
08-14 18:56:22.954 1047 3270 3343 E amdCamera3MetaArb: mAWBMode : 1
08-14 18:56:22.988 1047 3270 3343 E amdCamera3MetaArb: mAFMode : 4
08-14 18:56:22.988 1047 3270 3343 E amdCamera3MetaArb: ANDROID_CONTROL_AF_TRIGGER : 0
08-14 18:56:22.988 1047 3270 3343 E amdCamera3MetaArb: mAWBMode : 1
08-14 18:56:23.021 1047 3270 3343 E amdCamera3MetaArb: mAFMode : 4
08-14 18:56:23.021 1047 3270 3343 E amdCamera3MetaArb: ANDROID_CONTROL_AF_TRIGGER : 0
08-14 18:56:23.021 1047 3270 3343 E amdCamera3MetaArb: mAWBMode : 1
08-14 18:56:23.015 10107 3510 3510 W Binder:3510_4: type=1400 audit(0.0:79031): avc: denied { search } for name="traces" dev="nvme0n1p37" ino=5316611 scontext=u:r:untrusted_app:s0:c107,c256,c512,c768 tcontext=u:object_r:trace_data_file:s0 tclass=dir permissive=0
08-14 18:56:23.055 1047 3270 3343 E amdCamera3MetaArb: mAFMode : 4
08-14 18:56:23.055 1047 3270 3343 E amdCamera3MetaArb: ANDROID_CONTROL_AF_TRIGGER : 0
08-14 18:56:23.055 1047 3270 3343 E amdCamera3MetaArb: mAWBMode : 1
08-14 18:56:23.088 1047 3270 3343 E amdCamera3MetaArb: mAFMode : 4
08-14 18:56:23.088 1047 3270 3343 E amdCamera3MetaArb: ANDROID_CONTROL_AF_TRIGGER : 0
08-14 18:56:23.088 1047 3270 3343 E amdCamera3MetaArb: mAWBMode : 1
08-14 18:56:23.121 10107 3510 3560 E BufferQueueConsumer: [BufferItemQueue] acquireBuffer: max acquired buffer count reached: 5 (max 4)
08-14 18:56:23.121 10107 3510 3560 E BufferItemConsumer: [BufferItemQueue] Error acquiring buffer: Unknown error -38 (-38)
08-14 18:56:23.121 10107 3510 3560 E : acquireBuffer BufferItemConsumer::acquireBuffer fail, status: -38
08-14 18:56:23.121 1047 3270 3343 E amdCamera3MetaArb: mAFMode : 4
08-14 18:56:23.121 1047 3270 3343 E amdCamera3MetaArb: ANDROID_CONTROL_AF_TRIGGER : 0
08-14 18:56:23.121 1047 3270 3343 E amdCamera3MetaArb: mAWBMode : 1
08-14 18:56:23.154 10107 3510 3560 E BufferQueueConsumer: [BufferItemQueue] acquireBuffer: max acquired buffer count reached: 5 (max 4)
08-14 18:56:23.154 10107 3510 3560 E BufferItemConsumer: [BufferItemQueue] Error acquiring buffer: Unknown error -38 (-38)
08-14 18:56:23.154 10107 3510 3560 E : acquireBuffer BufferItemConsumer::acquireBuffer fail, status: -38
08-14 18:56:23.154 1047 3270 3343 E amdCamera3MetaArb: mAFMode : 4
08-14 18:56:23.154 1047 3270 3343 E amdCamera3MetaArb: ANDROID_CONTROL_AF_TRIGGER : 0
08-14 18:56:23.154 1047 3270 3343 E amdCamera3MetaArb: mAWBMode : 1
08-14 18:56:23.188 10107 3510 3560 E BufferQueueConsumer: [BufferItemQueue] acquireBuffer: max acquired buffer count reached: 5 (max 4)
08-14 18:56:23.188 10107 3510 3560 E BufferItemConsumer: [BufferItemQueue] Error acquiring buffer: Unknown error -38 (-38)
08-14 18:56:23.188 10107 3510 3560 E : acquireBuffer BufferItemConsumer::acquireBuffer fail, status: -38
08-14 18:56:23.221 10107 3510 3560 E BufferQueueConsumer: [BufferItemQueue] acquireBuffer: max acquired buffer count reached: 5 (max 4)
08-14 18:56:23.221 10107 3510 3560 E BufferItemConsumer: [BufferItemQueue] Error acquiring buffer: Unknown error -38 (-38)
08-14 18:56:23.221 10107 3510 3560 E : acquireBuffer BufferItemConsumer::acquireBuffer fail, status: -38
08-14 18:56:23.254 10107 3510 3560 E BufferQueueConsumer: [BufferItemQueue] acquireBuffer: max acquired buffer count reached: 5 (max 4)
08-14 18:56:23.254 10107 3510 3560 E BufferItemConsumer: [BufferItemQueue] Error acquiring buffer: Unknown error -38 (-38)
08-14 18:56:23.254 10107 3510 3560 E : acquireBuffer BufferItemConsumer::acquireBuffer fail, status: -38
08-14 18:56:23.620 4045 4364 4364 D BluetoothGatt: readRssi() - device: C4:D0:93:3C:22:33
08-14 18:56:24.254 1047 3367 3912 E Camera3-OutputStream: getBufferLockedCommon: Stream 0: Can't dequeue next output buffer: Connection timed out (-110)
08-14 18:56:24.254 10107 3510 3856 W Camera-Device: onDeviceError is invoked with error code: 3 frame number = 111
08-14 18:56:24.255 10107 3510 3982 I ml_camera_client: OnFailed
08-14 18:56:24.621 4045 4364 4364 D BluetoothGatt: readRssi() - device: C4:D0:93:3C:22:33
08-14 18:56:24.691 4116 5282 5283 I vcamdmmcontroller_service: nova/frameworks/services/perception_services/vcamdmmcontroller_svc/bin/src/main.cpp(182) ListenOnZpad():
08-14 18:56:24.691 4116 5282 5283 I vcamdmmcontroller_service: INF: ZPAD PW_MS_CONTROL_ZPAD still waiting...
08-14 18:56:24.904 10107 3510 3563 E com.UnityTechnologies.com.unity.template.urpblank: leapcore/frameworks/perception/data_sources/include/pad/xpad_data_source.h(105) GetClosestTimestampedData():
08-14 18:56:24.904 10107 3510 3563 E com.UnityTechnologies.com.unity.template.urpblank: ERR: Data Not Found for timestamp: 20862039321us, now time: 20864876890us
08-14 18:56:24.905 10107 3510 3563 E Unity : Error: MLCVCameraGetFramePose in the Magic Leap API failed. Reason: MLResult_PoseNotFound
08-14 18:56:24.905 10107 3510 3563 E Unity : Error: MLCamera.InternalGetFramePose failed to get camera frame pose. Reason: MLResult_PoseNotFound
08-14 18:56:24.905 10107 3510 3563 I Unity : Could not get frame pose
08-14 18:56:24.899 10107 3510 3510 W UnityGfxDeviceW: type=1400 audit(0.0:79041): avc: denied { search } for name="traces" dev="nvme0n1p37" ino=5316611 scontext=u:r:untrusted_app:s0:c107,c256,c512,c768 tcontext=u:object_r:trace_data_file:s0 tclass=dir permissive=0
08-14 18:56:24.899 10107 3510 3510 W UnityGfxDeviceW: type=1400 audit(0.0:79042): avc: denied { search } for name="traces" dev="nvme0n1p37" ino=5316611 scontext=u:r:untrusted_app:s0:c107,c256,c512,c768 tcontext=u:object_r:trace_data_file:s0 tclass=dir permissive=0
08-14 18:56:25.042 1000 3293 3293 I MagicFlinger: INF: MagicFlinger Periodic Info Log: CompositionCPU=0.65ms ; CompositionGPU=1.35ms ; ClientCPU=4.09ms ; ClientGPU=5.77ms ; TotalCPU=4.74ms ; TotalGPU=7.13ms ; ClientDroppedFrames=210 ; GlobalDimmer=0%
08-14 18:56:25.255 1047 3367 3912 E Camera3-OutputStream: getBufferLockedCommon: Stream 0: Can't dequeue next output buffer: Connection timed out (-110)
08-14 18:56:25.255 10107 3510 3885 W Camera-Device: onDeviceError is invoked with error code: 3 frame number = 112
08-14 18:56:25.255 10107 3510 3885 W Camera-Device: Error 3 has been posted, skip error 3 notification
08-14 18:56:25.621 4045 4364 4364 D BluetoothGatt: readRssi() - device: C4:D0:93:3C:22:33
08-14 18:56:26.255 1047 3367 3912 E Camera3-OutputStream: getBufferLockedCommon: Stream 0: Can't dequeue next output buffer: Connection timed out (-110)
08-14 18:56:26.255 10107 3510 3856 W Camera-Device: onDeviceError is invoked with error code: 3 frame number = 113
08-14 18:56:26.255 10107 3510 3856 W Camera-Device: Error 3 has been posted, skip error 3 notification
08-14 18:56:26.373 10107 3510 3925 E com.UnityTechnologies.com.unity.template.urpblank: leapcore/frameworks/perception/data_sources/include/pad/xpad_data_source.h(105) GetClosestTimestampedData():
08-14 18:56:26.373 10107 3510 3925 E com.UnityTechnologies.com.unity.template.urpblank: ERR: Data Not Found for timestamp: 20862893213us, now time: 20866345487us
08-14 18:56:26.377 10107 3510 3563 E com.UnityTechnologies.com.unity.template.urpblank: leapcore/frameworks/perception/data_sources/include/pad/xpad_data_source.h(105) GetClosestTimestampedData():
08-14 18:56:26.377 10107 3510 3563 E com.UnityTechnologies.com.unity.template.urpblank: ERR: Data Not Found for timestamp: 20864881193us, now time: 20866349415us
08-14 18:56:26.377 10107 3510 3563 E com.UnityTechnologies.com.unity.template.urpblank: leapcore/frameworks/perception/data_sources/include/pad/xpad_data_source.h(105) GetClosestTimestampedData():
08-14 18:56:26.377 10107 3510 3563 E com.UnityTechnologies.com.unity.template.urpblank: ERR: Data Not Found for timestamp: 20864881193us, now time: 20866349524us
It appears that after updating to the newer OS version, this query starts to be too slow (while it worked on OS 1.4.1). I tried to use the Pixel Sensor's Get Pose API however it also says:
08-14 19:47:34.873 10107 18542 18562 E Unity : was not connected
08-14 19:47:34.873 10107 18542 18562 E Unity : MagicLeap.OpenXR.Features.PixelSensors.MagicLeapPixelSensorFeature:IsSensorConnected(PixelSensorId, PixelSensor&, Boolean)
08-14 19:47:34.873 10107 18542 18562 E Unity : MagicLeap.OpenXR.Features.PixelSensors.MagicLeapPixelSensorFeature:GetSensorPose(PixelSensorId, Pose)
08-14 19:47:34.873 10107 18542 18562 E Unity : SimpleCamera:GetSensorPose()
08-14 19:47:34.873 10107 18542 18562 E Unity : SimpleCamera:RawImageAvailable(CameraOutput, ResultExtras, Metadata)
08-14 19:47:34.873 10107 18542 18562 E Unity : UnityEngine.XR.MagicLeap.Native.DispatchPayload3`3:Dispatch()
08-14 19:47:34.873 10107 18542 18562 E Unity : UnityEngine.XR.MagicLeap.Native.MLThreadDispatch:DispatchAll()
08-14 19:47:34.873 10107 18542 18562 E Unity :
08-14 19:47:34.873 10107 18542 18562 I Unity : Sensor Pose:((0.00, 0.00, 0.00), (0.00000, 0.00000, 0.00000, 0.00000))
I setup the project with setup tool 2.0.12, and when prompted to choose between OpenXR and ML SDK, I chose ML SDK but also enabled OpenXR in Project Settings - XR Plug-in Management
later. It now looks like this:
My guess is that the usage of Vuforia somehow led to both issues, (1) that OpenXR cannot find it when Vuforia claims the camera and (2) Vuforia made it too slow for the MLCamera API to return the pose. Is there a possible fix to this issue?
I remember having some issues with the Vuforia CameraDevice captures, particularly in the aspect ratio as I mentioned here. I didn't fix that as I moved to the MLCamera implementation back then. Is it possible to obtain RGB camera access using the Vuforia API? It might be a temporary workaround before you figure out a way to integrate camera access with the new OpenXR workflow. With the camera pose available from the Pixel Sensor's Get Pose API (or maybe through MRTK?), maybe it's still possible to do a world-to-screen conversion? I'm trying to work with OpenXR + MRTK3 + Vuforia as suggested here, but would really appreciate any help on this.
Thanks in advance!