Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aframe 0.9.2 crash #1296

Open
extraymond opened this issue Jul 8, 2019 · 10 comments
Open

Aframe 0.9.2 crash #1296

extraymond opened this issue Jul 8, 2019 · 10 comments
Labels
bug Something isn't working

Comments

@extraymond
Copy link

Describe the bug

Aframe app won't load starting from version 0.9.2.

Error log

Error: Compositor error: VRCompositorError_TextureUsesUnsupportedFormat                                                                                                                                    [608/5809]
    at _submitFrame (/media/user/storages/git/exokit/src/index.js:1219:42)
    at Immediate._topRenderLoop (/media/extraymond/storages/git/exokit/src/index.js:1314:11)    

Downgrading to 0.9.0 works

To Reproduce
Build demo app with aframe 0.9.2

System information:

  • OS: Ubuntu 18.04

  • Exokit Version mater branch

  • Node version v11.15.0

@avaer
Copy link
Member

avaer commented Jul 8, 2019

What is the GPU in this repro?

@extraymond
Copy link
Author

RX 480 with steamvr+padoka ppa: ppa

@avaer
Copy link
Member

avaer commented Jul 8, 2019

Thanks, I suspect that's the issue. Do you know what texture formats StreamVR supports with this driver setup?

@extraymond
Copy link
Author

I'm not sure where to find that info, I will try it later.

Having tested both 0.9.0 0.9.1 0.9.2, this issue is started after 0.9.1, is there any way I can find the corresponding code path in aframe that caused this behavior?

I think it would be easier to bisect from their change logs.

Change log from 0.9.1 release

Things that seems to relate to texture or introduce major breakage would be:

  1. Use a fork of anime.js that has memory improvements from Kevin (#4028).
  2. Detaching entity from scene will preserve component data. Add
    Entity.destroy() method to clear components and return their memory to the
    pool (#4121).

@avaer
Copy link
Member

avaer commented Jul 8, 2019

Is there a reproduction case, or is this happening with anything that uses A-Frame?

It could be that some texture gets destroyed prematurely, or a resize at the wrong time messes up the framebuffer.

I would actually start with logging what's coming into the submit frame call -- Is it the first submit that fails? Or is something changing on VR entry, or a subsequent frame? Does this also happen in 2D mode (-x none)?

@extraymond
Copy link
Author

Ah! I forget to add that, the app loads into 2D(app window), but would never go into VR. It's not crashing the whole thing, just not going into VR as it should. It might be something to do with what you said VR entry.

I tried the Hello world setup from aframe, still not working, it's safe to say that since such simple setup caught the bug, more complex scenes would be affected too.

<a-sphere position="0 1.25 -5" radius="1.25" color="#EF2D5E"></a-sphere>

Blank scene with single entity not working either.

@avaer avaer added the bug Something isn't working label Jul 8, 2019
@avaer
Copy link
Member

avaer commented Jul 22, 2019

@extraymond Does -x webvr enter VR for your case?

@extraymond
Copy link
Author

Sorry for the delay. Unfortunately adding -x webvr isn't working either.

@avaer
Copy link
Member

avaer commented Aug 19, 2019

At that point I would look into A-Frame and see why it isn't attempting to start the VR render loop.

@extraymond
Copy link
Author

extraymond commented Sep 6, 2019

Hi! After Some testing, here's some additional info that might help.
Version prior to 0.9.1 get this crash when trying to pre-load images in a-assets, it goes crashing without any external resources starting from 0.9.1.

Since in aframe, a-asstes are loaded via XHR request instead of fetch api, that might be a reason that caused this error.

If I preload assets using fetch api, and attach them to entities, the program works.

Another thing I noticed, is that comparing between -x none and -x webvr, when loading assets via fetch-api, webvr mode works while none mode will unable to load texture:

THREE.WebGLState: Error: WebGLRenderingContext::TexImage2D: invalid texture argument
    at Object.A [as texImage2D] (https://aframe.io/releases/0.9.0/aframe.min.js:98:26256)
    at M (https://aframe.io/releases/0.9.0/aframe.min.js:99:3348)
    at we.y [as setTexture2D] (https://aframe.io/releases/0.9.0/aframe.min.js:98:30577)
    at Re.setTexture2D (https://aframe.io/releases/0.9.0/aframe.min.js:100:9212)
    at Ft._t [as setValue] (https://aframe.io/releases/0.9.0/aframe.min.js:97:23927)
    at Function.Wt.upload (https://aframe.io/releases/0.9.0/aframe.min.js:109:8142)
    at M (https://aframe.io/releases/0.9.0/aframe.min.js:99:27748)
    at Re.renderBufferDirect (https://aframe.io/releases/0.9.0/aframe.min.js:100:6115)
    at x (https://aframe.io/releases/0.9.0/aframe.min.js:99:22431)
    at y (https://aframe.io/releases/0.9.0/aframe.min.js:99:22087)

But when loading assets via a-asstes instead of fetch-api, none mode works while webvr mode crashed with the same crash message that started this issue.

I was thinking that a potential root cause for this is that, when putting external media resources in a-assets, a-frame will try to get all resources with XHR request and receive them as text response, but if they are loaded via fetch-api, developers can use file reader and readAsDataUrl to convert blob into url object.

Aframe might be doing something different at first launch, that changes how assets are imported and rendered in the application, hence the crash when unexpected format is retrieved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants