Log in or register to post comments

Same Unity build on two Experia Z4 tablets - different camera re

November 12, 2015 - 3:57am #1

Hi Alessandro

I have an odd problem whereby I have the same build of a Unity Vuforia App running on two identical tablets (maybe slightly different firmware) but one tablet shows a more "zoomed in" view than the other.

Camera mode is set to DEFAULT, or QUALITY - makes no difference.

It makes no difference whether the tablet resolution is native 2560*1600 or scaled down to say 1280*800 using Screen.SetResolution(1280, 800, true);

 

The odd thing is that when I use the built-in camera app the tablets show an identical view i.e. both at the same level of zoomed in.

Do you have any idea what could be causing this or how I might be able to find out what might be causing this?

 

many thanks in advance,

Nalin

 

Same Unity build on two Experia Z4 tablets - different camera re

November 13, 2015 - 9:16am #6

Where do you call that code ?

I'd suggest putting it in the Start() method of one of your script.

Also, make a quick search in your project scripts to check that no other script is setting the frame rate to 60 fps (using the same API).

 

Same Unity build on two Experia Z4 tablets - different camera re

November 13, 2015 - 7:11am #5

Thanks Alessandro

This info really helps a lot.

I changed the frame rate using this code

Application.targetFrameRate = 30;

...but using AdvancedFPS it is showing exactly the same frame rate of 60fps to begin with.

 

Any ideas?

cheers

Nalin

 

Same Unity build on two Experia Z4 tablets - different camera re

November 13, 2015 - 6:01am #4

...One other thing we are seeing is dropping frame rates where the app starts out at 60fps (a bit strange in itself as I thought Vuforia was locked to 30fps?) ...

In Unity the frame rate is by default set to 60fps on Android and 30fps on iOS; this has always been the case in recent versions of Unity and Vuforia; you can however enforce a 30fps (or a different frame rate) by using the Unity API, if you like:

Application.targetFrameRate = 30;

 

...and then after viewing a target multiple times with a complex augmentation (250K + polygons) and then after maybe 10 views it drops down to 20-30fps and bbecomes quite jerky...

Most likely a CPU/GPU overheating issue, which forces the CPU (and/or the GPU) to throttle down to a lower clock frequency, so to cool down and avoid excessive battery draining; we've seen the same kind of behaviour when running on complex/heavy scenes; Vuforia is also part of the overall loading of the CPU, but it's really the overall sum of all rendering and processing tasks that can make the difference; reducing scene complexity would likely keep the CPU and GPU a bit less loaded and would reduce heating.

Note that if you enforce a 30fps up-front since the app start, you should then be able to keep your device much cooler for a  much longer time; this would result in more stable (constant) fps over time and in a much longer battery duration (you've probably noticed how fast the battery goes down when you run at 60fps..)

 

 

...We captured this on a profiler (shown in the attachment) which shows it spending 108ms in Camera.Render() doing what appears not very much, but could likely be the cause of any slowdown...

See comments above. 

 

Same Unity build on two Experia Z4 tablets - different camera re

November 13, 2015 - 5:15am #3

Thanks Alessandro

One of the tablets had an older version of the Experia software on it and after upgrading to it this issue went away and both tablets now have the same camera view in Vuforia - how strange?

 

One other thing we are seeing is dropping frame rates where the app starts out at 60fps (a bit strange in itself as I thought Vuforia was locked to 30fps?) and then after viewing a target multiple times with a complex augmentation (250K + polygons) and then after maybe 10 views it drops down to 20-30fps and bbecomes quite jerky.

We captured this on a profiler (shown in the attachment) which shows it spending 108ms in Camera.Render() doing what appears not very much, but could likely be the cause of any slowdown.

Do you know what could be causing this?

 

cheers

Nalin

AttachmentSize
Image icon VuforiaProfilerProblem.png109.17 KB

Same Unity build on two Experia Z4 tablets - different camera re

November 12, 2015 - 6:51am #2

Hi Nalin,

could you run this code in both tablets and see what you get?

Vuforia.VuforiaRenderer.VideoTextureInfo info = Vuforia.VuforiaRenderer.Instance.GetVideoTextureInfo ();
Debug.Log ("Video image size: ", info.imageSize.x + "x" + info.imageSize.y);
Debug.Log ("Video texture size: ", info.textureSize.x + "x" + info.textureSize.y);

 

Then, please also share exact device model number and Android OS version of each tablet instance.

 

Log in or register to post comments