Topic locked

ReadPixels error with Unity Pro license

May 22, 2013 - 3:52pm #1

I'm working on an iOS app for iPads using Vuforia and NGUI and recently upgraded to a Unity Pro license. Running the project in the editor gives me the following error, apparently being called every frame:

ReadPixels was called to read pixels from system frame buffer, while not inside drawing frame. UnityEngine.Texture2D:INTERNAL_CALL_ReadPixels(Texture2D, Rect&, Int32, Int32, Boolean)

I am not calling ReadPixels anywhere, but it does get called in WebCamImpl.cs in GetPixels32AndBufferFrame(int frameIndex), that's where the error is coming from, and I'm guessing that method is being called by Vuforia. I've seen another post on the Unity forums http://answers.unity3d.com/questions/455513/vuforia-unity-readpixels-error.html#answer-455577 that mentions a similar problem.

I have an element, a UISprite, that starts out completely out of the frame in an AR scene, as well as another that is mostly out of frame. These elements slide down/in when activated. I'm assuming that they are the cause of the error. The project runs fine in the editor and on the device, but the error has me worried. Any idea if these 2 elements may be causing the problem? If so, is this error something to worry about? Or is there a workaround other than putting the elements in the frame? Thanks!

ReadPixels error with Unity Pro license

June 26, 2014 - 9:04am #41

To summarize:

  • Vuforia (since version 2.8, with Unity 4.3 and above) does not require a Unity Pro license (this is also mentioned in the Release Notes in here https://developer.vuforia.com/resources/sdk/unity)
  • therefore, you can use the Free Unity license to develop and deploy (including Play Mode feature as well the ability to deploy on mobile target);   
  • nevertheless, you are of course free to also use the Pro License
  • we have extensively tested Vuforia with both the Free and Pro license versions of Unity, on Mac and Windows PC, and we were not able to reproduce the reported error message
  • as some of you have reported, things worked fine when using Trial version of Unity Pro, but going wrong after upgrading from Trial to Full Pro license; this seems to point to some license managament issue in Unity (license upgrade issue)
    • if you have upgraded license from Trial to Full, and you have reopened an existing project, you can try to close Unity, delete the /Library folder from your project root folder, and reopen the project (Unity will automatically regenerate the Library folder)
  • as Patrick (Hightree) has reported in this thread, the issue might also be related to a sort of "license misalignment" between the Pro License used for Unity and the Free license used specifically for the Android or iOS specific target; this also suggests a license management issue in Unity
  • we have not been able to reproduce this issue in our tests so far, however for those experiencing this issue, the recommendation is to follow the simple workaround suggested in a previous post, i.e.:
  • in Build Settings:  select the PC (standalone) build target when using Play Mode
  • in Build Settings:  select the mobile (Android or iOS) build target when building / deploying to your mobile device

 

ReadPixels error with Unity Pro license

June 26, 2014 - 7:48am #40

Hi there,
I'm running into the same issue and I think I understand what is causing it.

I'm running unity pro with an iOS pro license and a free android license.
Build target = PC -> play mode works
Build target = Android -> play mode does not work
Build target = iOS -> play mode works

So I presume a pro license is also needed for the target platform, not just unity itself.
I think this is cause by vuforia using render to texture effects.

Ciao, Patrick

ReadPixels error with Unity Pro license

June 25, 2014 - 4:06pm #39

Hello! Thanks for your answer

I m on Osx , so i remove completly Unity from my system (using AppCleaner), reinstalled it (4.5) , create a new prjoject, imported vuforia video playback 3.07, open the sample scene, switch platform to ios, and still the infamous error "ReadPixel" is there!

 

any other tips?

Emiliano

ReadPixels error with Unity Pro license

June 25, 2014 - 12:24pm #38

You can try the following:

  • uninstalling Unity
  • clearing any cache data that Unity might have created, likely under C:\Users\YOUR_USERNAME\AppData\Local\Unity (note: the AppData dir might be not visible, in which case you will need to show it as explained in here: http://windows.microsoft.com/en-us/windows/show-hidden-files#show-hidden-files=windows-7)
  • install latest Unity version (currenty 4.5.1) and enable your Pro license with it
  • install latest Vuforia version (currently 3.0.6)

Also, note that since version 2.8 and Unity version 4.3, Vuforia does not require a Unity Pro license (while in older versions that was needed to support advanced features such as Play Mode with webcam).

Hope this helps.

 

ReadPixels error with Unity Pro license

June 25, 2014 - 9:06am #37

I m facing this too and it's very frustrating!

Any solutions beside the switching method?

Emiliano

 

p.s

I have UnityPro and IOS and Android basic license

ReadPixels error with Unity Pro license

January 27, 2014 - 5:26am #36

Thanks for sharing the tips !

ReadPixels error with Unity Pro license

January 27, 2014 - 4:10am #35

Thank you. Maybe include it in the list of known issues as well.

EDIT: my current workaround is to switch build platform to Standlone from iOS, and then switch back again when I do the build.

~ce

ReadPixels error with Unity Pro license

January 21, 2014 - 10:11am #34

I don't think Vuforia "is blaming" Unity; it's just an issue that requires further investigation.

I will follow up with Unity to see what can be done with this issue.

 

ReadPixels error with Unity Pro license

January 21, 2014 - 9:18am #33

Yes, for my part, that seems to be the issue. The thread states that Vuforia is blaiming Unity. So is Vuforia making sure that the Unity crew is working on a solution?

EDIT: I didn't update to Unity Pro. It's been Pro all along.

~ce

ReadPixels error with Unity Pro license

January 21, 2014 - 8:47am #32

Hi dleight,

it seems what you describe is a known Unity issue, when upgrading from trial to PRO, see this thread:

http://answers.unity3d.com/questions/455513/vuforia-unity-readpixels-error.html

 

ReadPixels error with Unity Pro license

January 21, 2014 - 3:25am #31

Thank you. Though, I'm not trying to read pixels in my code. After working on a Vuforia project for a while, I get the ReadPixels error. Even with a standard ARCamera prefab in an empty scene. Creating a new project and importing the Vuforia assets again fixes the issue, but only temporarily. The error keeps reappearing. (Unity Pro 4.3.3f1 Vuforia 2.8.7).

~ce

ReadPixels error with Unity Pro license

January 21, 2014 - 1:15am #30

Hi Alessandro,

Thank you for responding to my message.  Similar to Carl, I am not specifically trying to read the pixels in the background texture.  I had everything working fine, but when I upgraded from the trial to the paid pro version of Unity I received this message.  Nothing changed in the code in the interim.  I'm assuming there is a bug somewhere.  Are suggesting that these are workarounds to a known bug or am I missing the point?

Thanks for your help.

Daniel

ReadPixels error with Unity Pro license

January 20, 2014 - 4:42am #29

An alternate method to access the camera pixels is described here:

https://developer.vuforia.com/resources/dev-guide/unity-camera-image-access

Also, this article provides some extra information on setting the Camera Frame Format, in case you need it:

https://developer.vuforia.com/forum/faq/unity-how-can-i-reset-frame-format-scene-reload

 

ReadPixels error with Unity Pro license

January 18, 2014 - 8:25am #28

I'm also getting the ReadPixels error and no camera image in PlayMode with Unity Pro. Is there any workrounds for this while we are waiting for an update?

 

~ce

ReadPixels error with Unity Pro license

January 16, 2014 - 12:48am #27

Hi, as I said in my previous message:

the ReadPixels method only works in Play Mode; on device, the texture comes from the underlying OpenGL implementation, so pixel access is not available.

But another way of getting the camera image pixels (also on device) is documented here:

https://developer.vuforia.com/resources/dev-guide/unity-camera-image-access

 

ReadPixels error with Unity Pro license

January 15, 2014 - 2:44pm #26

Has anyone found a solution to this?  I am having the same problem.  I had everything working fine with the Unity Pro trial, then my trial expired and everything still worked fine. Then I upgraded to a full (i.e. non-trial) license and I'm getting the readpixels error in play mode.  I am able to compile to iOS without issue, but can't test in play mode anymore without receiving the ReadPixels error.

Any help is greatly appreciated I am on a very tight timeline.

I will also contact Unity.

Thanks for your help.

Daniel

ReadPixels error with Unity Pro license

December 20, 2013 - 11:47am #25

Were right, the solution of the problem with Xcode is UnityAppController.mm change in the following:

QCARUnityPlayer :: getInstance () QCARSetOrientation (_curOrientation).;

to

QCARUnityPlayer :: getInstance () QCARSetOrientation ([orientation intValue]).;

Thx

ReadPixels error with Unity Pro license

December 20, 2013 - 8:20am #24

Sorry, but affect the functionality and before correctly found and could be tested in unity3D, as i thought but did not affect the export to Xcode to compile , generates the following error:
 

Undefined symbols for architecture armv7:
Apple Mach -O Linker Error
" __curOrientation " , referenced from:

And not compile

 

Thx

ReadPixels error with Unity Pro license

December 20, 2013 - 8:10am #23

As Scott5678, you can ignore those error, as they may appear on the console but should not affect the functionality.

 

ReadPixels error with Unity Pro license

December 20, 2013 - 8:03am #22

Hi,

IOS platform and do not move the mouse , but the trial license absolutely nothing happened , is not that the error is due to this error happens on the desktop platform but there recognizes the webcam but if you lower the resolution , try changing of platform twice but still not working.

 

Thx

ReadPixels error with Unity Pro license

December 20, 2013 - 8:00am #21

I see one of those errors every once in a while when I hit play, but only one shows up, and it doesn't affect anything, so I just ignore it.

ReadPixels error with Unity Pro license

December 20, 2013 - 7:58am #20

Are these errors preventing you from playing the scene in Play Mode?

Try not to move your mouse over the screen when Play Mode is initiating - that's what causes these errors.

ReadPixels error with Unity Pro license

December 20, 2013 - 7:09am #19

Hi, thanks for reply,

 

My project developer in unity3D with Vuforia, but with the try licence 30 days unity Pro operating correctly, but buy licence pro and enter number serial and appears error ReadPixels, i do not understand how to fix the error with the previous link.

Error 1:

Screen position out of view frustum (screen pos 750.613281, 274.984375) (Camera rect 0 0 1012 794)
UnityEngine.Camera:ScreenPointToRay(Vector3)
ColourChange:Update() (at Assets/Scripts/ColourChange.js:24)

Error 2:

Screen position out of view frustum (screen pos 750.613281, 274.984375) (Camera rect 0 0 1012 794)
UnityEngine.SendMouseEvents:DoSendMouseEvents(Int32, Int32)

 

Are 141 reply errors.

 

Thx

ReadPixels error with Unity Pro license

December 20, 2013 - 2:48am #18

You need to switch platforms to the PC to do testing with your webcam, and then switch platforms again when you want to compile for iOS or android. I got a Unity extension called "Fast Platform Switch" which has reduced this switching time from more than 5 minutes to less than 20 seconds. It simply keeps a cache of all the platforms.  It has been a lifesaver and has allowed us to iterate many times faster.

ReadPixels error with Unity Pro license

December 20, 2013 - 2:07am #17

Hi, the ReadPixels method only works in Play Mode; on device, the texture comes from the underlying OpenGL implementation, so pixel access is not available.

But another way of getting the camera image pixels (also on device) is documented here:

https://developer.vuforia.com/resources/dev-guide/unity-camera-image-access

 

ReadPixels error with Unity Pro license

December 19, 2013 - 1:30pm #16

How solution 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) (at Assets/Qualcomm Augmented Reality/Scripts/Internal/WebCamImpl.cs:257)
QCARManagerImpl:InjectCameraFrame() (at Assets/Qualcomm Augmented Reality/Scripts/Internal/QCARManagerImpl.cs:633)
QCARManagerImpl:Update(ScreenOrientation, CameraDeviceMode, VideoModeData&) (at Assets/Qualcomm Augmented Reality/Scripts/Internal/QCARManagerImpl.cs:258)
QCARBehaviour:Update() (at Assets/Qualcomm Augmented Reality/Scripts/QCARBehaviour.cs:441)

No running example & my project not found for iOS!

 

Thx

ReadPixels error with Unity Pro license

June 21, 2013 - 2:30pm #15

The app works fine on our iPad, but the webcam doesn't work, and errors are thrown in the console. You might try switching the build platform in the Build Settings to see if that makes your console errors go away.

ReadPixels error with Unity Pro license

June 21, 2013 - 2:27pm #14

I just thought I should mention that the app I was working on when this problem came up was used on several iPads a few days ago at a trade show and as far as I know did not crash and did not seem to be affected by this error. I'm not using the web cam so that isn't an issue for me but having this error show up every frame makes using the console a little tough. 

ReadPixels error with Unity Pro license

June 21, 2013 - 2:14pm #13

I found a potential solution, and I'm not sure whether this is a bug or just me not understanding something. If I open the Build Settings in Unity, select "PC, Mac & Linux Standalone", and then click "Switch Platform", the webcam again works.

I was doing some before and after testing with a git repository to see which files were changing, and by reverting a single file, "EditorUserBuildSettings.asset", I could make it work / not work.

If this isn't a bug, do I need to always switch platform back to standalone everytime I want to use the webcam during development? 

ReadPixels error with Unity Pro license

June 21, 2013 - 1:29pm #12

I was able to start a new project and add a simple ImageTracker, and successfully view the video stream on the webcam without errors. So this means it's not just an issue with Unity Pro.

I've struggled to create a good example project that always breaks or always works. I can't be sure, but the issue may be intermittent, or dependent on something outside the project.

I send Unity and David a project that works at first, but then after making an iOS build, stops working. (video from webcam isn't display). Thanks for the support!

ReadPixels error with Unity Pro license

June 21, 2013 - 1:13pm #11

Thanks for the info Scott. The mouse position doesn't make any difference for me either. David, I also filed a bug report and will get you the case #. Thanks.

ReadPixels error with Unity Pro license

June 20, 2013 - 2:37pm #10

No errors message or problems at all when I set up a project from scratch with a simple ImageTarget following these instructions: https://developer.vuforia.com/resources/dev-guide/step-2-compiling-simple-project

The error continues to be generated regardless of mouse position or focus.

Correction to my earlier report, the tracking is still working, the only issue is the video is black and the errors are generated every frame. The AR objects turn on and off as expected.

 

ReadPixels error with Unity Pro license

June 20, 2013 - 2:27pm #9

Please PM the case number that they provide and I'll try to follow-up on our side.

BTW does this occur when your mouse pointer is outside of the Play Mode window?

ReadPixels error with Unity Pro license

June 20, 2013 - 2:14pm #8

Forgot to mention version info:

Running on Mac, OS X, 10.8.4, MacBook Pro late 2011.

Unity: 4.1.5f1

Vuforia: vuforia-sdk-ios-2-0-32

ReadPixels error with Unity Pro license

June 20, 2013 - 2:09pm #7

I'm experiencing the same thing. I upgraded to Unity Pro in order to utilize the web cam during development, but ran into the same bug. The specific error that prints out every frame is:

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) (at Assets/Qualcomm Augmented Reality/Scripts/Internal/WebCamImpl.cs:244)
QCARManagerImpl:InjectCameraFrame() (at Assets/Qualcomm Augmented Reality/Scripts/Internal/QCARManagerImpl.cs:448)
QCARManagerImpl:Update(ScreenOrientation) (at Assets/Qualcomm Augmented Reality/Scripts/Internal/QCARManagerImpl.cs:192)
QCARBehaviour:Update() (at Assets/Qualcomm Augmented Reality/Scripts/QCARBehaviour.cs:423)
 
I tried the Frame Markers demo, and it worked fine.
 
The Occlussion Management sample works, but still prints out the error.
 
Unfortunately, on my project, the webcam view is black.
 
I believe it worked when my Unity Pro Trial was working.
 
I will file a bug with Unity, and continue trying to figure out what's different about the projects. I'll try to make a small demonstration project that illustrates the issue.

 

ReadPixels error with Unity Pro license

May 31, 2013 - 9:04am #6

My recommendation is to file a bug w/ Unity. Is this occurring w/ all of your Vuforia projects in Unity?

ReadPixels error with Unity Pro license

May 28, 2013 - 3:10pm #5

We actually upgraded from the regular free version with the iOS license, we have never had a trial as far as I know. The AR scenes are still running fine. The app is stable but having this error being spit out each frame makes using the console a little tough, so I would really like to get rid of it. Any other suggestions?Thanks.

ReadPixels error with Unity Pro license

May 23, 2013 - 1:08pm #4

Did you happen to upgrade from a Trial version, that seems to be a common factor in the other reports I've found on this issue.

Is the error preventing you from using the Vuforia Play Mode, or can you still run your scenes?

ReadPixels error with Unity Pro license

May 23, 2013 - 7:05am #3

My build settings are correct, the project builds and runs fine on the device. There is no warning in the Web Cam Bevaiour panel either. I wasn't sure if you meant the Unity console, but here is the full 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) (at Assets/Qualcomm Augmented Reality/Scripts/Internal/WebCamImpl.cs:244)
QCARManagerImpl:InjectCameraFrame() (at Assets/Qualcomm Augmented Reality/Scripts/Internal/QCARManagerImpl.cs:448)
QCARManagerImpl:Update(ScreenOrientation) (at Assets/Qualcomm Augmented Reality/Scripts/Internal/QCARManagerImpl.cs:192)
QCARBehaviour:Update() (at Assets/Qualcomm Augmented Reality/Scripts/QCARBehaviour.cs:417)
 
I'm using Unity 3.5.7f6 Pro with Vuforia extension 2.0.30. Thanks David.

ReadPixels error with Unity Pro license

May 22, 2013 - 4:52pm #2

Check your build settings to confirm that you are set for the correct target plaform, and also check the Web Cam Behaviour panel in the ARCamera inspector to confirm that your license is being recognized - you'll see a warning if not.

If those steps don't help, please post the stack trace from you Console and tell me which Unity version and Vuforia Unity Extension version you are using.

Topic locked