viromedia / virocore

ViroCore cross-platform AR/VR renderer
MIT License
370 stars 108 forks source link

[ 1.6.0 ] Error with some devices (Android 5.0 and 6.0) #103

Closed rgipd closed 6 years ago

rgipd commented 6 years ago

Hi.

I notice some devices, specially between Android 5.0 (Lollilop) API 21 and 6.0 (Marshmallow), the ViroViewScene just doesn't works. The layout for it, that works flawless in Android 7.0 and 8.0, for devices with same capabilities and specs, stay white in 5/6 versions.

Some devices for quick info: Lenovo Vibe B (6.0), Samsung J5 and Samsung J5 Pro (5.0/60) and few others that are not bad phones.

I found that Lenovo and Samsung uses Mali as GPU.

This output appears every second in Android Studio "Run" window:

I/BufferQueueProducer: [SurfaceTexture-0-13087-0](this:0x9eb7f400,id:0,api:1,p:13087,c:13087) queueBuffer: slot 0 is dropped, handle=0xaf850640
I/BufferQueueProducer: [SurfaceTexture-0-13087-0](this:0x9eb7f400,id:0,api:1,p:13087,c:13087) queueBuffer: slot 1 is dropped, handle=0xaf850780
I/BufferQueueProducer: [SurfaceTexture-0-13087-0](this:0x9eb7f400,id:0,api:1,p:13087,c:13087) queueBuffer: slot 0 is dropped, handle=0xaf850640
I/BufferQueueProducer: [SurfaceTexture-0-13087-0](this:0x9eb7f400,id:0,api:1,p:13087,c:13087) queueBuffer: slot 1 is dropped, handle=0xaf850780
I/BufferQueueProducer: [SurfaceTexture-0-13087-0](this:0x9eb7f400,id:0,api:1,p:13087,c:13087) queueBuffer: slot 0 is dropped, handle=0xaf850640

In the logcat, some info:

04-29 18:21:20.892 13087 13148 I Viro    : GPU vendor [ARM], renderer [Mali-T720]
04-29 18:21:20.892 13087 13148 I Viro    :    Detected antiquated Mali-T720 GPU, rendering will be limited

P.S.: This Mali-T720 support even OpenGL | ES 3.1, it's not so antiquated.

And more logcat:

04-29 18:21:20.910 13087 13148 I Viro    : Creating render targets with configuration:
04-29 18:21:20.910 13087 13148 I Viro    : [MRT supported:   0]
04-29 18:21:20.910 13087 13148 I Viro    : [Shadows enabled: 0]
04-29 18:21:20.910 13087 13148 I Viro    : [HDR supported:   0, HDR enabled:   0]
04-29 18:21:20.910 13087 13148 I Viro    : [PBR supported:   0, PBR enabled:   0]
04-29 18:21:20.910 13087 13148 I Viro    : [Bloom supported: 0, Bloom enabled: 0]
04-29 18:21:20.911 13087 13148 I BufferQueueProducer: [SurfaceTexture-0-13087-0](this:0x9eb7f400,id:0,api:1,p:13087,c:13087) new GraphicBuffer needed

So, the screen/layout stays with the Android layout background color and doesn't shows nothing. Using PBR, HDR or not using it at all, just a cube, nothing.

Do Viro uses some mapping for GPU devices that can run or not run, or this is made by runtime? How can I trust that someone with a device using a different GPU will be able to purchase and run the app in Google Play Store and will work?

Or Android 5.0 and 6.0 is (and won't) be supported by Viro yet? My target is API 21+, I will only use ViroViewScene, no AR or VR. Just 3d scene with HDR/PBR.

Thanks!

radvani commented 6 years ago

Hi @rgipd, we've identified some issues with our Mali support and are actively looking into improving our support for Mali now, in time for our next release.

The minimum supported version for ViroViewScene is Android 5.0 (API 21). Viro does perform some mapping of GPU devices at runtime, but it doesn't stop any device from running. At most, Viro will disable certain features (e.g. HDR, PBR) for older GPUs.

rgipd commented 6 years ago

@radvani Thanks for the reply, but, older GPUs is the ones that support only OpenGL | ES 1.1 and 2.0, right? Far I know, for OpenGL ES | 3.0+ all GPUs can handle HDR and PBR by shader.

My problem is not viro stop the device from running (this is good), but it doesn't shows nothing. Maybe some TextView : "This device is not supported. Contact the developer", something like that. Or thow an error so we can handle with the callback (StartupListenerCallback), so we can show the user that the device is not supported. (onDeviceIsNotSupported).

Thinking like an user that downloaded a game/app, I prefer to be notified: "Your device is not supported yet. Contact the developer", than a white/blank screen with nothing being show.

The Mali GPU are not the best GPU in market, but a lot of devices, specially in emerging countries like India and Latin America, South America have a lot of (entry/cheap and intermediate) devices with Mali.

I'm looking forward the next release, do you have any idea of time it will be released?

Thank you.

radvani commented 6 years ago

Hi @rgipd, that shouldn't happen with Mali GPUs -- is there a test scene you can send me that's failing on your end? So far we've fixed one Mali driver bug, in that Mali cards don't correctly report when they've acquired an sRGB framebuffer, resulting in over-saturation. However, the bug you're describing seems different. I'm testing currently with a Mali-T830.

rgipd commented 6 years ago

@radvani I just initialize the ViroView (in layout xml or in the source code, same issue in both cases). My test code is nothing different from the "Getting Started" code, just positioned the camera, a box and setup the scene to use HDR background and PBR chromed material in the box.

When I run it, just show blank/white (that's the layout background).

But happened in all devices with Android 5.0 and Android 6.0 that I tested (all devices have Mali). In the Android ARM emulator (that runs after 1 hour to boot the apk), I could see that ViroView has initialized. So it's a problem in real devices. Just with Mali, or maybe (hope not) with another GPU models.

radvani commented 6 years ago

Hi @rgipd, I think I know what's wrong there: are all those devices using the Mali-T720 specifically? We had an errant check in our code (which you noticed above, in your initial post) where we disable a lot of rendering features for that GPU. I believe that was causing the issues; we've removed this for our next release.

rgipd commented 6 years ago

@radvani Not just Mali T720. Mali-T830 MP1 and Mali-T830MP2 as well in another 2 devices I could test.

There are any way in code to know when all rendering is disabled so I can put a message to the user that the device is not supported?

When do you think the next release will be out?

Thanks.

radvani commented 6 years ago

@rgipd The rendering features disabled check is being removed for all cards except old Adreno GPUs, which have significant driver issues (that is, Adreno330 and earlier), so you won't run into this after the next release. In the current release this only occurs with Mali T720 and those older Adreno GPUs. I'm testing other Mali drivers now to ensure they work correctly. The next release is targeted for mid to late May.

rgipd commented 6 years ago

@radvani Ok, please let me know :)

dam00n commented 6 years ago

This was fixed in ViroCore 1.8. Please re-open if you are running into issues