Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IL2CPP support #9

Open
FernandoMonroy opened this issue Nov 27, 2019 · 5 comments
Open

IL2CPP support #9

FernandoMonroy opened this issue Nov 27, 2019 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@FernandoMonroy
Copy link

Does Azure support IL2CPP?

@keijiro keijiro self-assigned this Nov 28, 2019
@keijiro keijiro added the question Further information is requested label Nov 28, 2019
@keijiro
Copy link
Owner

keijiro commented Nov 28, 2019

Azure? Did you mean Azure Kinect? (Azure is Microsoft's brand name for their cloud computing solutions)

Anyway, this project should support IL2CPP. Please report if you find any issue with IL2CPP.

@keijiro
Copy link
Owner

keijiro commented Nov 28, 2019

I'm closing this issue now. Please feel free to reopen for further problems.

@keijiro keijiro closed this as completed Nov 28, 2019
@FernandoMonroy
Copy link
Author

Sure Azure Kinect, sorry for the misleading.

I encounter problems with Intel real sense (using or not the Rsvfx repo) and old Kinect with unity compiling for IL2CPP. The compilations were successful but devices didn´t connect so I see no output of any kind (color or depth); Mono was the only way to run the devices. Is this the case of Azure Kinect? Does Azure Kinect connect properly using the IL2CPP scripting backend?

Don't have an Azure Kinect right now, but I´m considering buying one.

It´ll be super helpful if you could give me some feedback about it.

Thanks for your time.

@keijiro keijiro reopened this Nov 29, 2019
@keijiro
Copy link
Owner

keijiro commented Nov 29, 2019

Thank you for the additional information. I confirmed that the issue reproduces with IL2CPP. You can see the following error message when building with the development build option.

NotSupportedException: To marshal a managed method, please add an attribute named 'MonoPInvokeCallback' to the method definition. The method we're attempting to marshal is: Microsoft.Azure.Kinect.Sensor.Logger::OnDebugMessage
  at Microsoft.Azure.Kinect.Sensor.NativeMethods.k4a_set_debug_message_handler (Microsoft.Azure.Kinect.Sensor.NativeMethods+k4a_logging_message_cb_t message_cb, System.IntPtr message_cb_context, Microsoft.Azure.Kinect.Sensor.LogLevel min_level) [0x00000] in <00000000000000000000000000000000>:0 
  at Microsoft.Azure.Kinect.Sensor.Logger.Initialize () [0x00000] in <00000000000000000000000000000000>:0 
  at Microsoft.Azure.Kinect.Sensor.Logger.add_LogMessage (System.Action`1[T] value) [0x00000] in <00000000000000000000000000000000>:0 
  at Microsoft.Azure.Kinect.Sensor.AzureKinectOpenDeviceException.ThrowIfNotSuccess[T] (System.Func`1[TResult] function) [0x00000] in <00000000000000000000000000000000>:0 
  at Microsoft.Azure.Kinect.Sensor.Device.Open (System.Int32 index) [0x00000] in <00000000000000000000000000000000>:0 
  at Akvfx.ThreadedDriver.CaptureThread () [0x00000] in <00000000000000000000000000000000>:0 
  at UnityEngine.Application+LowMemoryCallback.Invoke () [0x00000] in <00000000000000000000000000000000>:0 
  at System.Threading.ParameterizedThreadStart.Invoke (System.Object obj) [0x00000] in <00000000000000000000000000000000>:0 
  at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <00000000000000000000000000000000>:0 
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) [0x00000] in <00000000000000000000000000000000>:0 
  at UnityEngine.Application+LowMemoryCallback.Invoke () [0x00000] in <00000000000000000000000000000000>:0 
UnityEngine.Logger:LogException(Exception, Object)
UnityEngine.Debug:LogException(Exception)
System.Xml.Schema.ValidationEventHandler:Invoke(Object, ValidationEventArgs)

I found the same issue in discord-rpc:

discord/discord-rpc#186

As noted in this page, the issue may be easily solved by adding the MonoPInvokeCallback attribute to Microsoft.Azure.Kinect.Sensor.Logger::OnDebugMessage. However, it's in the Azure Kinect SDK code, so we have to send a pull request and get reviewed by Microsoft to apply the fix. That's a little bit, uh, troublesome.

At the moment, please understand that this project doesn't support IL2CPP. If you're motivated to solve the issue for some reason, please try the solution above.

@keijiro keijiro added enhancement New feature or request and removed question Further information is requested labels Nov 29, 2019
@FernandoMonroy
Copy link
Author

Sorry for the late reply. Thank you very much for your feedback, I'll dig out into the subject

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants