Invalid param to Connect Camera

MLSDK version: 0.53.2

Following the CameraCapture example to use the camera. The example works. However, the test app doesn't because the connection wasn't successful. I keep getting "MLCamera.Connect failed connecting to the camera. Reason: InvalidParam".

The Android permission prompt was shown and was accepted upon running the test app.

The code is pretty much the same as the example:

        MLCamera.ConnectContext context = MLCamera.ConnectContext.Create();
        context.Flags = MRConnectFlag;
        context.EnableVideoStabilization = true;

        if (context.Flags != MLCamera.ConnectFlag.CamOnly)
        {
            context.MixedRealityConnectInfo = MLCamera.MRConnectInfo.Create();
            context.MixedRealityConnectInfo.MRQuality = MRQuality;
            context.MixedRealityConnectInfo.MRBlendType = MLCamera.MRBlendType.Additive;
            context.MixedRealityConnectInfo.FrameRate = FrameRate;
        }

        captureCamera = MLCamera.CreateAndConnect(context);

Where the inputs are set from Inspector
MRQuality = 960x720
FrameRate = 30fps
MRConnectFlag = MR

I don't see why the parameters are invalid.

1 Like

Hi Rick,

Can you try waiting for the camera to be ready before trying to connect?

MLResult result =
                    MLCamera.GetDeviceAvailabilityStatus(MLCamera.Identifier.Main, out cameraDeviceAvailable);
                if (!(result.IsOk && cameraDeviceAvailable))
                {
                    // Wait until camera device is available
                    yield return new WaitForSeconds(1.0f);
                }

// Then continue to connect to camera
1 Like

Hi Kat,

Yes, the code is the same. A little above the call, I had this:

Outlook-mwuylymi.png

2 Likes

Hi Rick,

It appears that this is a known bug that the Unity SDK team is working on resolving. It will hopefully be patched with the next release.

1 Like

Hi Kat,

Do you know when the update will be released?

Outlook-mwuylymi.png

1 Like

We're currently hoping for mid-September, but the timelines are fluid at the moment.

1 Like
1 Like

Do you know if this has been resolved? I'm seeing these errors in 0.53.3.
I need mixed-reality capture, but haven't had any luck with it.

Andrew

1 Like

did you get your issue resolved? I'm having a similar, if not the same, issue.

1 Like

I just followed the Unity examples and it seems to work.

1 Like

when I try using MR, I just see a frozen frame on the local renderer and no video in the web client. Video from the web client is there. CamOnly has been the only one I've seen work.

Which version of the examples did you try? was there a particular example you used? I've been working with the WebRTC example. MR capture is what I need to stream.

this could be a little off-topic for this post, but I've been looking at everything. Have seen invalid params messages, but may not be from the same function call

1 Like

My issue sounds to be more related to Unity. hadn't considered it might require using multiple camera GameObjects.

1 Like