DepthCamera Operating mode SR+LR can not be set

Unity Editor version: 2022.3.11f1
ML2 OS version: Version 1.5.0
Unity SDK version: 2.0.0
Host OS: (Windows/MacOS): Windows 11 Pro 23H2 22631.3235

On the Sensors | MagicLeap Developer Documentation page it is said that:

  • Operating Modes - SR (60Hz), LR (5Hz), SR+LR (5Hz), SR(~50+Hz) + LR(1Hz)

When trying to get SR+LR Stream e.g. as

    Streams = MLDepthCamera.Stream.LongRange | MLDepthCamera.Stream.ShortRange,

than it leads to getting a runtime error:

    Error: MLDepthCameraConnect in the Magic Leap API failed. Reason: MLResult_InvalidParam 
    UnityEngine.XR.MagicLeap.MLResult:DidNativeCallSucceed(Code, String, Predicate`1, Boolean)

Which is not a suprise as the enum has no [Flags] attribute.

I Create the DepthCamera by teh next code:

    private bool CreateDepthCamera()
        uint longRange = (uint)MLDepthCamera.FrameType.LongRange;
        uint shortRange = (uint)MLDepthCamera.FrameType.ShortRange;
        MLDepthCamera.StreamConfig[] config = new MLDepthCamera.StreamConfig[Math.Max(longRange, shortRange) + 1];

        config[longRange].Flags = (uint)depthCamCaptureFlags;
        config[longRange].Exposure = 1600;
        config[longRange].FrameRateConfig = depthLongRangeFPS;

        config[shortRange].Flags = (uint)depthCamCaptureFlags;
        config[shortRange].Exposure = 375;
        config[shortRange].FrameRateConfig = depthShortRangeFPS;

        depthSettings = new MLDepthCamera.Settings()
            //Streams = MLDepthCamera.Stream.LongRange | MLDepthCamera.Stream.ShortRange,  // leads to: Failed to connect to depth camera: InvalidParam. Stream Enum is not defined as [Flags] !
            Streams = depthStream,
            StreamConfig = config


If I set only SR or LR, than I change the Setting by calling


then switching between ShortRange / LongRange and getting next depth frame takes more than 2700 ms.

My Question is: How can I successfully get a SR+LR (5Hz) and SR(~50+Hz) + LR(1Hz) as it is written in the documentation?

Hi @kocsisa,

Thank you for reaching out regarding this question. I have consulted our team and I will report back as soon as I learn more.



Hi @kocsisa,

Thank you for reaching out about this. This information on the forum is inaccurate and we will update it as soon as possible. Apologies.

We support the following: SR @ 5 Hz, SR @ 25/50 (50 Hz PLC), SR @ 30/60 Hz (60 Hz PLC), LR @ 1/5 Hz.

At this time, we do not support a mixed SR + LR mode.



Hi @etucker,

It really a bad news for us.

What about the switching time between SR/LR modes? Can we somehow reduce it from the actual 2700 ms?

What is your general use case for this? We would like to help you find a solution to keep you moving forward.



Thank you for sharing this with us.

We are creating a feedback ticket for this issue and hope to provide a workaround soon. Thank you for your patience.