Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
Anonymous's avatar
Anonymous
8 years ago

[GearVR] Video only playing on first launch on some devices

I'm currently working on a GearVR experience which involves playing some video, and I'm having a problem with the playback on Note 4 and Note 5 devices, after uploading the app to Oculus Home.

I've been trying to play back the video with both the AVPro plugin from the asset store, as well as the media player in Google VR for Unity, both have the same problem.

The issue is that the video only plays back on the first launch of the app on these devices. That is, first time after install, and the first time after rebooting the device. On the next launches, the app seems to work fine otherwise, but no video is played.

It works as expected if I just build a launchable apk from Unity, then I can re-start it as many times as I want, but as soon as I upload it to Oculus Home as a preview (alpha/beta) app and start it from there, the video only works the first time, and only on Note 4 and 5 devices, on the S6 and S7 it works fine.

Because the device has to be connected to the HMD to start it from Oculus Home, I don't know of any way to debug the app, as adb for example needs a USB connection to the device, and it is already connected to the Gear VR.

Has anyone else had any similar problems? Or have an idea how to debug this?

I'm guessing the app doesn't clean up all it's resources somehow when it's terminated by Oculus Home, is there any way to make sure everything gets cleaned up?

5 Replies

Replies have been turned off for this discussion
  • vrdaveb's avatar
    vrdaveb
    Oculus Staff
    On Gear VR, there is a known issue where OnApplicationQuit() doesn't get called when you use the Universal Menu to quit and go to Home. However, the OnApplicationPause() does get called before the Universal Menu comes up. I would recommend moving any shutdown logic from OnApplicationQuit to OnApplicationPause.

    A little more background: this is happening because we call finish() on the app and Unity exits as quickly as possible without giving control back to scripts. It's similar to the behavior when an app gets killed from the background due to memory usage, so you need to handle it gracefully anyway.
  • Anonymous's avatar
    Anonymous
    Thanks for your reply, but we actually don't have any shutdown logic in OnApplicationQuit().

    We are currently using the GvrMoviePlayerTexture from GoogleVR, and it doesn't have any cleanup logic in OnApplicationQuit() either.

    As the same problem exists with two different video players, it looks to me like somehow the native android plugins aren't cleaned up, and I'm not aware of any way to do this manually.
  • vrdaveb's avatar
    vrdaveb
    Oculus Staff
    > Because the device has to be connected to the HMD to start it from Oculus Home, I don't know of any way to debug the app

    You can actually use adb over wifi or developer mode to run adb and Gear VR at the same time. If you want to launch Home in developer mode, open the "Gear VR Service" app and tap on "Oculus Home" in the list that comes up.

    as soon as I upload it to Oculus Home as a preview (alpha/beta) app and start it from there, the video only works the first time, and only on Note 4 and 5 devices

    The output of "adb logcat" would help us narrow this down. There is one known issue here - Home itself uses AVPro, which may conflict with the APIs you're using, but only if you're using high-resolution video. Does the issue still occur with a 2K or lower video?
  • Anonymous's avatar
    Anonymous
    You can actually use adb over wifi or developer mode to run adb and Gear VR at the same time.

    Thanks, this is helpful, I wasn't aware of that.

    Home itself uses AVPro, which may conflict with the APIs you're using

    We initially used AVPro ourselves, and had the exact same problem with that.

    Does the issue still occur with a 2K or lower video?

    We've just tested with a 2k x 2k video, which seems to play fine. The resulting video quality is a bit too low for our liking though.

    Do you have any information about what the maximum resolution we could use is? Is it dependent on bitrate?

    The output of "adb logcat" would help us narrow this down

    I'll get back to you with this when I get it, I'm not in possession of a Note 5 test device myself, so I have to wait a bit for this.
  • vrdaveb's avatar
    vrdaveb
    Oculus Staff
    Do you have any information about what the maximum resolution we could use is? Is it dependent on bitrate?

    Sorry, I have only seen reports of 2k (working) and 4k (not working). I'll put together a test case here and see what the options are.

    FYI, some changes to Home are coming in the next few weeks and they should address this.