Log in or register to post comments

Android unity black screen?

March 6, 2014 - 2:54am #1

Hi,

Versions...

Unity Version: 4.3.0f4
Vuforia Unity: 2.8.7

 

I'm trying to create a project but the live preview doesn't work and shows a black screen, however inside the scene view in Unity the TextureBufferMesh ( Plan with the my camera ) shows.
This issue only accures when using the Andriod platform but works with iOS etc...

I get the error 

ReadPixels was called to read pixels from system frame buffer, while not inside drawing frame.
UnityEngine.Texture2D:ReadPixels(Rect, Int32, Int32, Boolean)
WebCamImpl:GetPixels32AndBufferFrame(Int32)
QCARManagerImpl:InjectCameraFrame()
QCARManagerImpl:Update(ScreenOrientation, CameraDeviceMode, VideoModeData&)
QCARAbstractBehaviour:Update()

Any suggestions? - I have tried a brand new/ clean project and imported Vuforia and still get the same issues.

Thanks!

Android unity black screen?

March 10, 2014 - 8:41am #21

Ok, thanks for the update. Cheers.

 

Android unity black screen?

March 10, 2014 - 8:19am #20

As much as I'd like to help I can't. Built to the device again and it now works after 5 fail attempts. If this persist I'll keep this post updated. 

Thanks,

R

Android unity black screen?

March 10, 2014 - 8:16am #19

I tried building the sample app to my device and found that the camera works on the device just not in Unity preview, never tried it before as my custom project didn't work. Wish means its my custom project and an issue with the camera/ NGUI. Thanks for the help Aless, I'll post on how I fixed it afterwards for others. 

Android unity black screen?

March 10, 2014 - 8:05am #18

This is really holding me back on what I need to do, Hope theres a solution as I can't seem to find one :-(

Android unity black screen?

March 10, 2014 - 7:39am #17

Ah I was convinced it was! And thought well you know you're stuff so I must be wrong, haha. 

Might just be as simple as that I don't have the Andriod Pro version then?
However I can actually switch the platform to Andriod, and build to my tablet makes me think it isn't a licensing issue.

After looking more into the error of readpixels I found a link between my error and a previous post here on Vuforia developer fourms.
https://developer.vuforia.com/forum/unity-3-extension-technical-discussion/readpixels-error-unity-pro-license

And you forwarded them to an alternative method to access the camera? Is this the only way around this issue? Just strange it appears to be just me having this problem when there's nothing different.

Android unity black screen?

March 10, 2014 - 6:43am #16

Sorry, you're right, the TextureBufferCamera is added tot he scene at runtime by Vuforia :-)

So, I believe the issue could simply be caused by one of these 2:

- you don't have a Unity Android license (so, it works OK if you select iOS, but not on Android)

or:

- you have some installation issues with your Unity 4.3

 

Note that Vuforia 2.8 is fully compatible with Untiy 4.3, the only known issue is that you cannot use the "Multi-threaded rendering" option in the OpenGL settings in the Player settings; maybe wirth checking if this is accidentally enabled (if so, please disable it).

 

Android unity black screen?

March 10, 2014 - 5:32am #15

Ah I see, I thought the TextureBufferCamera was produced from Vuforia on run time. 

I haven't imported any additional content though this is where I'm getting a confused then?  

 

It's jsut I've downloaded your sample project, then navigated to the scene directory and opened a scene and still have the same problems.

Just tried switching the platform to iOS and it works as expected even though the GameObject - TextureBufferCamera is still there.

 

As shown from the screenshot theres nothing else in the project so I don't understand if its not from Unity or Vuforia wheres it coming from - confused. I'll look into the TextureBufferCamera a little more see if I can find anything.

 

Edit-----

Just to add the TextureBufferCamera only appears on run time.

When I hide the game object through the inspector at run time, the camera preview preview box and the plane with the video feed ( inside the scene window in Unity) disappears.

Android unity black screen?

March 10, 2014 - 5:06am #14

Thanks,

so from the screenshot you attached I can see you have a TextureBufferCamera object in your scene; since this is not a Vuforia component, and it is also NOT a standard Unity component, it seems it is coming from a custom or 3rd party project / code;

my point is, without understanding exactly what this TextureBufferCamera does, it is hard to tell where the problem is, on the Vuforia side, as the issue may originate from some specific interactions between your TextureBufferCamera code and Vuforia + Unity.

 

Android unity black screen?

March 10, 2014 - 4:34am #13

