I recently bought the vlc for unity (Android) in the unity assets store.
I'm trying to run a VR program on my Oculus Quest device.
Firstly I only compiled the minimum playback demo and it was working fine with no error on my Android phone.
But when it came to Oculus Quest, the video was playing with no video frame and the logcat showed there was a problem with EGL initialization:
E/libEGL: eglGetFrameTimestampSupportedANDROIDImpl:2604 error 300d (EGL_BAD_SURFACE)E/VLC: [0000007e10462c00/3b03] libvlc video output: video output display creation failedE/libEGL: eglMakeCurrentImpl:1084 error 3009 (EGL_BAD_MATCH)
I'm pretty new to gles and vlc. What can I do to play my videos on the Quest devices? Do I have to modify the native plugin?
Minimal project and steps to reproduce
Import packages from assets store.
Oculus Integration
VLC for Android
Modify the unity project settings:
Target Architecture: ARM64
Script Backend: IL2CPP
Api Compatibility Level: .NET 4.X
Modify the XR Plugin Management Settings:
Stereo Rendering Mode: Multiview
Enable Low Overhead Mode (GLES)
Add the VLC Minimal Playback Scene to the compile list.
Compile, install and run APK on Quest 1.
Wear the Quest device and see no image on the screen.
Run adb logcat command and get the error.
What is the current bug behavior?
There is no video frame on the screen, but the audio track is still playing.
What is the expected correct behavior?
There should be video frame on the screen while playing.
Does it work on other plaforms? Does it work with the official VLC apps?
Yes, it works fine on my android phone.
Relevant logs and/or screenshots
Please see the response below, sorry.
Environment
OS: Android
Version: 10 (API 29)
Device: Oculus Quest 1
LibVLC version and architecture: 4.0.0-dev-20419-g490c04ad03
LibVLCSharp version: 4.0.0.0
VLC Unity plugin version: 0.1.6
Scripting backend used: IL2CPP
Target Architecture: arm64-v8a
Possible fixes
Edited
Designs
Child items
...
Linked items
0
Link issues together to show that they're related.
Learn more.
By the way, I heard that the OVRPlugin may contain the ability to create EGL context and external oes texture. I wonder if it's necessary to change the way I create the texture.
Your initial logs contained E/VLC: [0000007e10462c00/3b03] libvlc video output: video output display creation failed but I can't see it in your latest logs. It may reveal something useful if we can see the logs around this.
Update: I've read the issue but cannot say too much to help. Actually, I tried to init LibVLC and create MediaPlayer in the Update() function and this change made the app crash.
Update: I've read the issue but cannot say too much to help. Actually, I tried to init LibVLC and create MediaPlayer in the Update() function and this change made the app crash.
you don't want to do this as it would create hundreds of instances in a very fast loop.
do I have to post the logs of my own app?
I don't think so. Now the next steps would be debugging the native plugin code and see where/why it fails. I cannot do this right now as I don't have a quest device. Will see if I can get one in the near future. Which version of the quest do you have?
you don't want to do this as it would create hundreds of instances in a very fast loop.
I wrote a simple if-else case to check the null pointer, it would prevent creating multiple instances.
In fact, I was trying to implement my own plugin using libvlcjni + gles aar plugin but didn't succeed. The demo I wrote with libvlcjni was creating the instance and textures in the first Update() call and it worked normally.
Which version of the quest do you have?
Honestly, I have both Quest1 and Quest2. I used to test and debug daily with Quest1 and I also installed the minimal playback demo on my Quest1.
Since the demo is not working on the 1st generation device, I may not have to test further with another Quest2.
My old solution was the EasyMovieTexture plugin with the Ijkplayer backend. It includes a native plugin called libBlueDoveRenderer.so to handle the GLES things but it's a black box with no source code.
Now I'm looking for a new solution that can work fine in the VR environment and can be more customizable. I saw someone using libmpv on the Quest devices but sadly I cannot describe the detail.
I understand your situation. However, to be able to fix your issue with vlc unity, code needs to be debugged. There is likely no quick fix or checkbox to tick that will make this go away, sadly.
@mfkl Good day sir. Any idea about this problem?
I suggest that maybe I can lend you a Quest device. Will this be a good approach?
I wonder if you are willing to share an address via email or other private ways to buy or lend you the Quest device.
Not yet, as I said, without a device to debug I can't help. I'll order a Quest device today as we probably going to need one for the long term, but thanks for the offer!
Just received, and setup the quest 2. Imported the 0.1.6 Android asset and started the demo scene with internet access required. That runs on armv7 by default. Running smoothly here.
So that's why I always ask for actual code when someone opens an issue. Otherwise I cannot have the same reproducible code than you and this happens. Please provide the full scene, code and unity configuration next time. Otherwise I'll just close the issue without checking it out (as stated in the issue template).
after disabling Low Overhead Mode, it seems working fine on the Quest. May I ask why?
That would be a question for Unity, I guess. I don't know, this is a black box and the few explanations I found are not very descriptive. I don't know why this would fail with our plugin, but will take a look next week. At least now you have something working...
Low Overhead Mode - If enabled, the GLES graphics driver will bypass validation code, potentially running faster. Disable this if you experience graphics instabilities. GLES only.