-
Notifications
You must be signed in to change notification settings - Fork 139
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
Update AndroidHelper.cs for new Unity API #186
Conversation
Set multicast lock without calling deprecated/removed Unity APIs
I was trying this pull request with Unity Version 2022.3.2f1 with keijiro's example Test scene, but I was not able to send any sources from his Test scene. The dropdown menu from Test scene did not populate with any of his sender sources, so I was not able to receive any of those sources. There were no errors on However, the startup in Unity 2022.3.2f1 for the sample scene was a little slow for 5 seconds. On Unity Version 2021 with the same files did work, so there's something that I'm missing for Unity 2022.3.2f1 Do you have any advice? |
The Adb Logcat logs for the above were just:
The Dropdown menu had no sources available when I clicked on the Dropdown. |
Have you added the multicast permission to your android manifest? This becomes necessary due to this no longer being part of the Unity API, so they don't automatically add it them self. I can confirm this working for Unity 2022.3.3f1. But I have to admit, I did not test it with the example test scene due to the project I wrote this quick fix for being an VR Project targeted for the Vive XR Elite platform and I only tested it working there. |
Thanks for the message update and help, Hextaku! Yes, I also added the Custom Main Manifest in Unity's PublishingSettings. With the permission in my manifest with the "CHANGE_WIFI_MULTICAST_STATE" section. I'm going to see if maybe, I'll just try to add all the permissions available on the APK or something or more permissions. Maybe, I'm missing something. I'm currently using a Samsung S21 5G to test kejiro's Test scene in Unity 2022.3.2f1. |
I tried turning on every Internet permission and explicitly requesting them with Unity Runtime Permissions, and trying to create a minimalist custom scene and turning on the sender and receiver later in the scene runtime, but it looks like I'm stuck, trying to make NDI work for Unity 2022.3.3f1 on a Samsung S21 5G Android phone. Unity 2021 LTS seems to always work. Taking a look at the Unity versions in Development Build mode with a custom scene, just sending an Alpha Texture: Unity 2021Looking at the profiler for Unity 2021. In the app, I can select the source, and the Unity 2022.3.3f1On Unity 2022.3.3f1, it seems like Weird thingI notice that once I enable any On Unity 2021, no app freeze occurs when turning on or enabling a |
Unity 2022.3.3f1 Test FailingThe Android Manifest permissions:
Scene TestA simple scene where it:
|
Samsung S21 5G Unity 2022.3.3f1Screen_Recording_20230718_030316_KlakNDI.URP.mp4When the coroutine turns on the No Unity errors though. Unity 2021.3.10f1Screen_Recording_20230718_030355_KlakNDI.URP.2.mp4On |
Hey @Hextaku! I figured out a problem on my side! You're right it does work! I tried on a different Samsung 21 Ultra 5G Android phone. There's something weird going on with my personal Samsung S21 5G Phone. For some reason, that personal phone doesn't work, but if I use a different phone, your change worked. I thought that maybe, I have some weird network settings that is preventing the sender. |
A note: After testing on Magic Leap 2, there is 1 more thing that Unity 2022 LTS users probably have to install, which is the I think that when I tried on Magic Leap 2 without this package, things did not work, but I am not 100% sure to be honest. |
Also in this pull request, we might want to write down somewhere that the user probably also has to add this permission explicitly into their
I think that this is the only must-have permission, but I am not 100% sure to be honest. |
@keijiro would be cool if this could be merged + the readme updated with the new required Android permission. Currently KlakNDI doesn't build on 2022 LTS and 2023 on the Android build target. Thanks! |
I can confirm this works on Steps:
(For future users, building must be done through Unity's standard "Build Settings > Build" option, not through Oculus' OVR build tools. I got a "missing *.dll" exception for the latter) |
@bvk0 Did you do anything else to send NDI? Cause it does help with the build error I had, but it seems that I don't send any NDI from my Quest 3 now. (Running 2022.3.10, changed AndroidHelper.cs, and added the line to the Mainifest) |
No, I did nothing else. However, you seem to stream NDI from quest outwards (I only streamed from PC to quest), and you seem to use a Quest 3 (I used a Quest 2). |
Whelp. Then that wont work for me 😭 I'll give up for now, hopefully Android build support for receiving is fixed and issue #167 will no longer be a thing haha. Thanks for your quick response tho! |
@huyqle3 have you ever be able to track down, why your personal phone wasn't working? Applied all changes, but my Pixel 8 Pro refuses to receive the NDI data sent by my notebook, while being on the same 5G Wifi as my notebook. The quad where the stream should be shown remains blank... On my notebook and with a windows build, everything is working as expected. I'm using Unity 2022.3.15. I'm on Android 14, maybe that is an issue? br, |
@FireDragonGameStudio I did, I made a silly mistake. I forgot to install the NDI SDK 😅 maybe you have the same problem. |
@daangijzen Ah ok, the docs stated, that there is no need to install the NDI SDK Oo |
@FireDragonGameStudio That may be true, but the Kejiro’s page for this plugin does state that it might be useful 😉 |
@daangijzen sry, I'm confused Oo even after the SDK install, my Android phone is neither found as sender nor can I receive smth on my lokal Wifi. Are there any extra steps, like linking to the SDK path or something? sry for all those dumb questions :/ |
I just realised that there is a PR for Android lvl >= 31. That may be the issue here! |
Hmmm… I do not know that. 🤔 maybe someone else knows? |
@FireDragonGameStudio To respond to this thread very late, no, I never knew why KlakNDI would not work on my personal Android phone device. It's a Samsung S21 5G, so it's not that old. Maybe, I have specific wifi or network settings on that phone that made it not compatible with KlakNDI. |
This issue was resolved in the latest version (2.1.1). |
Set multicast lock without calling deprecated/removed Unity APIs
This should resolve #167