How to understand permission issues when IMeetingRecordingController->StartRawRecording() fails

Meeting SDK Type and Version
Windows Meeting SDK 5.17.6

Description
*We experience random customer scenarios where video capture fails.
Our call to StartRawRecording fails with SDKERR_WRONG_USAGE.
Note that our calls to RequestLocalRecordingPrivilege() succeed and the customers tell us that they accept the request to record, but in these situations we don’t receive RequestLocalRecordingStatus or onRecordPrivilegeChanged events.

My assumption is there is some permission rule that is failing, but we don’t know what it is, so we just have unhappy customers.

Is there a way to debug this, to read the state of whatever is governing this so we can then execute the right steps to make this work?

Or do you have a detailed documentation of the all the rules so we can understand what can go wrong and how to look for each problem and address it?

We are capturing all the callback that seem to be relevant and logging them. Maybe we are missing something?

@todor ,

In your case, the wrong usage error might be due to calling the method from non-main thread.

Typically here’s the flow

  1. The settings should already allow local recording for the specific meeting.
  2. The SDK joins the meeting, and request for recording permission from host
  3. When there is a callback on the approval, call startrawrecording on the main thread. Do note that you cannot call both startrawrecording and startlocalrecording at the same time, they are mutually exclusive.
  4. Once startrawrecording is called, you can subscribe to user’s video.

Hey @todor this thread might answer your question: SDKERR_WRONG_USAGE using startRawRecording()

Alternatively, you can use Recall.ai. It’s a simple 3rd party API that lets you use meeting bots to get raw audio/video/metadata from meetings without you needing to spend months to build, scale and maintain these bots.

Let me know if you have any questions!

Hi @chunsiong.zoom ,

Thank you for your reply. I apologize, I’ve been out of town with IBC and am getting back to this now.

  1. The settings should already allow local recording for the specific meeting.

Which setting is this? Sorry, I open the settings for Local recording in Zoom, but none of them enable/disable recording. Where should I look? Or is this an API call?

When there is a callback on the approval, call startrawrecording on the main thread.

Yes, we calling it from the main thread for almost all cases except one. We do call it from the onRecordPrivilegeChanged() and onCloudRecordingStatus() callbacks. I’m pretty sure it has worked from the onRecordPrivilegeChanged callback.

Looking at the logs for the customer with the problem and I see it is calling it from onCloudRecordingStatus, so maybe that is the problem.

Here is the sequence:

  1. From the main thread, call StartRawRecording. It fails.
  2. Call RequestLocalRecordingPrivilege
  3. Then, onCloudRecordingStatus is called with a value 0 (Recording_Start).
  4. From the callback, we call StartRawRecording, which fails again.

So, I think there are two potential causes of the problem:

  • Maybe Cloud Recording is being turned on instead of off? Or, would a 0 value also indicate turning it off? We had told the customer to turn it off to make it work.
  • StartRawRecording is being called from the onCloudRecordingStatus callback. Should it be transferred to the main thread?

What is your advice?

Thanks,

Todor

@todor

Enable computer / local recording

  1. From the main thread, call StartRawRecording. It fails.
  2. Call RequestLocalRecordingPrivilege
  3. Then, onCloudRecordingStatus is called with a value 0 (Recording_Start).
  4. From the callback, we call StartRawRecording, which fails again.

Here’s the corrected sequence

  1. From the main thread, call StartRawRecording. It fails.
  2. Call RequestLocalRecordingPrivilege
  3. Then, onRequestLocalRecordingPrivilegeChanged, check if granted local recording rights
  4. From the callback, we call StartRawRecording,

You do not need cloud recording for startRawRecording.
You have to use onRequestLocalRecordingPrivilegeChanged callback

Hi @chunsiong.zoom ,

Thank you for the very fast reply.

I’ve added the code to check in onRequestLocalRecordingPrivilegeChanged. I didn’t have that before, so thank you. Now, if this comes in, it causes the recording to start on the main thread with a call to StartRawRecording().

However, looking at the customers failed logs and I see onRequestLocalRecordingPrivilegeChanged was never called (I log all callbacks.) So, this won’t help in that situation.

Also, I should add that the customer says this is working with vMix, so I believe their recording status is correctly set up at the start. But I will send them your instructions.

And yes, I understand that responding to onCloudRecordingStatus should not be necessary because we aren’t doing that, but I think I had it in there because at one point it seemed to help with another situation. However, we are definitely not setting up cloud recording.

Is there any way to find out with more detail what is happening? Any logging mechanism?

Thanks,

Todor

@todor ,

This event will only fire when the Meeting SDK is given recording permissions. The host will need to either

  • give permission when prompted to do so. this prompt is from the request for recording permission or
  • right click on the participant’s name and give the Meeting SDK local recording permission

However the above scenario will not work if local recording is turn off for the meeting.

Hi @chunsiong.zoom , yes, and the workflow you are describing has been working, and we call RequestLocalRecordingPrivilege() to get that cleared up.
But, that doesn’t fix it in this circumstance.
But, I think we have found the problem. We did some more testing with a customer and it looks like the problem is specifically a conflict with cloud recording. If cloud recording is enabled the request to do local recording fails. However, if the user turns off cloud recording, then our recording works. And then, the user can manually turn cloud recording back on and everything still works!
Note that we were indeed receiving onCloudRecordingStatus with a value
Recording_Start. So, now we know this is telling us why it is failing.
In response, I was thinking we could do the following:

  1. Call IMeetingRecordingController->StopCloudRecording()
  2. Wait for the onCloudRecordingStatus reponse with Recording_Stop
  3. Call StartRawRecording()
  4. If it succeeds, call IMeetingRecordingController->StartCloudRecording();

Does this sound right? Anything else we should do?

Thanks,

Todor

PS. I’ll let you know what happens…

Hi @chunsiong.zoom ,

I gave this a try and it didn’t work.

The call to IMeetingRecordingController->StopCloudRecording() returned
SDKERR_WRONG_USAGE.

This was called from within the onCloudRecordingStatus() event, where status was Recording_Start.

Is there something else I need to do first in order to have the right to make this call? What does SDKERR_WRONG_USAGE mean in this case?

Unfortunately, the documentation doesn’t provide any information.

Thanks,

Todor

@todor Meeting SDK follows the same rules as Zoom Client.

Only host can start and stop cloud recording
You have to start local recording before cloud recording.

Meeting SDK cannot stop cloud recording if it does not have host rights

@chunsiong.zoom , thank you.
Okay, so then what we need to do is:

  1. If cloud recording is enabled, check to see if we are a host.
  2. If yes, then automatically disable cloud recording.
  3. If no, then open a dialog telling the user to disable cloud recording.
  4. Once cloud recording is disabled, then start the recording.
  5. If we are the host, then start cloud recording again.

Does this sound right?

Thanks,

Todor