cancel
Showing results for 
Search instead for 
Did you mean: 

Avatar pose packet serialization using PUN 2 on Go/Gear?

cloud_canvas
Expert Protege
Hi there,

I'm putting out a feeler here just to see if anyone has had any luck with sending Avatar pose packets using PUN 2 specifically when working with the Go. I've been trying to get this to work using their provided instructions and based on what I've found I think the issue is specifically with sending the poses between mobile devices. Any time I create a PUN room between a PC and a mobile device there are no issues, but specifically when a Go creates a room and another Go tries to join it, the second Go crashes. Logcat gives me this in the crash log:

11-16 17:15:04.959  4265  4298 V [Avatar SDK]-EntryPoints: ovrAvatarPacket_Read was called before ovrAvatar_InitializeAndroid()!

I tried to put a check for `Oculus.Platform.Core.IsInitialized()` before deserialization and that doesn't seem to be preventing the crash.
I'm considering switching to the native Oculus-based approach for social and avatar networking and P2P but the documentation is even more scant there than it is with Photon.

Samsung Galaxy S8 (Snapdragon 835), Gear VR (2017), Oculus Go (64GB), Unity 2018.3.14f1
16 REPLIES 16

cloud_canvas
Expert Protege
EDIT: The fix I suggested here is incorrect. Ignore this post.
Samsung Galaxy S8 (Snapdragon 835), Gear VR (2017), Oculus Go (64GB), Unity 2018.3.14f1

treeviewstudios
Protege
hi @cloud_canvas
I am currently working with Photon PUN 2 and Oculus Avatar SDK, we arent many developers doing this combo, so if you want to keep in touch and work together we could communicate by email or hangouts group with other devs, maybe create a Slack so we can share tips and code.

I managed to make this work for Mixed Reality, Oculus and Vive, now im testing on the Oculus GO.

If anyone needs help : photonpununofficial.slack.com

Ross_Beef
Heroic Explorer
Hey folks, 

This is certainly an area i’d love to better understand where we can do more to help you out.

Feel free to ping me with feature requests that would unblock you, or list them here, and we’ll figure out how they factor into our roadmap going forward.

Likewise, if there’s specific documentation that would help unblock, please do let me know.

cloud_canvas
Expert Protege
@treeviewstudios I'd love that, thanks. Can you send an invite to nick@stage.co?

@Ross_Beef My notes about a fix for my issue has not resolved it. I'm not sure if my problem lies with Photon or the Oculus Avatar SDK. I basically have a dice roll chance on being able to connect my client to my room owner without a crash with my boolean check for Platform.Core.IsInitialized() that returns out of my deserialization function if it's not ready.
It works properly with just Oculus P2P but not when put through PUN. Is it because P2P is properly waiting to send packets to other clients until the Avatar has finished loading in or something? (referring to the period where the avatar is glowing and its textures have not yet loaded in)
Samsung Galaxy S8 (Snapdragon 835), Gear VR (2017), Oculus Go (64GB), Unity 2018.3.14f1

cloud_canvas
Expert Protege
@Ross_Beef I realize I'm checking if the Platform Core is initialized, but not the Avatar itself. The CAPI class for Oculus.Avatar doesn't seem to contain an equivalent IsInitialized() bool. What should I be checking for here?
Samsung Galaxy S8 (Snapdragon 835), Gear VR (2017), Oculus Go (64GB), Unity 2018.3.14f1

cloud_canvas
Expert Protege
@Ross_Beef I modified OvrAvatarSDKManager.cs to include a little public bool for IsInitialized that just sets itself to true at the end of that class' Initialize() method. Oculus.Avatar.CAPI.ovrAvatar_Initialize (and ovrAvatar_InitializeAndroidUnity) are rather low level and are asynchronous calls that go directly to the dlls. So I know this is dirty and not the right way to do it, not to mention I'd have to maintain this through subsequent Oculus Utilities updates.
So, in summary, I think Oculus.Avatar.CAPI needs to be extended to feature an IsInitialized() member just like Oculus.Platform.Core does which gets set by a callback from either Oculus.Avatar.CAPI.ovrAvatar_Initialize or Oculus.Avatar.CAPI.ovrAvatar_InitializeAndroidUnity.
Samsung Galaxy S8 (Snapdragon 835), Gear VR (2017), Oculus Go (64GB), Unity 2018.3.14f1

treeviewstudios
Protege
@cloud_canvas looks like there was another unofficial pun discord, you should log here https://discord.gg/DW2tuB

cloud_canvas
Expert Protege
@treeviewstudios thanks for the tip, I hopped onto that one.
Samsung Galaxy S8 (Snapdragon 835), Gear VR (2017), Oculus Go (64GB), Unity 2018.3.14f1

cloud_canvas
Expert Protege
Hey @Ross_Beef (and @treeviewstudios if you're interested) I think I have a functional solution to this problem now. See my post on the Photon developer forums about this.

From the standpoint of Oculus internal development, we really need a safe, abstracted way to ask whether or not an Oculus Avatar has fully loaded in, similarly to how you can perform a high-level check in Oculus.Platform.Core for IsInitialized(). My forum post has a recommended hack in OvrAvatar.cs itself but we really shouldn't be modifying any core scripts in any Oculus packages, not the least of which because it becomes an upgrade dependency.

So consider this a feature request, I guess?
Samsung Galaxy S8 (Snapdragon 835), Gear VR (2017), Oculus Go (64GB), Unity 2018.3.14f1