Sorry Alex, doing multiple things at once can't multi-task. Oops.

I have tried creating a new project and importing vuforia plugin (v2.8.7), switching the platform from desktop to Andriod

I've also tried,

Opening a Vuforia sample scene and switching the platform to Andriod and I still get the same result.

 

The error I get is, readPixels as added in a previous post, and a black screen. 
When I switch the platform to iOS or desktop in the sample scenes or the new project the readPixels error goes and the Unity preview works.

Please see the attached image too.

Sorry for confusing you!

Android unity black screen?

March 10, 2014 - 4:17am #12

Ok, so, I'm a bit lost here:

  ... tried to view it through Unity using my website and still the same error.

I'm not yet very clear on what you are doing exactly.

Could you explain step by step what is your setup ?

If you just import the samples in Unity, you build and run them, they should work.  Now, there is something extra that you are doing, from the thread it seems related to some render-to-texture (in my understanding), but there is a lack of details in your descrioption, if you could fill this gap this would help me understand better the issue (and perhaps I can try to reporoduce it...)

?

 

Android unity black screen?

March 10, 2014 - 3:39am #11

Hi Alex,

Sorry for the misunderstanding, the sample projects are the same as the custom projects. 

They both do not work and appear with the same error, Just updated Unity to 4.3.4 and still the same error occures.

 

I've downloaded the sample projects, switched the platform to Andriod and tried to view it through Unity using my website and still the same error.

Android unity black screen?

March 10, 2014 - 3:05am #10

If the samples run fine, then I assume this issue could come from some weird interaction with NGUI in your project.

I know many other developers have integrated NGUI with Vuforia, so, I would suggest trying and debug the issue so to be able to isolate the problem and localize the root cause.

 

 

Android unity black screen?

March 10, 2014 - 2:25am #9

Yeah sure, I get the exact same error when I open up a Vuforia sample scene and try press play to view it through the game preview window in Unity. 

When on the Andriod platform I get this error, if I switch to another platform I don't get it. Same with my custom projects too. 

However I am using NGUI thats the only thing I can think of, but that's using my custom scene, and the problem wouldn't happen in the Vuforia example scene. but it does?

Android unity black screen?

March 7, 2014 - 7:37am #8

I see.

The error message:

ReadPixels was called to read pixels from system frame buffer, while not inside drawing frame

suggests that you are performing a read pixels operation outside the OpenGL rendering thread, which seems to be problematic.

Could you describe in more details what exaxctly you do; for instance, I seem to understand that you are basically applying some kind of "render-to-texture" technique, but a bit more details would help understand the scenario better.

 

 

Android unity black screen?

March 7, 2014 - 6:45am #7

Well it happens inside Unity preview and on my Galaxy Tablet so I think its not just for the single device. 

 

As mentioned before though Inside Unity I'm able to see the TextureBufferMesh but through my preview/game window I can't as its black with the error

I mentioned happening every frame.

Android unity black screen?

March 7, 2014 - 6:18am #6

Does this happen on a specific device only ? Have you tried on a different device to see if the issue is device-related ?

 

Android unity black screen?

March 7, 2014 - 5:59am #5

Hi Aless,

I have tried the sample scenes from Vuforia and they appear with a black screen too for the camera, with the error

 

ReadPixels was called to read pixels from system frame buffer, while not inside drawing frame.
UnityEngine.Texture2D:ReadPixels(Rect, Int32, Int32, Boolean)
WebCamImpl:GetPixels32AndBufferFrame(Int32)
QCARManagerImpl:InjectCameraFrame()
QCARManagerImpl:Update(ScreenOrientation, CameraDeviceMode, VideoModeData&)
QCARAbstractBehaviour:Update()

I can build to andriod devices and the introduction screen appears but when attempting to view the camera its just a black screen similiar to the Unity preview

Any suggestoins? Thank you.

Android unity black screen?

March 6, 2014 - 8:00am #4

Ok. Is this on your Application ? or can you also reproduce it with one of the Vuforia samples ?

 

Android unity black screen?

March 6, 2014 - 6:23am #3

Hi,

No I'm just trying to use the Unity in-game preview tab to preview Vuforia but comes up with that error?

I've tried a new project and it still happens. 

thanks for helping by the way,

R

Android unity black screen?

March 6, 2014 - 4:36am #2

Not sure what you are trying to do exactly ... it seems that you are trying to explicitly inject an image into QCAR, but this is not a supported use case..

 

Log in or register to post comments