-
Notifications
You must be signed in to change notification settings - Fork 142
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
Quest 2 Crashes on Selecting NDI Source - Unity 2022 Build #200
Comments
First of all, I don't have a Quest 2 device, so unfortunately, I can't investigate the issue on my side. I haven't had a firm idea, but I guess the issue is Unity version-specific because it runs on Unity 2020. How about updating the project to the latest version of Unity 2022.3? Unity 2022.3.4 is a bit too outdated. |
Thanks for the reply! At your suggestion, I tried making a build with Unity 2022.3.20f1, which seems to be the latest LTS version of 2022. We know that Vulkan works but we currently have a dependency on OpenGLES3 and we're unsure why OpenGLES3 works in 2020 but not 2022. |
How about changing the resolution of the video stream? I still don't have any idea about the issue, but I guess it's related to the memory alignment of something. I wonder if it works with "compute friendly" dimensions like 256x256 or 1024x1024. |
Good suggestion! For NDI source, I've also been testing using the Test Patterns from the official NDI Tools Launcher via Windows. Everything - test patterns, videos from VLC, etc - works fine from Unity 2020. |
How about disabling the compute shaders? You can disable them by commenting out the kernel functions in https://github.com/keijiro/KlakNDI/blob/main/jp.keijiro.klak.ndi/Runtime/Resource/Decoder.compute You should comment out only the body of the kernel functions -- You shouldn't comment out the function declarations. |
I commented out the body of the following functions: I made an Android build and attempted to receive 1) NDI Test Pattern and 2) VLC video. The performance did not get majorly impacted when I selected a source. Did I comment out too much? (I'm not too knowledgeable of shaders.) |
Thanks for testing it.
That's the intended behavior. I just wanted to check if the compute shader is relevant. You turned it off, and the crash disappeared. It indicates that the crash happens in the compute shader or how GLES3 handles it. |
How about adding alpha channels to the sending frames? It's relevant because there are two versions of compute shaders (UYVY - without alpha, UYVA - with alpha) You should revert commenting-out before testing it. |
Hey @keijiro , I'm happy to try that out but not 100% sure what you mean. Or should I try streaming something that has alpha? |
Just turning on/off the "Keep Alpha" switch on the sender component is enough for testing it. |
Got it. When I select a source with the Keep Alpha bool set to true, the same issue occurs. I will try to capture the issue without revealing any of the protected images in our app. |
NDICanvasQuest2.mp4Here's a video of what happens when I select a source. I tried to capture the screen-tearing that I see in the headset, but it seems every way I try to capture video, the Quest just stops processing when the NDI source is selected. |
By the way, I wonder if GLES3 on Quest supports unordered access views (UAV), which is vital for the compute shaders. Could you check if SystemInfo.SupportsRandomWriteOnRenderTextureFormat returns true on the device? |
Thanks for the clarification. So it satisfies the requirement. |
Do you have any other suggestions for things to try? Anything else you'd like me to Log? |
Those kinds of driver-level issues are quite hard to investigate without an actual device. Sadly, logging can’t help a lot. |
I updated this package (2.1.1). While this update is not directly related to this issue, it may potentially affects it. Could you give it a try? PR191 and PR186 are no longer needed. |
I'll give it a try, thanks for the update. |
When I select an NDI source, I'm running into a NullReferenceException in FormatConverter. Something's returning null there, presumably _resources. I have another task to focus on but when I get time I'll get back to this and try to debug it. |
I managed to pass _resources in before the Decoding. It works in Editor. |
Hey, we have a simliar (or same) issue.
I'm still not sure why :/ |
@pfcDorn Sorry but that's off topic. This issue reproduces only on Quest devices with OpenGL ES3. |
So...another test: |
sorry, but my guess was its releated. Because on the quest this issue starts earlier (lower memory capacity). We first observed this issues on our quest build... thats the reason :D |
@eeease I reproduced the issue on Quest Pro. The root cause is still unknown, but I found a workaround for it. Please try it with the following steps:
It changes the receiver texture format to RGBAHalf. It increases the memory requirement and bandwidth usage, so it's not an ideal solution, but I couldn't find other solutions. FYI, I used the following project for testing. Now it works properly on Quest Pro. I haven't checked with Quest 2 because I don't have a device. |
Thank you! I was in the midst of wrapping up another project but I'll try this out as soon as possible and report back. |
Upon selecting an NDI source on Quest 2, the system crashes instead of rendering the source.
This was tested with many different variables, the constant one being Unity version:
Notes:
Logcat logs from when I select an NDI source:
Any suggestions or help would be greatly appreciated. We want to update our project to Unity 2022, but we need NDI streaming to work on Quest 2 builds.
Thanks in advance!
The text was updated successfully, but these errors were encountered: