Welcome to the Oculus Developer Forums!

Your participation on the forum is subject to the Oculus Code of Conduct.

In general, please be respectful and kind. If you violate the Oculus Code of Conduct, your access to the developer forums will be revoked at the discretion of Oculus staff.
New to the forums? Click here to read the How To guide. -- Developers click here.

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

cloud_canvascloud_canvas Posts: 28
Brain Burst
edited November 16 in Avatars SDK Development
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, Unity 2018.2.6f1

Comments

  • cloud_canvascloud_canvas Posts: 28
    Brain Burst
    edited December 13
    EDIT: The fix I suggested here is incorrect. Ignore this post.
    Samsung Galaxy S8 (Snapdragon 835), Gear VR (2017), Oculus Go, Unity 2018.2.6f1
  • treeviewstudiostreeviewstudios Posts: 12
    NerveGear
    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_BeefRoss_Beef Posts: 139 Oculus Staff
    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_canvascloud_canvas Posts: 28
    Brain Burst
    @treeviewstudios I'd love that, thanks. Can you send an invite to [email protected]?

    @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, Unity 2018.2.6f1
  • cloud_canvascloud_canvas Posts: 28
    Brain Burst
    @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, Unity 2018.2.6f1
  • cloud_canvascloud_canvas Posts: 28
    Brain Burst
    @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, Unity 2018.2.6f1
  • treeviewstudiostreeviewstudios Posts: 12
    NerveGear
    @cloud_canvas looks like there was another unofficial pun discord, you should log here https://discord.gg/DW2tuB
  • cloud_canvascloud_canvas Posts: 28
    Brain Burst
    @treeviewstudios thanks for the tip, I hopped onto that one.
    Samsung Galaxy S8 (Snapdragon 835), Gear VR (2017), Oculus Go, Unity 2018.2.6f1
  • cloud_canvascloud_canvas Posts: 28
    Brain Burst
    edited December 13
    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, Unity 2018.2.6f1
  • alexis.delforgesalexis.delforges Posts: 1
    NerveGear
    Hi @cloud_canvas, @treeviewstudios

    We're doing the same combo PUN-Avatar SDK, working on serialize/deserialize avatar customisations for cross-platforms.
    I tried to come to your slack and discord, but none of them work, any updates on a social group for this combo to discuss ?

Sign In or Register to comment.