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 may be revoked at the discretion of Oculus staff.

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

cloud_canvascloud_canvas Posts: 47
Brain Burst
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.11f1

Comments

  • cloud_canvascloud_canvas Posts: 47
    Brain Burst
    edited December 2018
    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.11f1
  • treeviewstudiostreeviewstudios Posts: 38
    Brain Burst
    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: 159 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: 47
    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 (64GB), Unity 2018.3.11f1
  • cloud_canvascloud_canvas Posts: 47
    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 (64GB), Unity 2018.3.11f1
  • cloud_canvascloud_canvas Posts: 47
    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 (64GB), Unity 2018.3.11f1
  • treeviewstudiostreeviewstudios Posts: 38
    Brain Burst
    @cloud_canvas looks like there was another unofficial pun discord, you should log here https://discord.gg/DW2tuB
  • cloud_canvascloud_canvas Posts: 47
    Brain Burst
    @treeviewstudios thanks for the tip, I hopped onto that one.
    Samsung Galaxy S8 (Snapdragon 835), Gear VR (2017), Oculus Go (64GB), Unity 2018.3.11f1
  • cloud_canvascloud_canvas Posts: 47
    Brain Burst
    edited December 2018
    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.11f1
  • alexis.delforgesalexis.delforges Posts: 2
    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 ?

  • treeviewstudiostreeviewstudios Posts: 38
    Brain Burst
    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 ?

    @alexis.delforges Hi, i forgot about this, 
    im TreeLion in https://discordapp.com/invite/uxaRmVq

    thats the right link
  • cloud_canvascloud_canvas Posts: 47
    Brain Burst
    small update, Photon have actually updated their documentation on serializing Oculus Avatars to include my hotfix.
    Samsung Galaxy S8 (Snapdragon 835), Gear VR (2017), Oculus Go (64GB), Unity 2018.3.11f1
  • NyanBladeNyanBlade Posts: 14
    NerveGear
    edited February 15
    Hey guys, I am also trying to do the same thing. Do you have a new link for the Discord group?

    @treeviewstudios @cloud_canvas
  • cloud_canvascloud_canvas Posts: 47
    Brain Burst
    @NyanBlade
    https://discord.gg/dtqh2vS
    That link shouldn't expire.
    Samsung Galaxy S8 (Snapdragon 835), Gear VR (2017), Oculus Go (64GB), Unity 2018.3.11f1
  • cloud_canvascloud_canvas Posts: 47
    Brain Burst
    to all who find this in the future, the above Discord got merged into a larger one. All Photon-related stuff is in its own channels in the sidebar. Here's the invite link that got posted with the migration: https://discord.gg/XVGXRzq
    Samsung Galaxy S8 (Snapdragon 835), Gear VR (2017), Oculus Go (64GB), Unity 2018.3.11f1
Sign In or Register to comment.